| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WorkerWebSocketChannel_h | 31 #ifndef WorkerWebSocketChannel_h |
| 32 #define WorkerWebSocketChannel_h | 32 #define WorkerWebSocketChannel_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/SourceLocation.h" | 34 #include "bindings/core/v8/SourceLocation.h" |
| 35 #include "core/workers/WorkerThreadLifecycleObserver.h" | 35 #include "core/workers/WorkerThreadLifecycleObserver.h" |
| 36 #include "modules/websockets/WebSocketChannel.h" | 36 #include "modules/websockets/WebSocketChannel.h" |
| 37 #include "modules/websockets/WebSocketChannelClient.h" | 37 #include "modules/websockets/WebSocketChannelClient.h" |
| 38 #include "platform/heap/Handle.h" | 38 #include "platform/heap/Handle.h" |
| 39 #include "public/platform/WebTraceLocation.h" |
| 39 #include "wtf/Assertions.h" | 40 #include "wtf/Assertions.h" |
| 40 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
| 41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 42 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 43 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 44 #include <memory> | 45 #include <memory> |
| 45 #include <stdint.h> | 46 #include <stdint.h> |
| 46 | 47 |
| 47 namespace blink { | 48 namespace blink { |
| 48 | 49 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 146 |
| 146 // Returns null when |disconnect| has already been called. | 147 // Returns null when |disconnect| has already been called. |
| 147 WebSocketChannelClient* client() { return m_client; } | 148 WebSocketChannelClient* client() { return m_client; } |
| 148 | 149 |
| 149 DECLARE_TRACE(); | 150 DECLARE_TRACE(); |
| 150 // Promptly clear connection to peer + loader proxy. | 151 // Promptly clear connection to peer + loader proxy. |
| 151 EAGERLY_FINALIZE(); | 152 EAGERLY_FINALIZE(); |
| 152 | 153 |
| 153 private: | 154 private: |
| 154 // Returns false if shutdown event is received before method completion. | 155 // Returns false if shutdown event is received before method completion. |
| 155 bool waitForMethodCompletion(std::unique_ptr<ExecutionContextTask>); | 156 bool waitForMethodCompletion(const WebTraceLocation&, std::unique_ptr<Ex
ecutionContextTask>); |
| 156 | 157 |
| 157 Member<WebSocketChannelClient> m_client; | 158 Member<WebSocketChannelClient> m_client; |
| 158 Member<WorkerGlobalScope> m_workerGlobalScope; | 159 Member<WorkerGlobalScope> m_workerGlobalScope; |
| 159 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 160 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
| 160 Member<WebSocketChannelSyncHelper> m_syncHelper; | 161 Member<WebSocketChannelSyncHelper> m_syncHelper; |
| 161 CrossThreadPersistent<Peer> m_peer; | 162 CrossThreadPersistent<Peer> m_peer; |
| 162 }; | 163 }; |
| 163 | 164 |
| 164 private: | 165 private: |
| 165 WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, std::uni
que_ptr<SourceLocation>); | 166 WorkerWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*, std::uni
que_ptr<SourceLocation>); |
| 166 | 167 |
| 167 Member<Bridge> m_bridge; | 168 Member<Bridge> m_bridge; |
| 168 std::unique_ptr<SourceLocation> m_locationAtConnection; | 169 std::unique_ptr<SourceLocation> m_locationAtConnection; |
| 169 }; | 170 }; |
| 170 | 171 |
| 171 } // namespace blink | 172 } // namespace blink |
| 172 | 173 |
| 173 #endif // WorkerWebSocketChannel_h | 174 #endif // WorkerWebSocketChannel_h |
| OLD | NEW |