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

Side by Side Diff: ipc/ipc_sync_channel.cc

Issue 1322253003: ipc: Convert int types from basictypes.h to the ones from stdint.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 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_perftest_support.cc ('k') | ipc/ipc_sync_message.h » ('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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void DispatchMessagesTask(SyncContext* context) { 89 void DispatchMessagesTask(SyncContext* context) {
90 { 90 {
91 base::AutoLock auto_lock(message_lock_); 91 base::AutoLock auto_lock(message_lock_);
92 task_pending_ = false; 92 task_pending_ = false;
93 } 93 }
94 context->DispatchMessages(); 94 context->DispatchMessages();
95 } 95 }
96 96
97 void DispatchMessages(SyncContext* dispatching_context) { 97 void DispatchMessages(SyncContext* dispatching_context) {
98 bool first_time = true; 98 bool first_time = true;
99 uint32 expected_version = 0; 99 uint32_t expected_version = 0;
100 SyncMessageQueue::iterator it; 100 SyncMessageQueue::iterator it;
101 while (true) { 101 while (true) {
102 Message* message = NULL; 102 Message* message = NULL;
103 scoped_refptr<SyncChannel::SyncContext> context; 103 scoped_refptr<SyncChannel::SyncContext> context;
104 { 104 {
105 base::AutoLock auto_lock(message_lock_); 105 base::AutoLock auto_lock(message_lock_);
106 if (first_time || message_queue_version_ != expected_version) { 106 if (first_time || message_queue_version_ != expected_version) {
107 it = message_queue_.begin(); 107 it = message_queue_.begin();
108 first_time = false; 108 first_time = false;
109 } 109 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 // Holds information about a queued synchronous message or reply. 198 // Holds information about a queued synchronous message or reply.
199 struct QueuedMessage { 199 struct QueuedMessage {
200 QueuedMessage(Message* m, SyncContext* c) : message(m), context(c) { } 200 QueuedMessage(Message* m, SyncContext* c) : message(m), context(c) { }
201 Message* message; 201 Message* message;
202 scoped_refptr<SyncChannel::SyncContext> context; 202 scoped_refptr<SyncChannel::SyncContext> context;
203 }; 203 };
204 204
205 typedef std::list<QueuedMessage> SyncMessageQueue; 205 typedef std::list<QueuedMessage> SyncMessageQueue;
206 SyncMessageQueue message_queue_; 206 SyncMessageQueue message_queue_;
207 uint32 message_queue_version_; // Used to signal DispatchMessages to rescan 207 uint32_t message_queue_version_; // Used to signal DispatchMessages to rescan
208 208
209 std::vector<QueuedMessage> received_replies_; 209 std::vector<QueuedMessage> received_replies_;
210 210
211 // Set when we got a synchronous message that we must respond to as the 211 // Set when we got a synchronous message that we must respond to as the
212 // sender needs its reply before it can reply to our original synchronous 212 // sender needs its reply before it can reply to our original synchronous
213 // message. 213 // message.
214 WaitableEvent dispatch_event_; 214 WaitableEvent dispatch_event_;
215 scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner_; 215 scoped_refptr<base::SingleThreadTaskRunner> listener_task_runner_;
216 base::Lock message_lock_; 216 base::Lock message_lock_;
217 bool task_pending_; 217 bool task_pending_;
(...skipping 378 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_perftest_support.cc ('k') | ipc/ipc_sync_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698