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

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: asan and fix win compile? 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 4afc83be0c0b62684b41939fa502c00310ddbd93..6811d2c45833def7269dea33bf2c36ac26945f8f 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -328,6 +328,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();
@@ -339,7 +344,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.
@@ -365,6 +371,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));
@@ -412,6 +419,13 @@ ServiceWorkerStatusCode EmbeddedWorkerInstance::SendMessage(
thread_id_, embedded_worker_id_, message));
}
+void EmbeddedWorkerInstance::ResumeAfterDownload() {
+ if (process_id() == ChildProcessHost::kInvalidUniqueID || status_ != STARTING)
+ 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