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

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

Issue 1675613002: service worker: use 200 OK for update requests even in the no update case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 d8adcd4bebfad0863fa1f27f4d75284a0bc39e91..53fd237b64f1f5097b778398f46651c69b9f2b1d 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -327,6 +327,11 @@ class EmbeddedWorkerInstance::StartTask {
DISALLOW_COPY_AND_ASSIGN(StartTask);
};
+bool EmbeddedWorkerInstance::Listener::OnMessageReceived(
+ const IPC::Message& message) {
+ return false;
+}
+
EmbeddedWorkerInstance::~EmbeddedWorkerInstance() {
DCHECK(status_ == STOPPING || status_ == STOPPED) << status_;
devtools_proxy_.reset();
@@ -338,7 +343,8 @@ EmbeddedWorkerInstance::~EmbeddedWorkerInstance() {
void EmbeddedWorkerInstance::Start(int64_t service_worker_version_id,
const GURL& scope,
const GURL& script_url,
- const StatusCallback& callback) {
+ const StatusCallback& callback,
+ bool pause_after_download) {
if (!context_) {
callback.Run(SERVICE_WORKER_ERROR_ABORT);
// |this| may be destroyed by the callback.
@@ -364,6 +370,7 @@ void EmbeddedWorkerInstance::Start(int64_t service_worker_version_id,
params->script_url = script_url;
params->worker_devtools_agent_route_id = MSG_ROUTING_NONE;
params->wait_for_debugger = false;
+ params->pause_after_download = pause_after_download;
params->v8_cache_options = GetV8CacheOptions();
inflight_start_task_.reset(new StartTask(this));
@@ -411,6 +418,13 @@ ServiceWorkerStatusCode EmbeddedWorkerInstance::SendMessage(
thread_id_, embedded_worker_id_, message));
}
+void EmbeddedWorkerInstance::ResumeAfterDownload() {
+ if (process_id() == ChildProcessHost::kInvalidUniqueID)
nhiroki 2016/02/10 04:56:14 We may also need to check |status_| like this: if
falken 2016/02/10 05:40:40 Good catch. Done.
+ return;
+ registry_->Send(process_id(), new EmbeddedWorkerMsg_ResumeAfterDownload(
+ embedded_worker_id_));
+}
+
ServiceRegistry* EmbeddedWorkerInstance::GetServiceRegistry() {
DCHECK(status_ == STARTING || status_ == RUNNING) << status_;
return service_registry_.get();

Powered by Google App Engine
This is Rietveld 408576698