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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.h

Issue 1472823002: Couple V8AbstractEventListener's lifetime to the V8 listeners lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 1 month 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: third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
index 51da5e3e2bdaee531e70ec17ecdfa6c5be6f74a8..0a0c4cb4f0b8d8295f4e366fce19229b0d15b65a 100644
--- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
+++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.h
@@ -43,6 +43,7 @@
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "wtf/Assertions.h"
#include "wtf/HashMap.h"
+#include "wtf/ListHashSet.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -54,6 +55,7 @@ namespace blink {
class ConsoleMessage;
class ConsoleMessageStorage;
class ExceptionState;
+class V8AbstractEventListener;
class WorkerClients;
class WorkerConsole;
class WorkerInspectorController;
@@ -141,6 +143,9 @@ public:
bool isSecureContext(String& errorMessage, const SecureContextCheck = StandardSecureContextCheck) const override;
+ void registerEventListener(V8AbstractEventListener*);
+ void deregisterEventListener(V8AbstractEventListener*);
+
DECLARE_VIRTUAL_TRACE();
protected:
@@ -200,6 +205,7 @@ private:
unsigned long m_workerExceptionUniqueIdentifier;
WillBeHeapHashMap<unsigned long, RefPtrWillBeMember<ConsoleMessage>> m_pendingMessages;
+ WillBeHeapListHashSet<RefPtrWillBeMember<V8AbstractEventListener>> m_eventListeners;
};
DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorkerGlobalScope(), context.isWorkerGlobalScope());

Powered by Google App Engine
This is Rietveld 408576698