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

Side by Side Diff: third_party/WebKit/Source/modules/websockets/WorkerWebSocketChannel.cpp

Issue 2273483003: [WONT COMMIT] WebSocket: Signal when worker thread lifecycle context is destroyed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 void Peer::didError() 359 void Peer::didError()
360 { 360 {
361 ASSERT(isMainThread()); 361 ASSERT(isMainThread());
362 m_loaderProxy->postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThrea dTask(&workerGlobalScopeDidError, m_bridge)); 362 m_loaderProxy->postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThrea dTask(&workerGlobalScopeDidError, m_bridge));
363 } 363 }
364 364
365 void Peer::contextDestroyed() 365 void Peer::contextDestroyed()
366 { 366 {
367 DCHECK(isMainThread()); 367 DCHECK(isMainThread());
368 if (m_mainWebSocketChannel) { 368 disconnect();
369 m_mainWebSocketChannel->disconnect();
370 m_mainWebSocketChannel = nullptr;
371 }
372 m_bridge = nullptr; 369 m_bridge = nullptr;
373 } 370 }
374 371
375 DEFINE_TRACE(Peer) 372 DEFINE_TRACE(Peer)
376 { 373 {
377 visitor->trace(m_mainWebSocketChannel); 374 visitor->trace(m_mainWebSocketChannel);
378 visitor->trace(m_syncHelper); 375 visitor->trace(m_syncHelper);
379 WebSocketChannelClient::trace(visitor); 376 WebSocketChannelClient::trace(visitor);
380 WorkerThreadLifecycleObserver::trace(visitor); 377 WorkerThreadLifecycleObserver::trace(visitor);
381 } 378 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 496 }
500 497
501 DEFINE_TRACE(Bridge) 498 DEFINE_TRACE(Bridge)
502 { 499 {
503 visitor->trace(m_client); 500 visitor->trace(m_client);
504 visitor->trace(m_workerGlobalScope); 501 visitor->trace(m_workerGlobalScope);
505 visitor->trace(m_syncHelper); 502 visitor->trace(m_syncHelper);
506 } 503 }
507 504
508 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698