Index: webrtc/base/taskparent.cc |
diff --git a/webrtc/base/taskparent.cc b/webrtc/base/taskparent.cc |
index 14d236dc428dc6bc30512da5cda98da5dfa9ca6e..56fafa0214c03f9b560939483d24474e76a8c0fe 100644 |
--- a/webrtc/base/taskparent.cc |
+++ b/webrtc/base/taskparent.cc |
@@ -12,6 +12,7 @@ |
#include "webrtc/base/taskparent.h" |
+#include "webrtc/base/checks.h" |
#include "webrtc/base/common.h" |
#include "webrtc/base/task.h" |
#include "webrtc/base/taskrunner.h" |
@@ -20,8 +21,8 @@ namespace rtc { |
TaskParent::TaskParent(Task* derived_instance, TaskParent *parent) |
: parent_(parent) { |
- ASSERT(derived_instance != NULL); |
- ASSERT(parent != NULL); |
+ RTC_DCHECK(derived_instance != NULL); |
+ RTC_DCHECK(parent != NULL); |
runner_ = parent->GetRunner(); |
parent_->AddChild(derived_instance); |
Initialize(); |
@@ -30,7 +31,7 @@ TaskParent::TaskParent(Task* derived_instance, TaskParent *parent) |
TaskParent::TaskParent(TaskRunner *derived_instance) |
: parent_(NULL), |
runner_(derived_instance) { |
- ASSERT(derived_instance != NULL); |
+ RTC_DCHECK(derived_instance != NULL); |
Initialize(); |
} |
@@ -46,9 +47,9 @@ void TaskParent::AddChild(Task *child) { |
children_->insert(child); |
} |
-#if !defined(NDEBUG) |
+#if RTC_DCHECK_IS_ON |
bool TaskParent::IsChildTask(Task *task) { |
- ASSERT(task != NULL); |
+ RTC_DCHECK(task != NULL); |
return task->parent_ == this && children_->find(task) != children_->end(); |
} |
#endif |
@@ -69,7 +70,7 @@ bool TaskParent::AnyChildError() { |
void TaskParent::AbortAllChildren() { |
if (children_->size() > 0) { |
-#if !defined(NDEBUG) |
+#if RTC_DCHECK_IS_ON |
runner_->IncrementAbortCount(); |
#endif |
@@ -78,7 +79,7 @@ void TaskParent::AbortAllChildren() { |
(*it)->Abort(true); // Note we do not wake |
} |
-#if !defined(NDEBUG) |
+#if RTC_DCHECK_IS_ON |
runner_->DecrementAbortCount(); |
#endif |
} |