Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(905)

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp

Issue 2846773002: [DONT COMMIT] Worker: Add checks in InProcessWorkerObjectProxy for debug (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
index fffaf55c94f4f9a1c7765a948ad30b20d51e8490..8e39e397d6aab263046adc1bbe5039e85b368e33 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
@@ -129,6 +129,7 @@ void InProcessWorkerObjectProxy::DidCreateWorkerGlobalScope(
timer_ = WTF::MakeUnique<TaskRunnerTimer<InProcessWorkerObjectProxy>>(
TaskRunnerHelper::Get(TaskType::kUnthrottled, global_scope), this,
&InProcessWorkerObjectProxy::CheckPendingActivity);
+ was_initialized_ = true;
}
void InProcessWorkerObjectProxy::DidEvaluateWorkerScript(bool) {
@@ -138,6 +139,7 @@ void InProcessWorkerObjectProxy::DidEvaluateWorkerScript(bool) {
void InProcessWorkerObjectProxy::WillDestroyWorkerGlobalScope() {
timer_.reset();
worker_global_scope_ = nullptr;
+ was_destroyed_ = true;
}
InProcessWorkerObjectProxy::InProcessWorkerObjectProxy(
@@ -150,6 +152,10 @@ InProcessWorkerObjectProxy::InProcessWorkerObjectProxy(
max_interval_in_sec_(kMaxIntervalInSec) {}
void InProcessWorkerObjectProxy::StartPendingActivityTimer() {
+ // TODO(nhiroki): Remove these checks after https://crbug.com/713914 is fixed.
+ CHECK(was_initialized_);
+ CHECK(!was_destroyed_);
+ CHECK(timer_);
if (timer_->IsActive()) {
// Reset the next interval duration to check new activity state timely.
// For example, a long-running activity can be cancelled by a message
« no previous file with comments | « third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698