diff options
author | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 19:48:15 +0000 |
---|---|---|
committer | jamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 19:48:15 +0000 |
commit | 9600bd862ab0ce57d132f5cb039d702e11968cf2 (patch) | |
tree | 00c5e4b35ea3458aaed853404eeca004e02a6021 /base/message_loop.h | |
parent | e3171b346e6919f4162ea128d0f7b342cf878fd4 (diff) | |
download | chromium_src-9600bd862ab0ce57d132f5cb039d702e11968cf2.zip chromium_src-9600bd862ab0ce57d132f5cb039d702e11968cf2.tar.gz chromium_src-9600bd862ab0ce57d132f5cb039d702e11968cf2.tar.bz2 |
Added non-NULL DCHECK to MessageLoopForUI::current.
Having spent a little while tracking down a crash caused by not having a
message loop when calling this function, it seems that this is worth having.
I'm in two minds as to whether I prefer this approach to one where NULL is
a valid return value in debug builds as it is in release builds.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9705073
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop.h')
-rw-r--r-- | base/message_loop.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/base/message_loop.h b/base/message_loop.h index 5851be1..0611ad4 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -554,6 +554,7 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop { // Returns the MessageLoopForUI of the current thread. static MessageLoopForUI* current() { MessageLoop* loop = MessageLoop::current(); + DCHECK(loop); DCHECK_EQ(MessageLoop::TYPE_UI, loop->type()); return static_cast<MessageLoopForUI*>(loop); } |