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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/process_util.h" | 13 #include "base/process_util.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
| 19 #include "ipc/ipc_listener.h" |
19 #include "ipc/ipc_logging.h" | 20 #include "ipc/ipc_logging.h" |
20 #include "ipc/ipc_message_utils.h" | 21 #include "ipc/ipc_message_utils.h" |
21 | 22 |
22 namespace IPC { | 23 namespace IPC { |
23 | 24 |
24 Channel::ChannelImpl::State::State(ChannelImpl* channel) : is_pending(false) { | 25 Channel::ChannelImpl::State::State(ChannelImpl* channel) : is_pending(false) { |
25 memset(&context.overlapped, 0, sizeof(context.overlapped)); | 26 memset(&context.overlapped, 0, sizeof(context.overlapped)); |
26 context.handler = channel; | 27 context.handler = channel; |
27 } | 28 } |
28 | 29 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 int secret; | 499 int secret; |
499 do { // Guarantee we get a non-zero value. | 500 do { // Guarantee we get a non-zero value. |
500 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 501 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
501 } while (secret == 0); | 502 } while (secret == 0); |
502 | 503 |
503 id.append(GenerateUniqueRandomChannelID()); | 504 id.append(GenerateUniqueRandomChannelID()); |
504 return id.append(base::StringPrintf("\\%d", secret)); | 505 return id.append(base::StringPrintf("\\%d", secret)); |
505 } | 506 } |
506 | 507 |
507 } // namespace IPC | 508 } // namespace IPC |
OLD | NEW |