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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/NewWebSocketChannelImpl.h
diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.h b/Source/modules/websockets/NewWebSocketChannelImpl.h
index 7364207bf23566ab37cd2c32ae56ded857561b8d..8a28eff6277e86c3f3093361174eb0c183958c06 100644
--- a/Source/modules/websockets/NewWebSocketChannelImpl.h
+++ b/Source/modules/websockets/NewWebSocketChannelImpl.h
@@ -149,8 +149,24 @@ private:
void didFailLoadingBlob(FileError::ErrorCode);
// LifecycleObserver functions.
- // This object must be destroyed before the context.
- virtual void contextDestroyed() OVERRIDE { ASSERT_NOT_REACHED(); }
+ virtual void contextDestroyed() OVERRIDE
+ {
+#if ENABLE(OILPAN)
+ // In oilpan we cannot assume this channel's finalizer has been called
+ // before the document it is observing is dead and finalized since there
+ // is no eager finalization. Instead the finalization happens at the
+ // next GC which could be long enough after the Peer::destroy call for
+ // the context (ie. Document) to be dead too. If the context's finalizer
+ // is run first this method gets called. Instead we assert the channel
+ // has been disconnected which happens in Peer::destroy.
+ ASSERT(!m_handle);
+ ASSERT(!m_client);
+ ASSERT(!m_identifier);
+#else
+ // This object must be destroyed before the context.
+ ASSERT_NOT_REACHED();
+#endif
+ }
// m_handle is a handle of the connection.
// m_handle == 0 means this channel is closed.
« 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