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

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

Issue 493373002: ServiceWorker: Add prepare_callback in DispatchFetchEvent to notify the end of SW preparation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate the reviewers comment Created 6 years, 4 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/service_worker_url_request_job.cc
diff --git a/content/browser/service_worker/service_worker_url_request_job.cc b/content/browser/service_worker/service_worker_url_request_job.cc
index 6a795d630de276a655d8a46490ff576385bed64f..29496ad3f9b04286b5c5cb7150cd3ce1ac93f549 100644
--- a/content/browser/service_worker/service_worker_url_request_job.cc
+++ b/content/browser/service_worker/service_worker_url_request_job.cc
@@ -229,6 +229,8 @@ void ServiceWorkerURLRequestJob::StartRequest() {
fetch_dispatcher_.reset(new ServiceWorkerFetchDispatcher(
CreateFetchRequest(),
provider_host_->active_version(),
+ base::Bind(&ServiceWorkerURLRequestJob::DidPrepareFetchEvent,
+ weak_factory_.GetWeakPtr()),
base::Bind(&ServiceWorkerURLRequestJob::DidDispatchFetchEvent,
weak_factory_.GetWeakPtr())));
fetch_dispatcher_->Run();
@@ -322,6 +324,11 @@ bool ServiceWorkerURLRequestJob::CreateRequestBodyBlob(std::string* blob_uuid,
return true;
}
+void ServiceWorkerURLRequestJob::DidPrepareFetchEvent() {
+ // TODO(shimazu): Set the timestamp to measure the time to launch SW
+ // This is related to this (http://crbug.com/401389)
+}
+
void ServiceWorkerURLRequestJob::DidDispatchFetchEvent(
ServiceWorkerStatusCode status,
ServiceWorkerFetchEventResult fetch_result,

Powered by Google App Engine
This is Rietveld 408576698