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

Issue 2542123002: binding: Removes Document::wrap that must be equivalent to Node::wrap. (2nd try) (Closed)

Created:
4 years ago by Yuki
Modified:
4 years ago
Reviewers:
haraken
CC:
chromium-reviews, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews-bindings_chromium.org, blink-reviews, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

binding: Removes Document::wrap that must be equivalent to Node::wrap. (2nd try) Removes unnecessary Document::wrap and associateWithWrapper. The special code in these functions were made in order to keep WindowProxy::m_document updated and consistent with toV8(document). But we no longer rely on the hack, and we can remove the dead code. WindowProxy::m_document is used to support named properties on the document, and only used in WindowProxy::namedItem{Added,Removed}. These functions are only called from ScriptController::namedItem {Added,Removed} and ScriptController already guarantees that the WindowProxy is initialized at once. So, there is no need for Document::wrap to call WindowProxy::updateDocumentProperty. Plus, this CL removes WindowProxy::m_document. Given that we knew it's the main world, we should be able to retrieve the wrapper object of the document in almost the same speed as before. The new code to retrieve the wrapper object should be almost equivalent to ScriptWrappable::mainWorldWrapper(isolate) and it's almost the same as m_document.newLocal(isolate) The first attempt was: http://crrev.com/2525313004 BUG= Committed: https://crrev.com/23d2ae42f228825c3edb45ca50c4cb5e2e1045c0 Cr-Commit-Position: refs/heads/master@{#436243}

Patch Set 1 : patch from issue 2525313004 at patchset 100001 (http://crrev.com/2525313004#ps100001) #

Total comments: 1

Patch Set 2 : Removed WindowProxy::m_document. #

Patch Set 3 : clang-formatted. #

Total comments: 6

Patch Set 4 : Removed WindowProxy::checkDocumentWrapper. #

Patch Set 5 : Fixed test failures. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -82 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp View 1 2 3 4 7 chunks +22 lines, -42 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.h View 1 chunk +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 chunk +0 lines, -32 lines 0 comments Download

Messages

Total messages: 31 (22 generated)
Yuki
haraken@, what do you think of this approach to remove WindowProxy::m_document? As I commented, the ...
4 years ago (2016-12-02 09:08:06 UTC) #8
haraken
LGTM https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode431 third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp:431: toV8(frame->document(), context->Global(), m_isolate); Can you add CHECK(m_world->domDataStore().get(document, m_isolate).IsEmpty()) ...
4 years ago (2016-12-02 09:53:06 UTC) #11
Yuki
https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode431 third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp:431: toV8(frame->document(), context->Global(), m_isolate); On 2016/12/02 09:53:05, haraken wrote: > ...
4 years ago (2016-12-02 09:55:56 UTC) #12
haraken
https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode431 third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp:431: toV8(frame->document(), context->Global(), m_isolate); On 2016/12/02 09:55:56, Yuki wrote: > ...
4 years ago (2016-12-02 10:17:48 UTC) #15
Yuki
https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode431 third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp:431: toV8(frame->document(), context->Global(), m_isolate); On 2016/12/02 10:17:48, haraken wrote: > ...
4 years ago (2016-12-02 10:39:50 UTC) #16
haraken
On 2016/12/02 10:39:50, Yuki wrote: > https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp > File third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp (right): > > https://codereview.chromium.org/2542123002/diff/40001/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp#newcode431 > ...
4 years ago (2016-12-02 10:54:25 UTC) #17
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/2542123002/80001
4 years ago (2016-12-05 06:19:13 UTC) #26
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years ago (2016-12-05 08:04:06 UTC) #29
commit-bot: I haz the power
4 years ago (2016-12-05 08:06:30 UTC) #31
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/23d2ae42f228825c3edb45ca50c4cb5e2e1045c0
Cr-Commit-Position: refs/heads/master@{#436243}

Powered by Google App Engine
This is Rietveld 408576698