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

Issue 132913002: Harden the machinery around updateWidgetPositions() (Closed)

Created:
6 years, 11 months ago by esprehn
Modified:
6 years, 11 months ago
CC:
blink-reviews, bemjb+rendering_chromium.org, zoltan1, eae+blinkwatch, leviw+renderwatch, blink-layers+watch_chromium.org, jchaffraix+rendering, wjmaclean, Chris Evans
Visibility:
Public.

Description

Harden the machinery around updateWidgetPositions() updateWidgetPositions() can blow away the RenderView by running script or calling into plugins. This patch moves it from RenderView to FrameView since having this method on RenderView which might destroy itself is not safe. It also switches to using normal RefPtr instead of manually managing the refcount and finally adds RefPtr to callers of updateWidgetPositions() to avoid use-after-frees. There's one final call inside RenderLayerScrollableArea::setScrollOffset which is not safe but is difficult to mitigate since we're way down a callstack by the time this call is made which can destroy the render tree and the RenderLayerScrollableArea. This patch adds a RELEASE_ASSERT to kill the renderer in case we get into a sitaution where this happens. In the future we should detangle this concept entirely so such an ASSERT isn't needed and so that the render tree can never destroy itself from the inside. It's not clear how to write a test for this since you need to get us to go into the scrolling code with a dirty tree or have a plugin that does something nefarious. BUG=322891 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165052

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add FIXME #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -103 lines) Patch
M Source/core/frame/FrameView.h View 1 3 chunks +8 lines, -0 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 1 5 chunks +35 lines, -8 lines 0 comments Download
M Source/core/rendering/RenderLayerScrollableArea.cpp View 1 2 chunks +18 lines, -22 lines 0 comments Download
M Source/core/rendering/RenderView.h View 1 4 chunks +0 lines, -11 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 chunks +0 lines, -52 lines 0 comments Download
M Source/core/rendering/RenderWidget.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/rendering/RenderWidget.cpp View 4 chunks +5 lines, -7 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
esprehn
6 years, 11 months ago (2014-01-10 00:23:09 UTC) #1
eseidel
6 years, 11 months ago (2014-01-10 00:44:43 UTC) #2
esprehn
ping
6 years, 11 months ago (2014-01-10 23:39:10 UTC) #3
eseidel
https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.cpp#newcode1263 Source/core/frame/FrameView.cpp:1263: void FrameView::addWidget(RenderWidget* object) So these are effectively children, since ...
6 years, 11 months ago (2014-01-10 23:54:30 UTC) #4
eseidel
https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.h File Source/core/frame/FrameView.h (right): https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.h#newcode466 Source/core/frame/FrameView.h:466: HashSet<RefPtr<RenderWidget> > m_widgets; So this didn't used to be ...
6 years, 11 months ago (2014-01-10 23:56:35 UTC) #5
esprehn
https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/132913002/diff/1/Source/core/frame/FrameView.cpp#newcode1263 Source/core/frame/FrameView.cpp:1263: void FrameView::addWidget(RenderWidget* object) On 2014/01/10 23:54:30, eseidel wrote: > ...
6 years, 11 months ago (2014-01-12 20:18:58 UTC) #6
eseidel
OK. Please add a FIXME About making these Widget* instead. lgtm.
6 years, 11 months ago (2014-01-12 20:24:58 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/132913002/170001
6 years, 11 months ago (2014-01-14 09:16:57 UTC) #8
commit-bot: I haz the power
6 years, 11 months ago (2014-01-14 10:19:02 UTC) #9
Message was sent while issue was closed.
Change committed as 165052

Powered by Google App Engine
This is Rietveld 408576698