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

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

Issue 2417793002: Introduce FetchEventPreloadHandle to pass the preload response to FetchEvent. (Closed)
Patch Set: incorporated dchecng's comment Created 4 years, 2 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_fetch_dispatcher.cc
diff --git a/content/browser/service_worker/service_worker_fetch_dispatcher.cc b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
index f3faf3e6af73f9dcafdb91c4e69cd2bdd383b605..fefc7137f6e953a3a34b43563943dc094bab16ab 100644
--- a/content/browser/service_worker/service_worker_fetch_dispatcher.cc
+++ b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/service_worker/embedded_worker_status.h"
@@ -228,7 +229,7 @@ void ServiceWorkerFetchDispatcher::DispatchFetchEvent() {
// |dispatcher| is owned by |version_|. So it is safe to pass the unretained
// raw pointer of |version_| to OnFetchEventFinished callback.
dispatcher->DispatchFetchEvent(
- fetch_event_id, *request_,
+ fetch_event_id, *request_, std::move(preload_handle_),
base::Bind(&OnFetchEventFinished, base::Unretained(version_.get()),
event_finish_id));
}
@@ -270,6 +271,19 @@ void ServiceWorkerFetchDispatcher::Complete(
fetch_callback.Run(status, fetch_result, response, version);
}
+void ServiceWorkerFetchDispatcher::MaybeStartNavigationPreload(
+ net::URLRequest* original_request) {
+ if (resource_type_ != RESOURCE_TYPE_MAIN_FRAME &&
+ resource_type_ != RESOURCE_TYPE_SUB_FRAME) {
+ return;
+ }
+ if (!version_->navigation_preload_enabled())
+ return;
+ // TODO(horo): Implement this to start the preload request for the navigation
+ // request and set |preload_handle_|.
+ NOTIMPLEMENTED();
+}
+
ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
const {
if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)

Powered by Google App Engine
This is Rietveld 408576698