OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 virtual void didReceiveData(blink::WebSocketHandle*, bool fin, blink::WebSoc ketHandle::MessageType, const char* data, size_t /* size */) OVERRIDE; | 142 virtual void didReceiveData(blink::WebSocketHandle*, bool fin, blink::WebSoc ketHandle::MessageType, const char* data, size_t /* size */) OVERRIDE; |
143 virtual void didClose(blink::WebSocketHandle*, bool wasClean, unsigned short code, const blink::WebString& reason) OVERRIDE; | 143 virtual void didClose(blink::WebSocketHandle*, bool wasClean, unsigned short code, const blink::WebString& reason) OVERRIDE; |
144 virtual void didReceiveFlowControl(blink::WebSocketHandle*, int64_t quota) O VERRIDE; | 144 virtual void didReceiveFlowControl(blink::WebSocketHandle*, int64_t quota) O VERRIDE; |
145 virtual void didStartClosingHandshake(blink::WebSocketHandle*) OVERRIDE; | 145 virtual void didStartClosingHandshake(blink::WebSocketHandle*) OVERRIDE; |
146 | 146 |
147 // Methods for BlobLoader. | 147 // Methods for BlobLoader. |
148 void didFinishLoadingBlob(PassRefPtr<ArrayBuffer>); | 148 void didFinishLoadingBlob(PassRefPtr<ArrayBuffer>); |
149 void didFailLoadingBlob(FileError::ErrorCode); | 149 void didFailLoadingBlob(FileError::ErrorCode); |
150 | 150 |
151 // LifecycleObserver functions. | 151 // LifecycleObserver functions. |
152 // This object must be destroyed before the context. | 152 // This object must be destroyed before the context. |
sof
2014/07/17 13:39:30
surface nit: move this comment down into the #else
wibling-chromium
2014/07/17 14:16:49
Done.
| |
153 virtual void contextDestroyed() OVERRIDE { ASSERT_NOT_REACHED(); } | 153 virtual void contextDestroyed() OVERRIDE |
154 { | |
155 #if ENABLE(OILPAN) | |
156 // In oilpan we cannot assume this channel's finalizer has been called | |
157 // before the document it is observing is dead and finalized since there | |
158 // is no eager finalization. Instead the finalization happens at the | |
159 // next GC which could be long enough after the Peer::destroy call for | |
160 // the context (ie. Document) to be dead too. If the context's finalizer | |
161 // is run first this method gets called. Instead we assert the channel | |
162 // has been disconnected which happens in Peer::destroy. | |
163 ASSERT(!m_handle); | |
164 ASSERT(!m_client); | |
165 ASSERT(!m_identifier); | |
166 #else | |
167 ASSERT_NOT_REACHED(); | |
168 #endif | |
169 } | |
154 | 170 |
155 // m_handle is a handle of the connection. | 171 // m_handle is a handle of the connection. |
156 // m_handle == 0 means this channel is closed. | 172 // m_handle == 0 means this channel is closed. |
157 OwnPtr<blink::WebSocketHandle> m_handle; | 173 OwnPtr<blink::WebSocketHandle> m_handle; |
158 | 174 |
159 // m_client can be deleted while this channel is alive, but this class | 175 // m_client can be deleted while this channel is alive, but this class |
160 // expects that disconnect() is called before the deletion. | 176 // expects that disconnect() is called before the deletion. |
161 RawPtrWillBeMember<WebSocketChannelClient> m_client; | 177 RawPtrWillBeMember<WebSocketChannelClient> m_client; |
162 KURL m_url; | 178 KURL m_url; |
163 // m_identifier > 0 means calling scriptContextExecution() returns a Documen t. | 179 // m_identifier > 0 means calling scriptContextExecution() returns a Documen t. |
(...skipping 10 matching lines...) Expand all Loading... | |
174 String m_sourceURLAtConstruction; | 190 String m_sourceURLAtConstruction; |
175 unsigned m_lineNumberAtConstruction; | 191 unsigned m_lineNumberAtConstruction; |
176 RefPtr<WebSocketHandshakeRequest> m_handshakeRequest; | 192 RefPtr<WebSocketHandshakeRequest> m_handshakeRequest; |
177 | 193 |
178 static const int64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15; | 194 static const int64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15; |
179 }; | 195 }; |
180 | 196 |
181 } // namespace WebCore | 197 } // namespace WebCore |
182 | 198 |
183 #endif // NewWebSocketChannelImpl_h | 199 #endif // NewWebSocketChannelImpl_h |
OLD | NEW |