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

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

Issue 2715803004: Introduce ThreadableLoadingContext: make threaded loading code one step away from Document (Closed)
Patch Set: . Created 3 years, 9 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
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 ExecutionContext; 52 class ThreadableLoadingContext;
53 class WebSocketChannelSyncHelper; 53 class WebSocketChannelSyncHelper;
54 class WorkerGlobalScope; 54 class WorkerGlobalScope;
55 class WorkerLoaderProxy; 55 class WorkerLoaderProxy;
56 56
57 class WorkerWebSocketChannel final : public WebSocketChannel { 57 class WorkerWebSocketChannel final : public WebSocketChannel {
58 WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel); 58 WTF_MAKE_NONCOPYABLE(WorkerWebSocketChannel);
59 59
60 public: 60 public:
61 static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope, 61 static WebSocketChannel* create(WorkerGlobalScope& workerGlobalScope,
62 WebSocketChannelClient* client, 62 WebSocketChannelClient* client,
(...skipping 30 matching lines...) Expand all
93 public WebSocketChannelClient, 93 public WebSocketChannelClient,
94 public WorkerThreadLifecycleObserver { 94 public WorkerThreadLifecycleObserver {
95 USING_GARBAGE_COLLECTED_MIXIN(Peer); 95 USING_GARBAGE_COLLECTED_MIXIN(Peer);
96 WTF_MAKE_NONCOPYABLE(Peer); 96 WTF_MAKE_NONCOPYABLE(Peer);
97 97
98 public: 98 public:
99 Peer(Bridge*, PassRefPtr<WorkerLoaderProxy>, WorkerThreadLifecycleContext*); 99 Peer(Bridge*, PassRefPtr<WorkerLoaderProxy>, WorkerThreadLifecycleContext*);
100 ~Peer() override; 100 ~Peer() override;
101 101
102 // SourceLocation parameter may be shown when the connection fails. 102 // SourceLocation parameter may be shown when the connection fails.
103 bool initialize(std::unique_ptr<SourceLocation>, ExecutionContext*); 103 bool initialize(std::unique_ptr<SourceLocation>, ThreadableLoadingContext*);
104 104
105 bool connect(const KURL&, const String& protocol); 105 bool connect(const KURL&, const String& protocol);
106 void sendTextAsCharVector(std::unique_ptr<Vector<char>>); 106 void sendTextAsCharVector(std::unique_ptr<Vector<char>>);
107 void sendBinaryAsCharVector(std::unique_ptr<Vector<char>>); 107 void sendBinaryAsCharVector(std::unique_ptr<Vector<char>>);
108 void sendBlob(PassRefPtr<BlobDataHandle>); 108 void sendBlob(PassRefPtr<BlobDataHandle>);
109 void close(int code, const String& reason); 109 void close(int code, const String& reason);
110 void fail(const String& reason, 110 void fail(const String& reason,
111 MessageLevel, 111 MessageLevel,
112 std::unique_ptr<SourceLocation>); 112 std::unique_ptr<SourceLocation>);
113 void disconnect(); 113 void disconnect();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 WebSocketChannelClient*, 185 WebSocketChannelClient*,
186 std::unique_ptr<SourceLocation>); 186 std::unique_ptr<SourceLocation>);
187 187
188 Member<Bridge> m_bridge; 188 Member<Bridge> m_bridge;
189 std::unique_ptr<SourceLocation> m_locationAtConnection; 189 std::unique_ptr<SourceLocation> m_locationAtConnection;
190 }; 190 };
191 191
192 } // namespace blink 192 } // namespace blink
193 193
194 #endif // WorkerWebSocketChannel_h 194 #endif // WorkerWebSocketChannel_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698