| OLD | NEW |
| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 void send(const CString& message); | 153 void send(const CString& message); |
| 154 void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength); | 154 void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength); |
| 155 void send(PassRefPtr<BlobDataHandle>); | 155 void send(PassRefPtr<BlobDataHandle>); |
| 156 void close(int code, const String& reason); | 156 void close(int code, const String& reason); |
| 157 void fail(const String& reason, | 157 void fail(const String& reason, |
| 158 MessageLevel, | 158 MessageLevel, |
| 159 std::unique_ptr<SourceLocation>); | 159 std::unique_ptr<SourceLocation>); |
| 160 void disconnect(); | 160 void disconnect(); |
| 161 | 161 |
| 162 void connectOnMainThread(std::unique_ptr<SourceLocation>, | 162 void connectOnMainThread(std::unique_ptr<SourceLocation>, |
| 163 RefPtr<WorkerLoaderProxy>, |
| 163 WorkerThreadLifecycleContext*, | 164 WorkerThreadLifecycleContext*, |
| 164 const KURL&, | 165 const KURL&, |
| 165 const String& protocol, | 166 const String& protocol, |
| 166 WebSocketChannelSyncHelper*, | 167 WebSocketChannelSyncHelper*); |
| 167 ExecutionContext*); | |
| 168 | 168 |
| 169 // Returns null when |disconnect| has already been called. | 169 // Returns null when |disconnect| has already been called. |
| 170 WebSocketChannelClient* client() { return m_client; } | 170 WebSocketChannelClient* client() { return m_client; } |
| 171 | 171 |
| 172 DECLARE_TRACE(); | 172 DECLARE_TRACE(); |
| 173 // Promptly clear connection to peer + loader proxy. | 173 // Promptly clear connection to peer + loader proxy. |
| 174 EAGERLY_FINALIZE(); | 174 EAGERLY_FINALIZE(); |
| 175 | 175 |
| 176 private: | 176 private: |
| 177 Member<WebSocketChannelClient> m_client; | 177 Member<WebSocketChannelClient> m_client; |
| 178 Member<WorkerGlobalScope> m_workerGlobalScope; | 178 Member<WorkerGlobalScope> m_workerGlobalScope; |
| 179 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 179 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
| 180 CrossThreadPersistent<Peer> m_peer; | 180 CrossThreadPersistent<Peer> m_peer; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 private: | 183 private: |
| 184 WorkerWebSocketChannel(WorkerGlobalScope&, | 184 WorkerWebSocketChannel(WorkerGlobalScope&, |
| 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 |
| OLD | NEW |