| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 while (!output_queue_.empty()) { | 73 while (!output_queue_.empty()) { |
| 74 Message* m = output_queue_.front(); | 74 Message* m = output_queue_.front(); |
| 75 output_queue_.pop(); | 75 output_queue_.pop(); |
| 76 delete m; | 76 delete m; |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool ChannelWin::Send(Message* message) { | 80 bool ChannelWin::Send(Message* message) { |
| 81 DCHECK(!message->HasAttachments()); |
| 81 DCHECK(thread_check_->CalledOnValidThread()); | 82 DCHECK(thread_check_->CalledOnValidThread()); |
| 82 DVLOG(2) << "sending message @" << message << " on channel @" << this | 83 DVLOG(2) << "sending message @" << message << " on channel @" << this |
| 83 << " with type " << message->type() | 84 << " with type " << message->type() |
| 84 << " (" << output_queue_.size() << " in queue)"; | 85 << " (" << output_queue_.size() << " in queue)"; |
| 85 | 86 |
| 86 #ifdef IPC_MESSAGE_LOG_ENABLED | 87 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 87 Logging::GetInstance()->OnSendMessage(message, ""); | 88 Logging::GetInstance()->OnSendMessage(message, ""); |
| 88 #endif | 89 #endif |
| 89 | 90 |
| 90 message->TraceMessageBegin(); | 91 message->TraceMessageBegin(); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 int secret; | 501 int secret; |
| 501 do { // Guarantee we get a non-zero value. | 502 do { // Guarantee we get a non-zero value. |
| 502 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 503 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
| 503 } while (secret == 0); | 504 } while (secret == 0); |
| 504 | 505 |
| 505 id.append(GenerateUniqueRandomChannelID()); | 506 id.append(GenerateUniqueRandomChannelID()); |
| 506 return id.append(base::StringPrintf("\\%d", secret)); | 507 return id.append(base::StringPrintf("\\%d", secret)); |
| 507 } | 508 } |
| 508 | 509 |
| 509 } // namespace IPC | 510 } // namespace IPC |
| OLD | NEW |