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; |