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

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: more review feedback Created 6 years, 3 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 ab44fb47f9da05b2adc5d72db4b331492d0164bf..fb7c054dde86904184994329262191eb473b722d 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();
+#endif
callbackData->handle.set(isolate, wrapper);
callbackData->handle.setWeak(callbackData, &InjectedScriptManager::setWeakCallback);
#if ENABLE(OILPAN)
- V8DOMWrapper::setNativeInfoWithPersistentHandle(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host.get()), &callbackData->host);
+ V8DOMWrapper::setNativeInfoWithPersistentHandle(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host.get()), callbackData->hostPtr);
#else
V8DOMWrapper::setNativeInfo(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, V8InjectedScriptHost::toInternalPointer(host.get()));
#endif

Powered by Google App Engine
This is Rietveld 408576698