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

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Addressed comments from kinuko and haraken 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 void ServiceWorkerGlobalScopeProxy::DispatchForeignFetchEvent( 325 void ServiceWorkerGlobalScopeProxy::DispatchForeignFetchEvent(
326 int fetch_event_id, 326 int fetch_event_id,
327 const WebServiceWorkerRequest& web_request) { 327 const WebServiceWorkerRequest& web_request) {
328 if (!OriginTrials::foreignFetchEnabled(WorkerGlobalScope())) { 328 if (!OriginTrials::foreignFetchEnabled(WorkerGlobalScope())) {
329 // If origin trial tokens have expired, or are otherwise no longer valid 329 // If origin trial tokens have expired, or are otherwise no longer valid
330 // no events should be dispatched. 330 // no events should be dispatched.
331 // TODO(mek): Ideally the browser wouldn't even start the service worker 331 // TODO(mek): Ideally the browser wouldn't even start the service worker
332 // if its tokens have expired. 332 // if its tokens have expired.
333 ServiceWorkerGlobalScopeClient::From(WorkerGlobalScope()) 333 ServiceWorkerGlobalScopeClient::From(WorkerGlobalScope())
334 ->RespondToFetchEvent(fetch_event_id, WTF::CurrentTime()); 334 ->RespondToFetchEventWithNoResponse(fetch_event_id, WTF::CurrentTime());
335 ServiceWorkerGlobalScopeClient::From(WorkerGlobalScope()) 335 ServiceWorkerGlobalScopeClient::From(WorkerGlobalScope())
336 ->DidHandleFetchEvent(fetch_event_id, 336 ->DidHandleFetchEvent(fetch_event_id,
337 kWebServiceWorkerEventResultCompleted, 337 kWebServiceWorkerEventResultCompleted,
338 WTF::CurrentTime()); 338 WTF::CurrentTime());
339 return; 339 return;
340 } 340 }
341 341
342 ScriptState::Scope scope( 342 ScriptState::Scope scope(
343 WorkerGlobalScope()->ScriptController()->GetScriptState()); 343 WorkerGlobalScope()->ScriptController()->GetScriptState());
344 RefPtr<SecurityOrigin> origin = 344 RefPtr<SecurityOrigin> origin =
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 return *document_; 598 return *document_;
599 } 599 }
600 600
601 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope() 601 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::WorkerGlobalScope()
602 const { 602 const {
603 DCHECK(worker_global_scope_); 603 DCHECK(worker_global_scope_);
604 return worker_global_scope_; 604 return worker_global_scope_;
605 } 605 }
606 606
607 } // namespace blink 607 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeClientImpl.cpp ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698