summaryrefslogtreecommitdiffstats
path: root/mojo/system
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-11 19:23:42 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-11 19:23:42 +0000
commit7778ac1d8bc89bb70e96a90a75c099af9eacfc8c (patch)
treeca031905bc68d167e1f47b8aabb1f25859bbe50f /mojo/system
parent4418f0200b26e8022f74bad38881b3715784f4a3 (diff)
downloadchromium_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.cc7
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,