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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 while (!output_queue_.empty()) { | 76 while (!output_queue_.empty()) { |
77 Message* m = output_queue_.front(); | 77 Message* m = output_queue_.front(); |
78 output_queue_.pop(); | 78 output_queue_.pop(); |
79 delete m; | 79 delete m; |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 bool Channel::ChannelImpl::Send(Message* message) { | 83 bool Channel::ChannelImpl::Send(Message* message) { |
84 // TODO(vtl): Remove once bug resolved. | |
85 CHECK(message && message->data()) << "crbug.com/357915"; | |
86 DCHECK(thread_check_->CalledOnValidThread()); | 84 DCHECK(thread_check_->CalledOnValidThread()); |
87 DVLOG(2) << "sending message @" << message << " on channel @" << this | 85 DVLOG(2) << "sending message @" << message << " on channel @" << this |
88 << " with type " << message->type() | 86 << " with type " << message->type() |
89 << " (" << output_queue_.size() << " in queue)"; | 87 << " (" << output_queue_.size() << " in queue)"; |
90 | 88 |
91 #ifdef IPC_MESSAGE_LOG_ENABLED | 89 #ifdef IPC_MESSAGE_LOG_ENABLED |
92 Logging::GetInstance()->OnSendMessage(message, ""); | 90 Logging::GetInstance()->OnSendMessage(message, ""); |
93 #endif | 91 #endif |
94 | 92 |
95 message->TraceMessageBegin(); | 93 message->TraceMessageBegin(); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 int secret; | 509 int secret; |
512 do { // Guarantee we get a non-zero value. | 510 do { // Guarantee we get a non-zero value. |
513 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 511 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
514 } while (secret == 0); | 512 } while (secret == 0); |
515 | 513 |
516 id.append(GenerateUniqueRandomChannelID()); | 514 id.append(GenerateUniqueRandomChannelID()); |
517 return id.append(base::StringPrintf("\\%d", secret)); | 515 return id.append(base::StringPrintf("\\%d", secret)); |
518 } | 516 } |
519 | 517 |
520 } // namespace IPC | 518 } // namespace IPC |
OLD | NEW |