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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 2429343004: [CachedAccessor] for window.document. (Closed)
Patch Set: Fix expectation for global-interface-listing-expected, windows. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
index 95d854acb014c046a7b0b2df61216782a88a3a85..985efe81c4eb4a64f5f6aaf7d7e1b181de059c9b 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -43,6 +43,7 @@
#include "bindings/core/v8/V8Initializer.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/core/v8/V8PagePopupControllerBinding.h"
+#include "bindings/core/v8/V8PrivateProperty.h"
#include "bindings/core/v8/V8Window.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
@@ -423,12 +424,10 @@ void WindowProxy::updateDocumentProperty() {
checkDocumentWrapper(m_document.newLocal(m_isolate), frame->document());
ASSERT(documentWrapper->IsObject());
- // TODO(jochen): Don't replace the accessor with a data value. We need a way
- // to tell v8 that the accessor's return value won't change after this point.
- if (!v8CallBoolean(context->Global()->ForceSet(
- context, v8AtomicString(m_isolate, "document"), documentWrapper,
- static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete))))
- return;
+
+ // Update cached accessor.
+ CHECK(V8PrivateProperty::getWindowDocumentCachedAccessor(m_isolate).set(
+ context, context->Global(), documentWrapper));
}
void WindowProxy::updateActivityLogger() {

Powered by Google App Engine
This is Rietveld 408576698