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

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

Issue 1040703002: Oilpan: avoid InjectedScriptManager::CallbackData-induced leaks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add explicit dispose() Created 5 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 | « no previous file | Source/core/inspector/InjectedScriptManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 de005ed40850946fc9e65b1f77cc63d04b2309a0..be34a8baa9402ebd2691c3787903aa79108da012 100644
--- a/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
+++ b/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
@@ -49,9 +49,8 @@ namespace blink {
InjectedScriptManager::CallbackData* InjectedScriptManager::createCallbackData(InjectedScriptManager* injectedScriptManager)
{
- OwnPtr<InjectedScriptManager::CallbackData> callbackData = adoptPtr(new InjectedScriptManager::CallbackData());
+ OwnPtrWillBeRawPtr<InjectedScriptManager::CallbackData> callbackData = InjectedScriptManager::CallbackData::create(injectedScriptManager);
InjectedScriptManager::CallbackData* callbackDataPtr = callbackData.get();
- callbackData->injectedScriptManager = injectedScriptManager;
m_callbackDataSet.add(callbackData.release());
return callbackDataPtr;
}
@@ -59,6 +58,7 @@ InjectedScriptManager::CallbackData* InjectedScriptManager::createCallbackData(I
void InjectedScriptManager::removeCallbackData(InjectedScriptManager::CallbackData* callbackData)
{
ASSERT(m_callbackDataSet.contains(callbackData));
+ callbackData->dispose();
m_callbackDataSet.remove(callbackData);
}
« no previous file with comments | « no previous file | Source/core/inspector/InjectedScriptManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698