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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h

Issue 2617733004: binding: Changes the association among global-proxy/global/window-instance. (Closed)
Patch Set: Addressed review comments. Created 3 years, 10 months 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/WrapperTypeInfo.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
index ce9429af5f18e46aa00d47c8adf59acfb08be70a..a11882d8317d412a44148470a11604ce4e8bc4c5 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -135,11 +135,11 @@ struct WrapperTypeInfo {
return domTemplateFunction(isolate, world);
}
- void wrapperCreated() const {
+ static void wrapperCreated() {
ThreadState::current()->heap().heapStats().increaseWrapperCount(1);
}
- void wrapperDestroyed() const {
+ static void wrapperDestroyed() {
ThreadHeapStats& heapStats = ThreadState::current()->heap().heapStats();
heapStats.decreaseWrapperCount(1);
heapStats.increaseCollectedWrapperCount(1);
@@ -206,6 +206,8 @@ inline T* getInternalField(v8::Local<v8::Object> wrapper) {
wrapper->GetAlignedPointerFromInternalField(offset));
}
+// The return value can be null if |wrapper| is a global proxy object, which
+// points to nothing while a navigation.
inline ScriptWrappable* toScriptWrappable(
const v8::PersistentBase<v8::Object>& wrapper) {
return getInternalField<ScriptWrappable, v8DOMWrapperObjectIndex>(wrapper);
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp ('k') | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698