Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: Source/modules/websockets/NewWebSocketChannelImpl.h

Issue 405453002: [oilpan]: Don't assert the context is destroyed _after_ the NewWebSocketChannelImpl in oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: moved comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 virtual void contextDestroyed() OVERRIDE
153 virtual void contextDestroyed() OVERRIDE { ASSERT_NOT_REACHED(); } 153 {
154 #if ENABLE(OILPAN)
155 // In oilpan we cannot assume this channel's finalizer has been called
156 // before the document it is observing is dead and finalized since there
157 // is no eager finalization. Instead the finalization happens at the
158 // next GC which could be long enough after the Peer::destroy call for
159 // the context (ie. Document) to be dead too. If the context's finalizer
160 // is run first this method gets called. Instead we assert the channel
161 // has been disconnected which happens in Peer::destroy.
162 ASSERT(!m_handle);
163 ASSERT(!m_client);
164 ASSERT(!m_identifier);
165 #else
166 // This object must be destroyed before the context.
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698