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

Unified Diff: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h

Issue 2025783002: Worker: Introduce an observation mechanism for WorkerThread termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delayed_task
Patch Set: maybe fix tests Created 4 years, 7 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: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
diff --git a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
index 2e9cf96b263a16a41766da9a44797008aa58374b..4244dd8609d4ef04276913e847d0f12118f64b3b 100644
--- a/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h
@@ -32,6 +32,7 @@
#define WorkerWebSocketChannel_h
#include "bindings/core/v8/SourceLocation.h"
+#include "core/workers/WorkerThreadLifecycleObserver.h"
#include "modules/websockets/WebSocketChannel.h"
#include "modules/websockets/WebSocketChannelClient.h"
#include "platform/heap/Handle.h"
@@ -53,6 +54,7 @@ class ExecutionContextTask;
class WebSocketChannelSyncHelper;
class WorkerGlobalScope;
class WorkerLoaderProxy;
+class WorkerThread;
class WorkerWebSocketChannel final : public WebSocketChannel {
WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel);
@@ -84,11 +86,11 @@ public:
class Bridge;
// Allocated in the worker thread, but used in the main thread.
- class Peer final : public GarbageCollectedFinalized<Peer>, public WebSocketChannelClient {
+ class Peer final : public GarbageCollectedFinalized<Peer>, public WebSocketChannelClient, public WorkerThreadLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(Peer);
WTF_MAKE_NONCOPYABLE(Peer);
public:
- Peer(Bridge*, PassRefPtr<WorkerLoaderProxy>, WebSocketChannelSyncHelper*);
+ Peer(Bridge*, PassRefPtr<WorkerLoaderProxy>, WebSocketChannelSyncHelper*, WorkerThread*);
~Peer() override;
// SourceLocation parameter may be shown when the connection fails.
@@ -113,6 +115,9 @@ public:
void didClose(ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
void didError() override;
+ // WorkerThreadLifecycleObserver function.
+ void contextDestroyed() override;
+
private:
Member<Bridge> m_bridge;
RefPtr<WorkerLoaderProxy> m_loaderProxy;

Powered by Google App Engine
This is Rietveld 408576698