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

Unified Diff: content/browser/service_worker/embedded_worker_instance.cc

Issue 2703153002: ServiceWorker: ignore AddMessageToConsole before process allocation (Closed)
Patch Set: Created 3 years, 10 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
Index: content/browser/service_worker/embedded_worker_instance.cc
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc
index 4aed03ff82a51cd65a2e7578bda5e9b24fe9a98b..6908f83fe432d91a0826b19db2430b32c2814868 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -871,8 +871,11 @@ base::TimeDelta EmbeddedWorkerInstance::UpdateStepTime() {
void EmbeddedWorkerInstance::AddMessageToConsole(
blink::WebConsoleMessage::Level level,
const std::string& message) {
- if (status_ != EmbeddedWorkerStatus::RUNNING &&
- status_ != EmbeddedWorkerStatus::STARTING) {
+ // Return if EmbeddedWorkerInstance does not have a valid process.
+ if (status() == EmbeddedWorkerStatus::STOPPING ||
+ status() == EmbeddedWorkerStatus::STOPPED ||
+ (status() == EmbeddedWorkerStatus::STARTING &&
+ !HasSentStartWorker(starting_phase()))) {
falken 2017/02/20 08:01:03 can we turn this into a switch statement?
falken 2017/02/20 08:14:45 On second thought, would it be better to just do (
shimazu 2017/02/21 03:13:53 |client_| is valid just after calling Start(), so
shimazu 2017/02/21 03:13:53 Done.
return;
}
DCHECK(client_.is_bound());

Powered by Google App Engine
This is Rietveld 408576698