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"; |
84 DCHECK(thread_check_->CalledOnValidThread()); | 86 DCHECK(thread_check_->CalledOnValidThread()); |
85 DVLOG(2) << "sending message @" << message << " on channel @" << this | 87 DVLOG(2) << "sending message @" << message << " on channel @" << this |
86 << " with type " << message->type() | 88 << " with type " << message->type() |
87 << " (" << output_queue_.size() << " in queue)"; | 89 << " (" << output_queue_.size() << " in queue)"; |
88 | 90 |
89 #ifdef IPC_MESSAGE_LOG_ENABLED | 91 #ifdef IPC_MESSAGE_LOG_ENABLED |
90 Logging::GetInstance()->OnSendMessage(message, ""); | 92 Logging::GetInstance()->OnSendMessage(message, ""); |
91 #endif | 93 #endif |
92 | 94 |
93 message->TraceMessageBegin(); | 95 message->TraceMessageBegin(); |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 int secret; | 511 int secret; |
510 do { // Guarantee we get a non-zero value. | 512 do { // Guarantee we get a non-zero value. |
511 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 513 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
512 } while (secret == 0); | 514 } while (secret == 0); |
513 | 515 |
514 id.append(GenerateUniqueRandomChannelID()); | 516 id.append(GenerateUniqueRandomChannelID()); |
515 return id.append(base::StringPrintf("\\%d", secret)); | 517 return id.append(base::StringPrintf("\\%d", secret)); |
516 } | 518 } |
517 | 519 |
518 } // namespace IPC | 520 } // namespace IPC |
OLD | NEW |