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

Side by Side Diff: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.h

Issue 2273483003: [WONT COMMIT] WebSocket: Signal when worker thread lifecycle context is destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
43 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
44 #include "wtf/text/WTFString.h" 44 #include "wtf/text/WTFString.h"
45 #include <memory> 45 #include <memory>
46 #include <stdint.h> 46 #include <stdint.h>
47 47
48 namespace blink { 48 namespace blink {
49 49
50 class BlobDataHandle; 50 class BlobDataHandle;
51 class KURL; 51 class KURL;
52 class DocumentWebSocketChannel;
52 class ExecutionContext; 53 class ExecutionContext;
53 class ExecutionContextTask; 54 class ExecutionContextTask;
54 class WebSocketChannelSyncHelper; 55 class WebSocketChannelSyncHelper;
55 class WorkerGlobalScope; 56 class WorkerGlobalScope;
56 class WorkerLoaderProxy; 57 class WorkerLoaderProxy;
57 58
58 class WorkerWebSocketChannel final : public WebSocketChannel { 59 class WorkerWebSocketChannel final : public WebSocketChannel {
59 WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel); 60 WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel);
60 public: 61 public:
61 static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSoc ketChannelClient* client, std::unique_ptr<SourceLocation> location) 62 static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, WebSoc ketChannelClient* client, std::unique_ptr<SourceLocation> location)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void didStartClosingHandshake() override; 116 void didStartClosingHandshake() override;
116 void didClose(ClosingHandshakeCompletionStatus, unsigned short code, con st String& reason) override; 117 void didClose(ClosingHandshakeCompletionStatus, unsigned short code, con st String& reason) override;
117 void didError() override; 118 void didError() override;
118 119
119 // WorkerThreadLifecycleObserver function. 120 // WorkerThreadLifecycleObserver function.
120 void contextDestroyed() override; 121 void contextDestroyed() override;
121 122
122 private: 123 private:
123 CrossThreadWeakPersistent<Bridge> m_bridge; 124 CrossThreadWeakPersistent<Bridge> m_bridge;
124 RefPtr<WorkerLoaderProxy> m_loaderProxy; 125 RefPtr<WorkerLoaderProxy> m_loaderProxy;
125 Member<WebSocketChannel> m_mainWebSocketChannel; 126 Member<DocumentWebSocketChannel> m_mainWebSocketChannel;
yhirano 2016/08/23 04:51:48 Just out of curiosity, is this change needed?
nhiroki 2016/08/23 04:56:45 Not needed. This is just for improving readability
126 Member<WebSocketChannelSyncHelper> m_syncHelper; 127 Member<WebSocketChannelSyncHelper> m_syncHelper;
127 }; 128 };
128 129
129 // Bridge for Peer. Running on the worker thread. 130 // Bridge for Peer. Running on the worker thread.
130 class Bridge final : public GarbageCollectedFinalized<Bridge> { 131 class Bridge final : public GarbageCollectedFinalized<Bridge> {
131 WTF_MAKE_NONCOPYABLE(Bridge); 132 WTF_MAKE_NONCOPYABLE(Bridge);
132 public: 133 public:
133 Bridge(WebSocketChannelClient*, WorkerGlobalScope&); 134 Bridge(WebSocketChannelClient*, WorkerGlobalScope&);
134 ~Bridge(); 135 ~Bridge();
135 // SourceLocation parameter may be shown when the connection fails. 136 // SourceLocation parameter may be shown when the connection fails.
(...skipping 29 matching lines...) Expand all
165 private: 166 private:
166 WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, std::uni que_ptr<SourceLocation>); 167 WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, std::uni que_ptr<SourceLocation>);
167 168
168 Member<Bridge> m_bridge; 169 Member<Bridge> m_bridge;
169 std::unique_ptr<SourceLocation> m_locationAtConnection; 170 std::unique_ptr<SourceLocation> m_locationAtConnection;
170 }; 171 };
171 172
172 } // namespace blink 173 } // namespace blink
173 174
174 #endif // WorkerWebSocketChannel_h 175 #endif // WorkerWebSocketChannel_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698