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

Side by Side Diff: ipc/ipc_sync_channel.cc

Issue 2316963005: Reworks Channel pausing behavior (Closed)
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
« no previous file with comments | « ipc/ipc_sync_channel.h ('k') | 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_sync_channel.h" 5 #include "ipc/ipc_sync_channel.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 return Context::OnMessageReceivedNoFilter(msg); 444 return Context::OnMessageReceivedNoFilter(msg);
445 } 445 }
446 446
447 void SyncChannel::SyncContext::OnChannelError() { 447 void SyncChannel::SyncContext::OnChannelError() {
448 CancelPendingSends(); 448 CancelPendingSends();
449 shutdown_watcher_.StopWatching(); 449 shutdown_watcher_.StopWatching();
450 Context::OnChannelError(); 450 Context::OnChannelError();
451 } 451 }
452 452
453 void SyncChannel::SyncContext::OnChannelOpened(bool pause) { 453 void SyncChannel::SyncContext::OnChannelOpened() {
454 shutdown_watcher_.StartWatching( 454 shutdown_watcher_.StartWatching(
455 shutdown_event_, 455 shutdown_event_,
456 base::Bind(&SyncChannel::SyncContext::OnShutdownEventSignaled, 456 base::Bind(&SyncChannel::SyncContext::OnShutdownEventSignaled,
457 base::Unretained(this))); 457 base::Unretained(this)));
458 Context::OnChannelOpened(pause); 458 Context::OnChannelOpened();
459 } 459 }
460 460
461 void SyncChannel::SyncContext::OnChannelClosed() { 461 void SyncChannel::SyncContext::OnChannelClosed() {
462 CancelPendingSends(); 462 CancelPendingSends();
463 shutdown_watcher_.StopWatching(); 463 shutdown_watcher_.StopWatching();
464 Context::OnChannelClosed(); 464 Context::OnChannelClosed();
465 } 465 }
466 466
467 void SyncChannel::SyncContext::CancelPendingSends() { 467 void SyncChannel::SyncContext::CancelPendingSends() {
468 base::AutoLock auto_lock(deserializers_lock_); 468 base::AutoLock auto_lock(deserializers_lock_);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 700
701 void SyncChannel::OnChannelInit() { 701 void SyncChannel::OnChannelInit() {
702 for (const auto& filter : pre_init_sync_message_filters_) { 702 for (const auto& filter : pre_init_sync_message_filters_) {
703 filter->set_is_channel_send_thread_safe( 703 filter->set_is_channel_send_thread_safe(
704 context()->IsChannelSendThreadSafe()); 704 context()->IsChannelSendThreadSafe());
705 } 705 }
706 pre_init_sync_message_filters_.clear(); 706 pre_init_sync_message_filters_.clear();
707 } 707 }
708 708
709 } // namespace IPC 709 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698