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

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.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/embedded_worker_test_helper.cc
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc
index aceb858a1a7b02507c24ab1a7732445a489543fb..ee6ef82519cc63b69f6e020e6f7a86098b62b3a2 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -166,10 +166,12 @@ class EmbeddedWorkerTestHelper::MockFetchEventDispatcher
void DispatchFetchEvent(int fetch_event_id,
const ServiceWorkerFetchRequest& request,
+ mojom::FetchEventPreloadHandlePtr preload_handle,
const DispatchFetchEventCallback& callback) override {
if (!helper_)
return;
- helper_->OnFetchEventStub(thread_id_, fetch_event_id, request, callback);
+ helper_->OnFetchEventStub(thread_id_, fetch_event_id, request,
+ std::move(preload_handle), callback);
}
private:
@@ -337,6 +339,7 @@ void EmbeddedWorkerTestHelper::OnFetchEvent(
int embedded_worker_id,
int fetch_event_id,
const ServiceWorkerFetchRequest& request,
+ mojom::FetchEventPreloadHandlePtr preload_handle,
const FetchCallback& callback) {
SimulateSend(new ServiceWorkerHostMsg_FetchEventResponse(
embedded_worker_id, fetch_event_id,
@@ -498,12 +501,13 @@ void EmbeddedWorkerTestHelper::OnFetchEventStub(
int thread_id,
int fetch_event_id,
const ServiceWorkerFetchRequest& request,
+ mojom::FetchEventPreloadHandlePtr preload_handle,
const FetchCallback& callback) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&EmbeddedWorkerTestHelper::OnFetchEvent, AsWeakPtr(),
thread_id_embedded_worker_id_map_[thread_id], fetch_event_id,
- request, callback));
+ request, base::Passed(&preload_handle), callback));
}
void EmbeddedWorkerTestHelper::OnPushEventStub(

Powered by Google App Engine
This is Rietveld 408576698