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

Issue 2385333002: RenderWidgetHostViewChildFrame's called a virtual in its ctor. (Closed)

Created:
4 years, 2 months ago by dtapuska
Modified:
4 years, 2 months ago
Reviewers:
kenrb, clamy
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

RenderWidgetHostViewChildFrame's called a virtual in its ctor. It appears that calling SetView in the ctor can lead to a path where SetNeedsBeginFrame is invoked on the newly constructed object. Since RenderWidgetHostViewGuest is a subclass of RenderWidgetHostViewChildFrame its virtual function would not get invoked since the vtable had not be constructed yet. Change SetView to be called after the class is fully instantiated. Also fix RenderWidgetHostViewAura since calling this correctly now leads to an assert that the observer is only added once. So track whether the observer has been added so that when the begin frame source is added an assertion doesn't occur. BUG=652212 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/5bf106420af2df80286f4f404c44dbf818469db1 Cr-Commit-Position: refs/heads/master@{#423182}

Patch Set 1 #

Patch Set 2 : Fix some failures in the tests #

Total comments: 11

Patch Set 3 : Fix comments from clamy@ #

Patch Set 4 : Move other functions that invoke methods passing "this" into functions inside the Init method #

Total comments: 2

Patch Set 5 : Move guest ctor to private #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -23 lines) Patch
M content/browser/frame_host/render_frame_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.h View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.cc View 1 2 3 3 chunks +15 lines, -4 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.h View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura.cc View 1 3 chunks +16 lines, -5 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_aura_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac_unittest.mm View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_view_child_frame.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/web_contents/web_contents_view_guest.cc View 1 2 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 39 (22 generated)
dtapuska
clamy@ PTAL; if you have an alternate pattern to follow I'd be happy to adjust ...
4 years, 2 months ago (2016-10-03 20:25:00 UTC) #5
clamy
@dtapuska: sorry I did not have time to review this today. I will review it ...
4 years, 2 months ago (2016-10-04 16:12:21 UTC) #8
dtapuska
On 2016/10/04 16:12:21, clamy wrote: > @dtapuska: sorry I did not have time to review ...
4 years, 2 months ago (2016-10-04 16:13:57 UTC) #9
clamy
Thanks! A few comments below. https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc File content/browser/frame_host/render_widget_host_view_child_frame.cc (right): https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc#newcode42 content/browser/frame_host/render_widget_host_view_child_frame.cc:42: RenderWidgetHostViewChildFrame* RenderWidgetHostViewChildFrame::Create( Please add ...
4 years, 2 months ago (2016-10-05 12:35:54 UTC) #14
clamy
Thanks! A few comments below.
4 years, 2 months ago (2016-10-05 12:35:54 UTC) #15
dtapuska
https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h File content/browser/renderer_host/render_widget_host_view_aura.h (right): https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h#newcode535 content/browser/renderer_host/render_widget_host_view_aura.h:535: void UpdateNeedsBeginFramesInternal(); On 2016/10/05 12:35:53, clamy wrote: > How ...
4 years, 2 months ago (2016-10-05 13:21:30 UTC) #16
clamy
https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h File content/browser/renderer_host/render_widget_host_view_aura.h (right): https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h#newcode535 content/browser/renderer_host/render_widget_host_view_aura.h:535: void UpdateNeedsBeginFramesInternal(); On 2016/10/05 13:21:29, dtapuska wrote: > On ...
4 years, 2 months ago (2016-10-05 13:47:02 UTC) #17
clamy
4 years, 2 months ago (2016-10-05 13:47:02 UTC) #18
dtapuska
On 2016/10/05 13:47:02, clamy wrote: > https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h > File content/browser/renderer_host/render_widget_host_view_aura.h (right): > > https://codereview.chromium.org/2385333002/diff/20001/content/browser/renderer_host/render_widget_host_view_aura.h#newcode535 > ...
4 years, 2 months ago (2016-10-05 13:50:23 UTC) #19
kenrb
https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc File content/browser/frame_host/render_widget_host_view_child_frame.cc (right): https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc#newcode65 content/browser/frame_host/render_widget_host_view_child_frame.cc:65: GetTextInputManager(); Would it make sense to move these other ...
4 years, 2 months ago (2016-10-05 14:10:40 UTC) #20
dtapuska
https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc File content/browser/frame_host/render_widget_host_view_child_frame.cc (right): https://codereview.chromium.org/2385333002/diff/20001/content/browser/frame_host/render_widget_host_view_child_frame.cc#newcode42 content/browser/frame_host/render_widget_host_view_child_frame.cc:42: RenderWidgetHostViewChildFrame* RenderWidgetHostViewChildFrame::Create( On 2016/10/05 12:35:53, clamy wrote: > Please ...
4 years, 2 months ago (2016-10-05 14:25:00 UTC) #27
kenrb
lgtm
4 years, 2 months ago (2016-10-05 14:34:00 UTC) #28
clamy
Thanks! Lgtm with one comment. https://codereview.chromium.org/2385333002/diff/60001/content/browser/frame_host/render_widget_host_view_guest.h File content/browser/frame_host/render_widget_host_view_guest.h (right): https://codereview.chromium.org/2385333002/diff/60001/content/browser/frame_host/render_widget_host_view_guest.h#newcode134 content/browser/frame_host/render_widget_host_view_guest.h:134: RenderWidgetHostViewGuest( It seems that ...
4 years, 2 months ago (2016-10-05 15:29:49 UTC) #31
dtapuska
https://codereview.chromium.org/2385333002/diff/60001/content/browser/frame_host/render_widget_host_view_guest.h File content/browser/frame_host/render_widget_host_view_guest.h (right): https://codereview.chromium.org/2385333002/diff/60001/content/browser/frame_host/render_widget_host_view_guest.h#newcode134 content/browser/frame_host/render_widget_host_view_guest.h:134: RenderWidgetHostViewGuest( On 2016/10/05 15:29:49, clamy wrote: > It seems ...
4 years, 2 months ago (2016-10-05 15:37:05 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2385333002/80001
4 years, 2 months ago (2016-10-05 15:37:39 UTC) #35
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 2 months ago (2016-10-05 16:31:10 UTC) #37
commit-bot: I haz the power
4 years, 2 months ago (2016-10-05 16:33:03 UTC) #39
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/5bf106420af2df80286f4f404c44dbf818469db1
Cr-Commit-Position: refs/heads/master@{#423182}

Powered by Google App Engine
This is Rietveld 408576698