diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-11 19:23:42 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-11 19:23:42 +0000 |
commit | 7778ac1d8bc89bb70e96a90a75c099af9eacfc8c (patch) | |
tree | ca031905bc68d167e1f47b8aabb1f25859bbe50f /mojo/system | |
parent | 4418f0200b26e8022f74bad38881b3715784f4a3 (diff) | |
download | chromium_src-7778ac1d8bc89bb70e96a90a75c099af9eacfc8c.zip chromium_src-7778ac1d8bc89bb70e96a90a75c099af9eacfc8c.tar.gz chromium_src-7778ac1d8bc89bb70e96a90a75c099af9eacfc8c.tar.bz2 |
Mojo: Add DCHECKs to entrypoints that CoreImpl has been initialized.
R=darin@chromium.org, darin
Review URL: https://codereview.chromium.org/63673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/system')
-rw-r--r-- | mojo/system/core.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mojo/system/core.cc b/mojo/system/core.cc index 5367fd31..80d855f 100644 --- a/mojo/system/core.cc +++ b/mojo/system/core.cc @@ -4,17 +4,20 @@ #include "mojo/public/system/core.h" +#include "base/logging.h" #include "mojo/system/core_impl.h" extern "C" { MojoResult MojoClose(MojoHandle handle) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->Close(handle); } MojoResult MojoWait(MojoHandle handle, MojoWaitFlags flags, MojoDeadline deadline) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->Wait(handle, flags, deadline); } @@ -22,11 +25,13 @@ MojoResult MojoWaitMany(const MojoHandle* handles, const MojoWaitFlags* flags, uint32_t num_handles, MojoDeadline deadline) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->WaitMany(handles, flags, num_handles, deadline); } MojoResult MojoCreateMessagePipe(MojoHandle* handle_0, MojoHandle* handle_1) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->CreateMessagePipe(handle_0, handle_1); } @@ -34,6 +39,7 @@ MojoResult MojoWriteMessage(MojoHandle handle, const void* bytes, uint32_t num_bytes, const MojoHandle* handles, uint32_t num_handles, MojoWriteMessageFlags flags) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->WriteMessage(handle, bytes, num_bytes, handles, num_handles, @@ -44,6 +50,7 @@ MojoResult MojoReadMessage(MojoHandle handle, void* bytes, uint32_t* num_bytes, MojoHandle* handles, uint32_t* num_handles, MojoReadMessageFlags flags) { + DCHECK(mojo::system::CoreImpl::Get()) << "CoreImpl not initialized."; return mojo::system::CoreImpl::Get()->ReadMessage(handle, bytes, num_bytes, handles, num_handles, |