| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // When the Bridge object calls Peer::destroy, the persistent handle is
destroyed. | 142 // When the Bridge object calls Peer::destroy, the persistent handle is
destroyed. |
| 143 // This is because we cannot dispatch a disconnect chain from Peer's des
tructor since | 143 // This is because we cannot dispatch a disconnect chain from Peer's des
tructor since |
| 144 // the disconnect chain touches on-heap objets. | 144 // the disconnect chain touches on-heap objets. |
| 145 GC_PLUGIN_IGNORE("") | 145 GC_PLUGIN_IGNORE("") |
| 146 Persistent<Peer> m_keepAlive; | 146 Persistent<Peer> m_keepAlive; |
| 147 #else | 147 #else |
| 148 WeakPtrFactory<Peer> m_weakFactory; | 148 WeakPtrFactory<Peer> m_weakFactory; |
| 149 #endif | 149 #endif |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 private: | |
| 153 // Bridge for Peer. Running on the worker thread. | 152 // Bridge for Peer. Running on the worker thread. |
| 154 class Bridge FINAL : public RefCountedWillBeGarbageCollectedFinalized<Bridge
> { | 153 class Bridge FINAL : public RefCountedWillBeGarbageCollectedFinalized<Bridge
> { |
| 155 public: | 154 public: |
| 156 static PassRefPtrWillBeRawPtr<Bridge> create(PassRefPtrWillBeRawPtr<Thre
adableWebSocketChannelClientWrapper> workerClientWrapper, WorkerGlobalScope& wor
kerGlobalScope) | 155 static PassRefPtrWillBeRawPtr<Bridge> create(PassRefPtrWillBeRawPtr<Thre
adableWebSocketChannelClientWrapper> workerClientWrapper, WorkerGlobalScope& wor
kerGlobalScope) |
| 157 { | 156 { |
| 158 return adoptRefWillBeNoop(new Bridge(workerClientWrapper, workerGlob
alScope)); | 157 return adoptRefWillBeNoop(new Bridge(workerClientWrapper, workerGlob
alScope)); |
| 159 } | 158 } |
| 160 ~Bridge(); | 159 ~Bridge(); |
| 161 // sourceURLAtConnection and lineNumberAtConnection parameters may | 160 // sourceURLAtConnection and lineNumberAtConnection parameters may |
| 162 // be shown when the connection fails. | 161 // be shown when the connection fails. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 189 | 188 |
| 190 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_work
erClientWrapper; | 189 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_work
erClientWrapper; |
| 191 RefPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; | 190 RefPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; |
| 192 WorkerLoaderProxy& m_loaderProxy; | 191 WorkerLoaderProxy& m_loaderProxy; |
| 193 RawPtrWillBeMember<ThreadableWebSocketChannelSyncHelper> m_syncHelper; | 192 RawPtrWillBeMember<ThreadableWebSocketChannelSyncHelper> m_syncHelper; |
| 194 // The value of this pointer is set when a Peer object is created in Pee
r::initilize() | 193 // The value of this pointer is set when a Peer object is created in Pee
r::initilize() |
| 195 // in the main thread. | 194 // in the main thread. |
| 196 WeakPtrWillBeWeakMember<Peer> m_peer; | 195 WeakPtrWillBeWeakMember<Peer> m_peer; |
| 197 }; | 196 }; |
| 198 | 197 |
| 198 private: |
| 199 WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*
, const String& sourceURL, unsigned lineNumber); | 199 WorkerThreadableWebSocketChannel(WorkerGlobalScope&, WebSocketChannelClient*
, const String& sourceURL, unsigned lineNumber); |
| 200 | 200 |
| 201 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl
ientWrapper; | 201 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl
ientWrapper; |
| 202 RefPtrWillBeMember<Bridge> m_bridge; | 202 RefPtrWillBeMember<Bridge> m_bridge; |
| 203 String m_sourceURLAtConnection; | 203 String m_sourceURLAtConnection; |
| 204 unsigned m_lineNumberAtConnection; | 204 unsigned m_lineNumberAtConnection; |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 } // namespace blink | 207 } // namespace blink |
| 208 | 208 |
| 209 #endif // WorkerThreadableWebSocketChannel_h | 209 #endif // WorkerThreadableWebSocketChannel_h |
| OLD | NEW |