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

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 2684533002: [WIP] Mojofy respondwith
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_fetch_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/embedded_worker_test_helper.h" 5 #include "content/browser/service_worker/embedded_worker_test_helper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 void DispatchBackgroundFetchedEvent( 190 void DispatchBackgroundFetchedEvent(
191 const std::string& tag, 191 const std::string& tag,
192 const std::vector<BackgroundFetchSettledFetch>& fetches, 192 const std::vector<BackgroundFetchSettledFetch>& fetches,
193 const DispatchBackgroundFetchedEventCallback& callback) override { 193 const DispatchBackgroundFetchedEventCallback& callback) override {
194 if (!helper_) 194 if (!helper_)
195 return; 195 return;
196 helper_->OnBackgroundFetchedEventStub(tag, fetches, callback); 196 helper_->OnBackgroundFetchedEventStub(tag, fetches, callback);
197 } 197 }
198 198
199 void DispatchFetchEvent(int fetch_event_id, 199 void DispatchFetchEvent(
200 const ServiceWorkerFetchRequest& request, 200 int fetch_event_id,
201 mojom::FetchEventPreloadHandlePtr preload_handle, 201 const ServiceWorkerFetchRequest& request,
202 const DispatchFetchEventCallback& callback) override { 202 mojom::FetchEventPreloadHandlePtr preload_handle,
203 mojom::ServiceWorkerFetchResponseReceiverPtr response_receiver,
204 const DispatchFetchEventCallback& callback) override {
203 if (!helper_) 205 if (!helper_)
204 return; 206 return;
205 helper_->OnFetchEventStub(thread_id_, fetch_event_id, request, 207 helper_->OnFetchEventStub(thread_id_, fetch_event_id, request,
206 std::move(preload_handle), callback); 208 std::move(preload_handle), callback);
207 } 209 }
208 210
209 void DispatchNotificationClickEvent( 211 void DispatchNotificationClickEvent(
210 const std::string& notification_id, 212 const std::string& notification_id,
211 const PlatformNotificationData& notification_data, 213 const PlatformNotificationData& notification_data,
212 int action_index, 214 int action_index,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 } 474 }
473 475
474 void EmbeddedWorkerTestHelper::OnFetchEvent( 476 void EmbeddedWorkerTestHelper::OnFetchEvent(
475 int embedded_worker_id, 477 int embedded_worker_id,
476 int fetch_event_id, 478 int fetch_event_id,
477 const ServiceWorkerFetchRequest& request, 479 const ServiceWorkerFetchRequest& request,
478 mojom::FetchEventPreloadHandlePtr preload_handle, 480 mojom::FetchEventPreloadHandlePtr preload_handle,
479 const FetchCallback& callback) { 481 const FetchCallback& callback) {
480 SimulateSend(new ServiceWorkerHostMsg_FetchEventResponse( 482 SimulateSend(new ServiceWorkerHostMsg_FetchEventResponse(
481 embedded_worker_id, fetch_event_id, 483 embedded_worker_id, fetch_event_id,
482 SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE,
483 ServiceWorkerResponse( 484 ServiceWorkerResponse(
484 base::MakeUnique<std::vector<GURL>>(), 200, "OK", 485 base::MakeUnique<std::vector<GURL>>(), 200, "OK",
485 blink::WebServiceWorkerResponseTypeDefault, 486 blink::WebServiceWorkerResponseTypeDefault,
486 base::MakeUnique<ServiceWorkerHeaderMap>(), std::string(), 0, GURL(), 487 base::MakeUnique<ServiceWorkerHeaderMap>(), std::string(), 0, GURL(),
487 blink::WebServiceWorkerResponseErrorUnknown, base::Time(), 488 blink::WebServiceWorkerResponseErrorUnknown, base::Time(),
488 false /* is_in_cache_storage */, 489 false /* is_in_cache_storage */,
489 std::string() /* cache_storage_cache_name */, 490 std::string() /* cache_storage_cache_name */,
490 base::MakeUnique< 491 base::MakeUnique<
491 ServiceWorkerHeaderList>() /* cors_exposed_header_names */), 492 ServiceWorkerHeaderList>() /* cors_exposed_header_names */),
492 base::Time::Now())); 493 base::Time::Now()));
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 base::Passed(std::move(app_request)), 768 base::Passed(std::move(app_request)),
768 base::Passed(std::move(response_callback)), callback)); 769 base::Passed(std::move(response_callback)), callback));
769 } 770 }
770 771
771 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() { 772 EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
772 DCHECK(context()); 773 DCHECK(context());
773 return context()->embedded_worker_registry(); 774 return context()->embedded_worker_registry();
774 } 775 }
775 776
776 } // namespace content 777 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_fetch_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698