• Alexander Timin's avatar
    Introduce WebContentsObserverList to encapsulate common behaviour · 90c20c39
    Alexander Timin authored
    Add a dedicated helper struct for holding WebContentsObservers. This
    allows us to ensure that iteration over all observers can be detected:
    
    - This can replace existing is_notifying_observer_ WebContentsImpl
    member and ensure that it's set for almost all observer iterations.
    
    - This allows us to emit a trace event covering observer iteration.
    
    Escape hatch is kept for now for the three places which want to return
    value as soon as matching observer is found.
    
    Also WeakPtr-based logic is added to RenderViewTerminated as some observers
    are actually trying to delete WebContents there.
    
    R=nasko@chromium.org
    
    Change-Id: Ic94cf9bbc83b2d9bfe93a3090a4f4af3fd8f60dc
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343269Reviewed-by: default avatarSami Kyöstilä <skyostil@chromium.org>
    Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Commit-Queue: Alexander Timin <altimin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#797266}
    90c20c39
render_view_host_impl.cc 33.2 KB