summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 21:52:21 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 21:52:21 +0000
commit7e61bb63138faa706154f3c6da31b1cdf8dd8b65 (patch)
tree5a7f2a69d7dcd97cb7de70616d7a0d95eba1de4e /base
parentcf4d4373c34bb6cbf6383013e086e936c913bf97 (diff)
downloadchromium_src-7e61bb63138faa706154f3c6da31b1cdf8dd8b65.zip
chromium_src-7e61bb63138faa706154f3c6da31b1cdf8dd8b65.tar.gz
chromium_src-7e61bb63138faa706154f3c6da31b1cdf8dd8b65.tar.bz2
Added CHECK for tasks passed to PostTask being null.
I hope this will make the crashes associated with posting null tasks fail fast so they can be more easily diagnosed. TEST=try BUG=none TBR=darin@chromium.org Review URL: http://codereview.chromium.org/6982004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/message_loop.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc
index bf0d25d..a3520a6 100644
--- a/base/message_loop.cc
+++ b/base/message_loop.cc
@@ -255,6 +255,7 @@ void MessageLoop::RemoveDestructionObserver(
void MessageLoop::PostTask(
const tracked_objects::Location& from_here, Task* task) {
+ CHECK(task);
PendingTask pending_task(
base::Bind(&TaskClosureAdapter::Run,
new TaskClosureAdapter(task, &should_leak_tasks_)),
@@ -265,6 +266,7 @@ void MessageLoop::PostTask(
void MessageLoop::PostDelayedTask(
const tracked_objects::Location& from_here, Task* task, int64 delay_ms) {
+ CHECK(task);
PendingTask pending_task(
base::Bind(&TaskClosureAdapter::Run,
new TaskClosureAdapter(task, &should_leak_tasks_)),
@@ -275,6 +277,7 @@ void MessageLoop::PostDelayedTask(
void MessageLoop::PostNonNestableTask(
const tracked_objects::Location& from_here, Task* task) {
+ CHECK(task);
PendingTask pending_task(
base::Bind(&TaskClosureAdapter::Run,
new TaskClosureAdapter(task, &should_leak_tasks_)),
@@ -285,6 +288,7 @@ void MessageLoop::PostNonNestableTask(
void MessageLoop::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here, Task* task, int64 delay_ms) {
+ CHECK(task);
PendingTask pending_task(
base::Bind(&TaskClosureAdapter::Run,
new TaskClosureAdapter(task, &should_leak_tasks_)),
@@ -295,7 +299,7 @@ void MessageLoop::PostNonNestableDelayedTask(
void MessageLoop::PostTask(
const tracked_objects::Location& from_here, const base::Closure& task) {
- DCHECK(!task.is_null());
+ CHECK(!task.is_null());
PendingTask pending_task(task, from_here, CalculateDelayedRuntime(0), true);
AddToIncomingQueue(&pending_task);
}
@@ -303,7 +307,7 @@ void MessageLoop::PostTask(
void MessageLoop::PostDelayedTask(
const tracked_objects::Location& from_here, const base::Closure& task,
int64 delay_ms) {
- DCHECK(!task.is_null());
+ CHECK(!task.is_null());
PendingTask pending_task(task, from_here,
CalculateDelayedRuntime(delay_ms), true);
AddToIncomingQueue(&pending_task);
@@ -311,7 +315,7 @@ void MessageLoop::PostDelayedTask(
void MessageLoop::PostNonNestableTask(
const tracked_objects::Location& from_here, const base::Closure& task) {
- DCHECK(!task.is_null());
+ CHECK(!task.is_null());
PendingTask pending_task(task, from_here, CalculateDelayedRuntime(0), false);
AddToIncomingQueue(&pending_task);
}
@@ -319,7 +323,7 @@ void MessageLoop::PostNonNestableTask(
void MessageLoop::PostNonNestableDelayedTask(
const tracked_objects::Location& from_here, const base::Closure& task,
int64 delay_ms) {
- DCHECK(!task.is_null());
+ CHECK(!task.is_null());
PendingTask pending_task(task, from_here,
CalculateDelayedRuntime(delay_ms), false);
AddToIncomingQueue(&pending_task);