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

Unified Diff: Source/core/inspector/InjectedScriptManager.h

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
Index: Source/core/inspector/InjectedScriptManager.h
diff --git a/Source/core/inspector/InjectedScriptManager.h b/Source/core/inspector/InjectedScriptManager.h
index 2a27e2107831242bc0d2e0ef89b30836221c08e4..c591be8e6556965c576c40ab409e93bc9219f940 100644
--- a/Source/core/inspector/InjectedScriptManager.h
+++ b/Source/core/inspector/InjectedScriptManager.h
@@ -47,10 +47,17 @@ class InjectedScriptManager : public NoBaseWillBeGarbageCollectedFinalized<Injec
WTF_MAKE_NONCOPYABLE(InjectedScriptManager);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InjectedScriptManager);
public:
- struct CallbackData {
+ class CallbackData final : public NoBaseWillBeGarbageCollectedFinalized<CallbackData> {
+ public:
+ static PassOwnPtrWillBeRawPtr<CallbackData> create(InjectedScriptManager*);
+ void dispose();
+ DECLARE_TRACE();
+
ScopedPersistent<v8::Object> handle;
- RefPtrWillBePersistent<InjectedScriptHost> host;
- InjectedScriptManager* injectedScriptManager;
+ RefPtrWillBeMember<InjectedScriptHost> host;
+ RawPtrWillBeMember<InjectedScriptManager> injectedScriptManager;
+ private:
+ explicit CallbackData(InjectedScriptManager*);
};
static PassOwnPtrWillBeRawPtr<InjectedScriptManager> createForPage();
@@ -94,7 +101,7 @@ private:
InspectedStateAccessCheck m_inspectedStateAccessCheck;
typedef HashMap<RefPtr<ScriptState>, int> ScriptStateToId;
ScriptStateToId m_scriptStateToId;
- HashSet<OwnPtr<CallbackData> > m_callbackDataSet;
+ WillBeHeapHashSet<OwnPtrWillBeMember<CallbackData>> m_callbackDataSet;
bool m_customObjectFormatterEnabled;
};
« no previous file with comments | « Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp ('k') | Source/core/inspector/InjectedScriptManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698