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

Issue 2630693002: Make ScriptController inherit LocalWindowProxyManager

Created:
3 years, 11 months ago by dcheng
Modified:
3 years, 11 months ago
Reviewers:
haraken, Yuki
CC:
chromium-reviews, blink-reviews, blink-reviews-bindings_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ScriptController inherit LocalWindowProxyManager This CL moves closer to storing a WindowProxyManager on DOMWindow, so the bindings can map any DOMWindow*, even when detached, to its WindowProxy. Currently, WindowProxyManager exposes a problematic frame() getter. In the past, there have been security bugs when a navigated-away-from DOMWindow incorrectly used frame(), assuming it was still active. This can lead to potential UXSS attacks, so DOMWindow::frame() is now cleared on navigation. Exposing a Frame getter from WindowProxyManager could cause similar problems, so this proactive refactoring aims to fix that. Some additional benefits of this patch are the removal of friend declarations, removal of some forwarding-only logic, and simplifying the WindowProxyManager interface so that windowProxy() always returns an initialized WindowProxy. BUG=none

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Add comments #

Total comments: 13

Patch Set 4 : Address comments #

Patch Set 5 : Remove random newline #

Patch Set 6 : . #

Patch Set 7 : meh #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -197 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp View 1 2 3 4 5 2 chunks +2 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.h View 1 2 3 4 5 6 7 5 chunks +20 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp View 1 2 3 4 5 6 7 6 chunks +51 lines, -36 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ToV8.cpp View 1 2 3 4 5 1 chunk +2 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 5 6 2 chunks +6 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h View 1 2 3 4 5 6 3 chunks +37 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.cpp View 1 2 3 4 4 chunks +25 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/core/frame/DOMWindow.h View 1 2 3 4 5 6 chunks +9 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/frame/DOMWindow.cpp View 1 2 3 4 5 6 7 5 chunks +14 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Frame.h View 1 2 3 4 5 3 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 4 chunks +3 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/RemoteFrame.h View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/RemoteFrame.cpp View 1 2 3 4 5 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/Window.idl View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLDocument.cpp View 1 2 3 4 5 2 chunks +2 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 26 (20 generated)
dcheng
3 years, 11 months ago (2017-01-13 10:08:24 UTC) #8
Yuki
LGTM. https://codereview.chromium.org/2630693002/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp (right): https://codereview.chromium.org/2630693002/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp#newcode92 third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp:92: static_cast<LocalWindowProxy*>(mainWorldProxy()) Did you make WindowProxyManagerImplHelper::mainWorldProxy() return a ProxyType, ...
3 years, 11 months ago (2017-01-13 10:42:00 UTC) #10
haraken
> This CL moves closer to storing a WindowProxyManager on DOMWindow What are you planning ...
3 years, 11 months ago (2017-01-13 11:35:35 UTC) #13
dcheng
On 2017/01/13 11:35:35, haraken wrote: > > This CL moves closer to storing a WindowProxyManager ...
3 years, 11 months ago (2017-01-13 18:34:05 UTC) #14
dcheng
https://codereview.chromium.org/2630693002/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp File third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp (right): https://codereview.chromium.org/2630693002/diff/40001/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp#newcode92 third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp:92: static_cast<LocalWindowProxy*>(mainWorldProxy()) On 2017/01/13 10:41:59, Yuki wrote: > Did you ...
3 years, 11 months ago (2017-01-13 18:57:31 UTC) #16
dcheng
3 years, 11 months ago (2017-01-13 22:41:29 UTC) #22
Actually, looking over things again, I think there's a couple problematic things
about this CL. It was confusing that windowProxy() would sometimes initialize
before and sometimes not, but it is not right to always initialize either.

I am going to restructure this code a little bit to make it easier to understand
/ more predictable and hide more details of WindowProxy initialization.

Powered by Google App Engine
This is Rietveld 408576698