OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/edk/embedder/embedder.h" | 5 #include "mojo/edk/embedder/embedder.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 PlatformSupport* g_platform_support; | 32 PlatformSupport* g_platform_support; |
33 ProcessDelegate* g_process_delegate; | 33 ProcessDelegate* g_process_delegate; |
34 | 34 |
35 Core* GetCore() { return g_core; } | 35 Core* GetCore() { return g_core; } |
36 | 36 |
37 } // namespace internal | 37 } // namespace internal |
38 | 38 |
39 void SetMaxMessageSize(size_t bytes) { | 39 void SetMaxMessageSize(size_t bytes) { |
40 } | 40 } |
41 | 41 |
42 void PreInitializeParentProcess() { | |
43 } | |
44 | |
45 void PreInitializeChildProcess() { | |
46 } | |
47 | |
48 ScopedPlatformHandle ChildProcessLaunched(base::ProcessHandle child_process) { | 42 ScopedPlatformHandle ChildProcessLaunched(base::ProcessHandle child_process) { |
49 PlatformChannelPair channel; | 43 PlatformChannelPair channel; |
50 ChildProcessLaunched(child_process, channel.PassServerHandle()); | 44 ChildProcessLaunched(child_process, channel.PassServerHandle()); |
51 return channel.PassClientHandle(); | 45 return channel.PassClientHandle(); |
52 } | 46 } |
53 | 47 |
54 void ChildProcessLaunched(base::ProcessHandle child_process, | 48 void ChildProcessLaunched(base::ProcessHandle child_process, |
55 ScopedPlatformHandle server_pipe) { | 49 ScopedPlatformHandle server_pipe) { |
56 CHECK(internal::g_core); | 50 CHECK(internal::g_core); |
57 internal::g_core->AddChild(child_process, std::move(server_pipe)); | 51 internal::g_core->AddChild(child_process, std::move(server_pipe)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 127 } |
134 | 128 |
135 std::string GenerateRandomToken() { | 129 std::string GenerateRandomToken() { |
136 char random_bytes[16]; | 130 char random_bytes[16]; |
137 crypto::RandBytes(random_bytes, 16); | 131 crypto::RandBytes(random_bytes, 16); |
138 return base::HexEncode(random_bytes, 16); | 132 return base::HexEncode(random_bytes, 16); |
139 } | 133 } |
140 | 134 |
141 } // namespace edk | 135 } // namespace edk |
142 } // namespace mojo | 136 } // namespace mojo |
OLD | NEW |