| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 void Init() { | 79 void Init() { |
| 80 MojoSystemThunks thunks = MakeSystemThunks(); | 80 MojoSystemThunks thunks = MakeSystemThunks(); |
| 81 size_t expected_size = MojoEmbedderSetSystemThunks(&thunks); | 81 size_t expected_size = MojoEmbedderSetSystemThunks(&thunks); |
| 82 DCHECK_EQ(expected_size, sizeof(thunks)); | 82 DCHECK_EQ(expected_size, sizeof(thunks)); |
| 83 | 83 |
| 84 internal::g_core = new Core(); | 84 internal::g_core = new Core(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void SetDefaultProcessErrorCallback(const ProcessErrorCallback& callback) { |
| 88 internal::g_core->SetDefaultProcessErrorCallback(callback); |
| 89 } |
| 90 |
| 87 MojoResult CreatePlatformHandleWrapper( | 91 MojoResult CreatePlatformHandleWrapper( |
| 88 ScopedPlatformHandle platform_handle, | 92 ScopedPlatformHandle platform_handle, |
| 89 MojoHandle* platform_handle_wrapper_handle) { | 93 MojoHandle* platform_handle_wrapper_handle) { |
| 90 return internal::g_core->CreatePlatformHandleWrapper( | 94 return internal::g_core->CreatePlatformHandleWrapper( |
| 91 std::move(platform_handle), platform_handle_wrapper_handle); | 95 std::move(platform_handle), platform_handle_wrapper_handle); |
| 92 } | 96 } |
| 93 | 97 |
| 94 MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle, | 98 MojoResult PassWrappedPlatformHandle(MojoHandle platform_handle_wrapper_handle, |
| 95 ScopedPlatformHandle* platform_handle) { | 99 ScopedPlatformHandle* platform_handle) { |
| 96 return internal::g_core->PassWrappedPlatformHandle( | 100 return internal::g_core->PassWrappedPlatformHandle( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return base::HexEncode(random_bytes, 16); | 169 return base::HexEncode(random_bytes, 16); |
| 166 } | 170 } |
| 167 | 171 |
| 168 MojoResult SetProperty(MojoPropertyType type, const void* value) { | 172 MojoResult SetProperty(MojoPropertyType type, const void* value) { |
| 169 CHECK(internal::g_core); | 173 CHECK(internal::g_core); |
| 170 return internal::g_core->SetProperty(type, value); | 174 return internal::g_core->SetProperty(type, value); |
| 171 } | 175 } |
| 172 | 176 |
| 173 } // namespace edk | 177 } // namespace edk |
| 174 } // namespace mojo | 178 } // namespace mojo |
| OLD | NEW |