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_channel_win.h" | 5 #include "ipc/ipc_channel_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool Channel::ChannelImpl::Send(Message* message) { | 81 bool Channel::ChannelImpl::Send(Message* message) { |
82 DCHECK(thread_check_->CalledOnValidThread()); | 82 DCHECK(thread_check_->CalledOnValidThread()); |
83 DVLOG(2) << "sending message @" << message << " on channel @" << this | 83 DVLOG(2) << "sending message @" << message << " on channel @" << this |
84 << " with type " << message->type() | 84 << " with type " << message->type() |
85 << " (" << output_queue_.size() << " in queue)"; | 85 << " (" << output_queue_.size() << " in queue)"; |
86 | 86 |
87 #ifdef IPC_MESSAGE_LOG_ENABLED | 87 #ifdef IPC_MESSAGE_LOG_ENABLED |
88 Logging::GetInstance()->OnSendMessage(message, ""); | 88 Logging::GetInstance()->OnSendMessage(message, ""); |
89 #endif | 89 #endif |
90 | 90 |
| 91 message->TraceMessageStep(); |
91 output_queue_.push(message); | 92 output_queue_.push(message); |
92 // ensure waiting to write | 93 // ensure waiting to write |
93 if (!waiting_connect_) { | 94 if (!waiting_connect_) { |
94 if (!output_state_.is_pending) { | 95 if (!output_state_.is_pending) { |
95 if (!ProcessOutgoingMessages(NULL, 0)) | 96 if (!ProcessOutgoingMessages(NULL, 0)) |
96 return false; | 97 return false; |
97 } | 98 } |
98 } | 99 } |
99 | 100 |
100 return true; | 101 return true; |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 int secret; | 498 int secret; |
498 do { // Guarantee we get a non-zero value. | 499 do { // Guarantee we get a non-zero value. |
499 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 500 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
500 } while (secret == 0); | 501 } while (secret == 0); |
501 | 502 |
502 id.append(GenerateUniqueRandomChannelID()); | 503 id.append(GenerateUniqueRandomChannelID()); |
503 return id.append(base::StringPrintf("\\%d", secret)); | 504 return id.append(base::StringPrintf("\\%d", secret)); |
504 } | 505 } |
505 | 506 |
506 } // namespace IPC | 507 } // namespace IPC |
OLD | NEW |