New issue
Advanced search Search tips

Issue 694179 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 527190



Sign in to add a comment

Clean up toV8Context, toDOMWindow(v8::Local<v8::Context>), toFrameIfNotDetached(v8::Local<v8::Context>)

Project Member Reported by dcheng@chromium.org, Feb 20 2017

Issue description

These (and possibly other binding conversion helpers) should only accept LocalFrame/LocalDOMWindow / return LocalFrame/LocalDOMWindow, as only a local frame will be able to have a full v8 context. The current design leads to nearly all of the callers of toDOMWindow() downcasting to LocalDOMWindow, which is discouraged. Instead, toDOMWindow() should just return a LocalDOMWindow directly.

The original reason for using Frame/DOMWindow is because of a hack for remote frames, where we need to expose the global object. Once https://codereview.chromium.org/2626183003/ lands, it should no longer be necessary to use this hack.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/53b1dc5e2d6c84871013249b7e037375bb26ec70

commit 53b1dc5e2d6c84871013249b7e037375bb26ec70
Author: dcheng <dcheng@chromium.org>
Date: Mon Mar 13 23:16:56 2017

Make V8Binding helpers return LocalFrame/LocalDOMWindow as appropriate

BUG= 694179 

Review-Url: https://codereview.chromium.org/2723973002
Cr-Commit-Position: refs/heads/master@{#456532}

[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8DOMActivityLogger.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8EventListenerHelper.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/custom/V8CustomXPathNSResolver.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/core/v8/custom/V8PerformanceObserverCustom.cpp
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
[modify] https://crrev.com/53b1dc5e2d6c84871013249b7e037375bb26ec70/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Comment 2 by dcheng@chromium.org, Mar 27 2017

Status: Fixed (was: Assigned)

Sign in to add a comment