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

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: silly compile fix 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..b5f4c3eb0e15be03cdcb38d1f25e579b1ab5566d 100644
--- a/Source/core/inspector/InjectedScriptManager.h
+++ b/Source/core/inspector/InjectedScriptManager.h
@@ -47,10 +47,16 @@ 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*);
+ 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 +100,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;
};

Powered by Google App Engine
This is Rietveld 408576698