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

Unified Diff: Source/modules/websockets/WorkerThreadableWebSocketChannel.h

Issue 265713004: Cleanup WorkerThreadableWebSocketChannel's logic to wait for the main thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed #2 Created 6 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
« no previous file with comments | « no previous file | Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WorkerThreadableWebSocketChannel.h
diff --git a/Source/modules/websockets/WorkerThreadableWebSocketChannel.h b/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
index e22c3ace907d7e36f76ad676427cde700b023d92..053fe4d9bf4598075993777530419fd5bb0bc705 100644
--- a/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
+++ b/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
@@ -31,6 +31,7 @@
#ifndef WorkerThreadableWebSocketChannel_h
#define WorkerThreadableWebSocketChannel_h
+#include "core/dom/ExecutionContextTask.h"
#include "core/frame/ConsoleTypes.h"
#include "core/workers/WorkerGlobalScope.h"
#include "modules/websockets/WebSocketChannel.h"
@@ -84,8 +85,6 @@ public:
virtual void suspend() OVERRIDE;
virtual void resume() OVERRIDE;
- virtual void trace(Visitor*) OVERRIDE;
-
// Generated by the bridge. The Peer is destructed by an async call from
// Bridge, and may outlive the bridge. All methods of this class must
// be called on the main thread.
@@ -133,7 +132,7 @@ private:
// Bridge for Peer. Running on the worker thread.
class Bridge : public RefCounted<Bridge> {
public:
- static PassRefPtr<Bridge> create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, PassRefPtrWillBeRawPtr<WorkerGlobalScope> workerGlobalScope)
+ static PassRefPtr<Bridge> create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, WorkerGlobalScope& workerGlobalScope)
{
return adoptRef(new Bridge(workerClientWrapper, workerGlobalScope));
}
@@ -153,7 +152,7 @@ private:
void resume();
private:
- Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, PassRefPtrWillBeRawPtr<WorkerGlobalScope>);
+ Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, WorkerGlobalScope&);
static void setWebSocketChannel(ExecutionContext*, Bridge* thisPtr, Peer*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>);
@@ -161,10 +160,12 @@ private:
void clearClientWrapper();
// Returns false if shutdown event is received before method completion.
- bool waitForMethodCompletion();
+ bool waitForMethodCompletion(PassOwnPtr<ExecutionContextTask>);
void terminatePeer();
+ bool hasTerminatedPeer() { return !m_syncHelper; }
+
const RefPtr<ThreadableWebSocketChannelClientWrapper> m_workerClientWrapper;
RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope;
WorkerLoaderProxy& m_loaderProxy;
@@ -174,7 +175,6 @@ private:
WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, const String& sourceURL, unsigned lineNumber);
- RefPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope;
const RefPtr<ThreadableWebSocketChannelClientWrapper> m_workerClientWrapper;
RefPtr<Bridge> m_bridge;
String m_sourceURLAtConnection;
« no previous file with comments | « no previous file | Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698