| 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 27 matching lines...) Expand all Loading... |
| 38 Core* GetCore() { return g_core; } | 38 Core* GetCore() { return g_core; } |
| 39 | 39 |
| 40 } // namespace internal | 40 } // namespace internal |
| 41 | 41 |
| 42 void SetMaxMessageSize(size_t bytes) { | 42 void SetMaxMessageSize(size_t bytes) { |
| 43 } | 43 } |
| 44 | 44 |
| 45 void ChildProcessLaunched(base::ProcessHandle child_process, | 45 void ChildProcessLaunched(base::ProcessHandle child_process, |
| 46 ScopedPlatformHandle server_pipe, | 46 ScopedPlatformHandle server_pipe, |
| 47 const std::string& child_token) { | 47 const std::string& child_token) { |
| 48 ChildProcessLaunched(child_process, std::move(server_pipe), |
| 49 child_token, ProcessErrorCallback()); |
| 50 } |
| 51 |
| 52 void ChildProcessLaunched(base::ProcessHandle child_process, |
| 53 ScopedPlatformHandle server_pipe, |
| 54 const std::string& child_token, |
| 55 const ProcessErrorCallback& process_error_callback) { |
| 48 CHECK(internal::g_core); | 56 CHECK(internal::g_core); |
| 49 internal::g_core->AddChild(child_process, std::move(server_pipe), | 57 internal::g_core->AddChild(child_process, std::move(server_pipe), |
| 50 child_token); | 58 child_token, process_error_callback); |
| 51 } | 59 } |
| 52 | 60 |
| 53 void ChildProcessLaunchFailed(const std::string& child_token) { | 61 void ChildProcessLaunchFailed(const std::string& child_token) { |
| 54 CHECK(internal::g_core); | 62 CHECK(internal::g_core); |
| 55 internal::g_core->ChildLaunchFailed(child_token); | 63 internal::g_core->ChildLaunchFailed(child_token); |
| 56 } | 64 } |
| 57 | 65 |
| 58 void SetParentPipeHandle(ScopedPlatformHandle pipe) { | 66 void SetParentPipeHandle(ScopedPlatformHandle pipe) { |
| 59 CHECK(internal::g_core); | 67 CHECK(internal::g_core); |
| 60 internal::g_core->InitChild(std::move(pipe)); | 68 internal::g_core->InitChild(std::move(pipe)); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // Not secure. For NaCl only! | 167 // Not secure. For NaCl only! |
| 160 base::RandBytes(random_bytes, 16); | 168 base::RandBytes(random_bytes, 16); |
| 161 #else | 169 #else |
| 162 crypto::RandBytes(random_bytes, 16); | 170 crypto::RandBytes(random_bytes, 16); |
| 163 #endif | 171 #endif |
| 164 return base::HexEncode(random_bytes, 16); | 172 return base::HexEncode(random_bytes, 16); |
| 165 } | 173 } |
| 166 | 174 |
| 167 } // namespace edk | 175 } // namespace edk |
| 168 } // namespace mojo | 176 } // namespace mojo |
| OLD | NEW |