Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Issue 1545683002: Use WeakPtr to RenderWidgetHostViewBase in InputEventRouter. (Closed)

Created:
5 years ago by wjmaclean
Modified:
5 years ago
Reviewers:
Fady Samuel, nasko
CC:
chromium-reviews, darin-cc_chromium.org, jam, kenrb
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use WeakPtr to RenderWidgetHostViewBase in InputEventRouter. Since it is difficult to ensure when nested WebContents (a top-level WebContents and one or more guests) may be destructed, it is also difficult to guarantee that a RenderWidgetHostViewBase-derivative will be always able to properly remove itself from any RenderWidgetHost- InputEventRouter it may be registered with. This may lead to the latter having an owner_map_ with stale pointers in it, leading to crashes. This CL converts the owner_map_ to store WeakPtrs to RenderWidgetHost- ViewBase, which can be tested before use. It's worth noting that RenderWidgetHostViewBase already provides support for WeakPtrs. BUG=570646 Committed: https://crrev.com/5712088e9b663455cf67b60825ee36cdbdd024dc Cr-Commit-Position: refs/heads/master@{#366652}

Patch Set 1 #

Total comments: 9

Patch Set 2 : Address suggestions. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -9 lines) Patch
M content/browser/renderer_host/render_widget_host_input_event_router.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_input_event_router.cc View 1 5 chunks +14 lines, -7 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 19 (9 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1545683002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1545683002/1
5 years ago (2015-12-22 15:29:39 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-22 16:30:02 UTC) #6
wjmaclean
PTAL This replaces https://codereview.chromium.org/1541913002/
5 years ago (2015-12-22 17:43:05 UTC) #7
Fady Samuel
Seems reasonable. lgtm. Alternatively a RenderWidgetHostViewObserver could be implemented and have the InputEventRouter observe all ...
5 years ago (2015-12-22 18:06:43 UTC) #9
nasko
Some simple comments. https://codereview.chromium.org/1545683002/diff/1/content/browser/renderer_host/render_widget_host_input_event_router.cc File content/browser/renderer_host/render_widget_host_input_event_router.cc (right): https://codereview.chromium.org/1545683002/diff/1/content/browser/renderer_host/render_widget_host_input_event_router.cc#newcode20 content/browser/renderer_host/render_widget_host_input_event_router.cc:20: RenderWidgetHostInputEventRouter::WeakTarget Why does this method need ...
5 years ago (2015-12-22 18:16:33 UTC) #10
wjmaclean
The observer idea is a good one, though this is a speculative fix to make ...
5 years ago (2015-12-22 18:39:55 UTC) #11
nasko
LGTM
5 years ago (2015-12-22 20:04:53 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1545683002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1545683002/20001
5 years ago (2015-12-22 20:17:29 UTC) #15
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years ago (2015-12-22 21:18:29 UTC) #17
commit-bot: I haz the power
5 years ago (2015-12-22 21:19:28 UTC) #19
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/5712088e9b663455cf67b60825ee36cdbdd024dc
Cr-Commit-Position: refs/heads/master@{#366652}

Powered by Google App Engine
This is Rietveld 408576698