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/pickle.h" | 13 #include "base/pickle.h" |
14 #include "base/process_util.h" | 14 #include "base/process/process_handle.h" |
15 #include "base/rand_util.h" | 15 #include "base/rand_util.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
19 #include "base/win/scoped_handle.h" | 19 #include "base/win/scoped_handle.h" |
20 #include "ipc/ipc_listener.h" | 20 #include "ipc/ipc_listener.h" |
21 #include "ipc/ipc_logging.h" | 21 #include "ipc/ipc_logging.h" |
22 #include "ipc/ipc_message_utils.h" | 22 #include "ipc/ipc_message_utils.h" |
23 | 23 |
24 namespace IPC { | 24 namespace IPC { |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 int secret; | 508 int secret; |
509 do { // Guarantee we get a non-zero value. | 509 do { // Guarantee we get a non-zero value. |
510 secret = base::RandInt(0, std::numeric_limits<int>::max()); | 510 secret = base::RandInt(0, std::numeric_limits<int>::max()); |
511 } while (secret == 0); | 511 } while (secret == 0); |
512 | 512 |
513 id.append(GenerateUniqueRandomChannelID()); | 513 id.append(GenerateUniqueRandomChannelID()); |
514 return id.append(base::StringPrintf("\\%d", secret)); | 514 return id.append(base::StringPrintf("\\%d", secret)); |
515 } | 515 } |
516 | 516 |
517 } // namespace IPC | 517 } // namespace IPC |
OLD | NEW |