| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/public/system/core_private.h" | 5 #include "mojo/public/system/core_private.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 static mojo::Core* g_core = NULL; | 10 static mojo::Core* g_core = NULL; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return g_core->EndReadData(data_pipe_consumer_handle, num_elements_read); | 121 return g_core->EndReadData(data_pipe_consumer_handle, num_elements_read); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // extern "C" | 124 } // extern "C" |
| 125 | 125 |
| 126 namespace mojo { | 126 namespace mojo { |
| 127 | 127 |
| 128 Core::~Core() { | 128 Core::~Core() { |
| 129 } | 129 } |
| 130 | 130 |
| 131 // static |
| 131 void Core::Init(Core* core) { | 132 void Core::Init(Core* core) { |
| 132 assert(!g_core); | 133 assert(!g_core); |
| 133 g_core = core; | 134 g_core = core; |
| 134 } | 135 } |
| 135 | 136 |
| 137 // static |
| 138 Core* Core::Get() { |
| 139 return g_core; |
| 140 } |
| 141 |
| 142 // static |
| 143 void Core::Reset() { |
| 144 g_core = NULL; |
| 145 } |
| 146 |
| 136 } // namespace mojo | 147 } // namespace mojo |
| OLD | NEW |