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

Unified Diff: Source/bindings/v8/V8WindowShell.cpp

Issue 211373002: Oilpan: move DOMWindow object to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: setNativeInfoForInnerGlobalObject() -> setNativeInfoForHiddenWrapper() Created 6 years, 9 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
« no previous file with comments | « Source/bindings/v8/V8DOMWrapper.h ('k') | Source/bindings/v8/WrapperTypeInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8WindowShell.cpp
diff --git a/Source/bindings/v8/V8WindowShell.cpp b/Source/bindings/v8/V8WindowShell.cpp
index f5013a38d5aaebc4a30d2bb42f2323716c532727..ea9e34902d35b45f9ef3c6e0963555a12d59abe2 100644
--- a/Source/bindings/v8/V8WindowShell.cpp
+++ b/Source/bindings/v8/V8WindowShell.cpp
@@ -52,6 +52,7 @@
#include "core/loader/FrameLoaderClient.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
+#include "heap/Handle.h"
#include "platform/TraceEvent.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
@@ -303,7 +304,7 @@ bool V8WindowShell::installDOMWindow()
V8Window::installPerContextEnabledProperties(windowWrapper, window, m_isolate);
- V8DOMWrapper::setNativeInfo(v8::Handle<v8::Object>::Cast(windowWrapper->GetPrototype()), &V8Window::wrapperTypeInfo, window);
+ V8DOMWrapper::setNativeInfoForHiddenWrapper(v8::Handle<v8::Object>::Cast(windowWrapper->GetPrototype()), &V8Window::wrapperTypeInfo, window);
// Install the windowWrapper as the prototype of the innerGlobalObject.
// The full structure of the global object is as follows:
@@ -318,10 +319,17 @@ bool V8WindowShell::installDOMWindow()
// outer, inner, and DOMWindow instance all appear to be the same
// JavaScript object.
//
+ // Note: With Oilpan, the DOMWindow object is garbage collected.
+ // Persistent references to this inner global object view of the DOMWindow
+ // aren't kept, as that would prevent the global object from ever being released.
+ // It is safe not to do so, as the wrapper for the DOMWindow being installed here
+ // already keeps a persistent reference, and it along with the inner global object
+ // views of the DOMWindow will die together once that wrapper clears the persistent
+ // reference.
v8::Handle<v8::Object> innerGlobalObject = toInnerGlobalObject(m_perContextData->context());
- V8DOMWrapper::setNativeInfo(innerGlobalObject, &V8Window::wrapperTypeInfo, window);
+ V8DOMWrapper::setNativeInfoForHiddenWrapper(innerGlobalObject, &V8Window::wrapperTypeInfo, window);
innerGlobalObject->SetPrototype(windowWrapper);
- V8DOMWrapper::associateObjectWithWrapper<V8Window>(PassRefPtr<DOMWindow>(window), &V8Window::wrapperTypeInfo, windowWrapper, m_isolate, WrapperConfiguration::Dependent);
+ V8DOMWrapper::associateObjectWithWrapper<V8Window>(PassRefPtrWillBeRawPtr<DOMWindow>(window), &V8Window::wrapperTypeInfo, windowWrapper, m_isolate, WrapperConfiguration::Dependent);
return true;
}
« no previous file with comments | « Source/bindings/v8/V8DOMWrapper.h ('k') | Source/bindings/v8/WrapperTypeInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698