Changeset 91919 in webkit
- Timestamp:
- Jul 28, 2011 5:21:04 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91915 r91919 1 2011-07-28 Yuta Kitamura <yutak@chromium.org> 2 3 WebSocket: Pass the value of useHixie76Protocol flag to WebSocket object 4 https://bugs.webkit.org/show_bug.cgi?id=65250 5 6 Reviewed by Alexey Proskuryakov. 7 8 Add useHixie76Protocol() method to WebSocketChannel and its family. To implement hybi-specific 9 attributes in WebSocket object, WebSocket class needs to be able to get the value of 10 useHixie76Protocol flag of WebSocketChannel. 11 12 If the WebSocket object is created in a worker thread, the flag value must be obtained from 13 WebSocketChannel which resides in the loader thread (through WorkerThreadableWebSocketChannel). 14 Since the value does not change after creation of WebSocketChannel, it can be cached in 15 the worker thread. 16 17 There is no change in behavior, thus no new tests. 18 19 * websockets/ThreadableWebSocketChannel.h: 20 * websockets/ThreadableWebSocketChannelClientWrapper.cpp: 21 (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper): 22 (WebCore::ThreadableWebSocketChannelClientWrapper::useHixie76Protocol): 23 (WebCore::ThreadableWebSocketChannelClientWrapper::setUseHixie76Protocol): 24 * websockets/ThreadableWebSocketChannelClientWrapper.h: 25 * websockets/WebSocketChannel.cpp: 26 (WebCore::WebSocketChannel::useHixie76Protocol): 27 * websockets/WebSocketChannel.h: 28 * websockets/WorkerThreadableWebSocketChannel.cpp: 29 (WebCore::WorkerThreadableWebSocketChannel::useHixie76Protocol): 30 (WebCore::WorkerThreadableWebSocketChannel::Peer::useHixie76Protocol): 31 (WebCore::WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel): 32 (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadCreateWebSocketChannel): 33 * websockets/WorkerThreadableWebSocketChannel.h: 34 1 35 2011-07-28 Rob Buis <rbuis@rim.com> 2 36 -
trunk/Source/WebCore/websockets/ThreadableWebSocketChannel.h
r87139 r91919 50 50 static PassRefPtr<ThreadableWebSocketChannel> create(ScriptExecutionContext*, WebSocketChannelClient*, const KURL&, const String& protocol); 51 51 52 virtual bool useHixie76Protocol() = 0; 52 53 virtual void connect() = 0; 53 54 virtual bool send(const String& message) = 0; -
trunk/Source/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.cpp
r89707 r91919 44 44 : m_client(client) 45 45 , m_syncMethodDone(false) 46 , m_useHixie76Protocol(true) 46 47 , m_sent(false) 47 48 , m_bufferedAmount(0) … … 68 69 { 69 70 return m_syncMethodDone; 71 } 72 73 bool ThreadableWebSocketChannelClientWrapper::useHixie76Protocol() const 74 { 75 return m_useHixie76Protocol; 76 } 77 78 void ThreadableWebSocketChannelClientWrapper::setUseHixie76Protocol(bool useHixie76Protocol) 79 { 80 m_useHixie76Protocol = useHixie76Protocol; 70 81 } 71 82 -
trunk/Source/WebCore/websockets/ThreadableWebSocketChannelClientWrapper.h
r89707 r91919 54 54 bool syncMethodDone() const; 55 55 56 // The value of useHixie76Protocol flag is cachable; this value is saved after WebSocketChannel (on the main 57 // thread) is constructed. 58 bool useHixie76Protocol() const; 59 void setUseHixie76Protocol(bool); 60 56 61 bool sent() const; 57 62 void setSent(bool); … … 81 86 WebSocketChannelClient* m_client; 82 87 bool m_syncMethodDone; 88 bool m_useHixie76Protocol; 83 89 bool m_sent; 84 90 unsigned long m_bufferedAmount; -
trunk/Source/WebCore/websockets/WebSocketChannel.cpp
r91243 r91919 117 117 } 118 118 119 bool WebSocketChannel::useHixie76Protocol() 120 { 121 return m_useHixie76Protocol; 122 } 123 119 124 void WebSocketChannel::connect() 120 125 { -
trunk/Source/WebCore/websockets/WebSocketChannel.h
r91243 r91919 55 55 virtual ~WebSocketChannel(); 56 56 57 virtual bool useHixie76Protocol(); 57 58 virtual void connect(); 58 59 virtual bool send(const String& message); -
trunk/Source/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
r89613 r91919 63 63 } 64 64 65 bool WorkerThreadableWebSocketChannel::useHixie76Protocol() 66 { 67 ASSERT(m_workerClientWrapper); 68 return m_workerClientWrapper->useHixie76Protocol(); 69 } 70 65 71 void WorkerThreadableWebSocketChannel::connect() 66 72 { … … 131 137 } 132 138 139 bool WorkerThreadableWebSocketChannel::Peer::useHixie76Protocol() 140 { 141 ASSERT(isMainThread()); 142 ASSERT(m_mainWebSocketChannel); 143 return m_mainWebSocketChannel->useHixie76Protocol(); 144 } 145 133 146 void WorkerThreadableWebSocketChannel::Peer::connect() 134 147 { … … 259 272 } 260 273 261 void WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, Peer* peer, PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper )274 void WorkerThreadableWebSocketChannel::Bridge::setWebSocketChannel(ScriptExecutionContext* context, Bridge* thisPtr, Peer* peer, PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, bool useHixie76Protocol) 262 275 { 263 276 ASSERT_UNUSED(context, context->isWorkerContext()); 264 277 thisPtr->m_peer = peer; 278 workerClientWrapper->setUseHixie76Protocol(useHixie76Protocol); 265 279 workerClientWrapper->setSyncMethodDone(); 266 280 } … … 277 291 createCallbackTask(&Bridge::setWebSocketChannel, 278 292 AllowCrossThreadAccess(thisPtr), 279 AllowCrossThreadAccess(peer), clientWrapper ), taskMode);293 AllowCrossThreadAccess(peer), clientWrapper, peer->useHixie76Protocol()), taskMode); 280 294 } 281 295 -
trunk/Source/WebCore/websockets/WorkerThreadableWebSocketChannel.h
r89613 r91919 61 61 virtual ~WorkerThreadableWebSocketChannel(); 62 62 63 virtual bool useHixie76Protocol(); 63 64 virtual void connect(); 64 65 virtual bool send(const String& message); … … 89 90 ~Peer(); 90 91 92 bool useHixie76Protocol(); 91 93 void connect(); 92 94 void send(const String& message); … … 135 137 Bridge(PassRefPtr<ThreadableWebSocketChannelClientWrapper>, PassRefPtr<WorkerContext>, const String& taskMode, const KURL&, const String& protocol); 136 138 137 static void setWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, Peer*, PassRefPtr<ThreadableWebSocketChannelClientWrapper> );139 static void setWebSocketChannel(ScriptExecutionContext*, Bridge* thisPtr, Peer*, PassRefPtr<ThreadableWebSocketChannelClientWrapper>, bool useHixie76Protocol); 138 140 139 141 // Executed on the main thread to create a Peer for this bridge.
Note: See TracChangeset
for help on using the changeset viewer.