Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Unified Diff: mojo/system/core_impl.cc

Issue 140403002: Mojo: Add the ability to hook up a channel to the embedder API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/core_impl.h ('k') | mojo/system/core_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/core_impl.cc
diff --git a/mojo/system/core_impl.cc b/mojo/system/core_impl.cc
index f3563211e132a3396dc25f00b1d6c76cbe5ee5ae..79d7ea36b4bc58fb8b8dd61223f53771faa4dd3b 100644
--- a/mojo/system/core_impl.cc
+++ b/mojo/system/core_impl.cc
@@ -85,9 +85,19 @@ CoreImpl::HandleTableEntry::~HandleTableEntry() {
DCHECK(!busy);
}
-// static
-void CoreImpl::Init() {
- Core::Init(new CoreImpl());
+CoreImpl::CoreImpl()
+ : next_handle_(MOJO_HANDLE_INVALID + 1) {
+}
+
+CoreImpl::~CoreImpl() {
+ // This should usually not be reached (the singleton lives forever), except in
+ // tests.
+}
+
+MojoHandle CoreImpl::AddDispatcher(
+ const scoped_refptr<Dispatcher>& dispatcher) {
+ base::AutoLock locker(handle_table_lock_);
+ return AddDispatcherNoLock(dispatcher);
}
MojoTimeTicks CoreImpl::GetTimeTicksNow() {
@@ -471,15 +481,6 @@ MojoResult CoreImpl::EndReadData(MojoHandle data_pipe_consumer_handle,
return dispatcher->EndReadData(num_bytes_read);
}
-CoreImpl::CoreImpl()
- : next_handle_(MOJO_HANDLE_INVALID + 1) {
-}
-
-CoreImpl::~CoreImpl() {
- // This should usually not be reached (the singleton lives forever), except in
- // tests.
-}
-
scoped_refptr<Dispatcher> CoreImpl::GetDispatcher(MojoHandle handle) {
if (handle == MOJO_HANDLE_INVALID)
return NULL;
« no previous file with comments | « mojo/system/core_impl.h ('k') | mojo/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698