OLD | NEW |
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 Loading... |
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() { | 453 void SyncChannel::SyncContext::OnChannelOpened(bool pause) { |
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(); | 458 Context::OnChannelOpened(pause); |
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 Loading... |
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 |
OLD | NEW |