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 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_channel_proxy.cc ('k') | net/cert/cert_database.cc » ('j') | 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 #include <utility> 9 #include <utility>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 // We set the event in case the listener thread is blocked (or is about 73 // We set the event in case the listener thread is blocked (or is about
74 // to). In case it's not, the PostTask dispatches the messages. 74 // to). In case it's not, the PostTask dispatches the messages.
75 message_queue_.push_back(QueuedMessage(new Message(msg), context)); 75 message_queue_.push_back(QueuedMessage(new Message(msg), context));
76 message_queue_version_++; 76 message_queue_version_++;
77 } 77 }
78 78
79 dispatch_event_.Signal(); 79 dispatch_event_.Signal();
80 if (!was_task_pending) { 80 if (!was_task_pending) {
81 listener_task_runner_->PostTask( 81 listener_task_runner_->PostTask(
82 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchMessagesTask, 82 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchMessagesTask,
83 this, scoped_refptr<SyncContext>(context))); 83 this, base::RetainedRef(context)));
84 } 84 }
85 } 85 }
86 86
87 void QueueReply(const Message &msg, SyncChannel::SyncContext* context) { 87 void QueueReply(const Message &msg, SyncChannel::SyncContext* context) {
88 received_replies_.push_back(QueuedMessage(new Message(msg), context)); 88 received_replies_.push_back(QueuedMessage(new Message(msg), context));
89 } 89 }
90 90
91 // Called on the listener's thread to process any queues synchronous 91 // Called on the listener's thread to process any queues synchronous
92 // messages. 92 // messages.
93 void DispatchMessagesTask(SyncContext* context) { 93 void DispatchMessagesTask(SyncContext* context) {
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 596
597 void SyncChannel::OnChannelInit() { 597 void SyncChannel::OnChannelInit() {
598 for (const auto& filter : pre_init_sync_message_filters_) { 598 for (const auto& filter : pre_init_sync_message_filters_) {
599 filter->set_is_channel_send_thread_safe( 599 filter->set_is_channel_send_thread_safe(
600 context()->IsChannelSendThreadSafe()); 600 context()->IsChannelSendThreadSafe());
601 } 601 }
602 pre_init_sync_message_filters_.clear(); 602 pre_init_sync_message_filters_.clear();
603 } 603 }
604 604
605 } // namespace IPC 605 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | net/cert/cert_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698