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

Unified Diff: Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp

Issue 525353002: [oilpan]: optimize the way we allocate persistent handles in wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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: Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
index 1ce710b6e32ef5e672ee2681447f31c1152e3ebd..1d8bd9b63c290d78c9640a6c601e2f51b59955a0 100644
--- a/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
+++ b/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
@@ -72,12 +72,16 @@ static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeR
// Create a weak reference to the v8 wrapper of InspectorBackend to deref
// InspectorBackend when the wrapper is garbage collected.
InjectedScriptManager::CallbackData* callbackData = injectedScriptManager->createCallbackData(injectedScriptManager);
+#if ENABLE(OILPAN)
+ callbackData->hostPtr = new WrapperPersistent<InjectedScriptHost>(host.get());
+#else
callbackData->host = host.get();
zerny-chromium 2014/09/01 14:13:37 Is this field never used in the oilpan build?
wibling-chromium 2014/09/02 11:19:37 No, AFAICT it is only used to keep the object aliv
+#endif
callbackData->handle.set(isolate, wrapper);
callbackData->handle.setWeak(callbackData, &InjectedScriptManager::setWeakCallback);
#if ENABLE(OILPAN)
- V8DOMWrapper::setNativeInfoWithPersistentHandle(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host), &callbackData->host);
+ V8DOMWrapper::setNativeInfoWithPersistentHandle(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host), callbackData->hostPtr);
#else
V8DOMWrapper::setNativeInfo(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host.get()));
#endif

Powered by Google App Engine
This is Rietveld 408576698