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

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

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)
Patch Set: Remove DCHECK 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 | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | 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/service_worker_fetch_dispatcher.h" 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 DCHECK(requester_info->IsRenderer()); 530 DCHECK(requester_info->IsRenderer());
531 if (!requester_info->filter()) 531 if (!requester_info->filter())
532 return false; 532 return false;
533 } 533 }
534 534
535 DCHECK(!url_loader_assets_); 535 DCHECK(!url_loader_assets_);
536 536
537 mojom::URLLoaderFactoryPtr url_loader_factory; 537 mojom::URLLoaderFactoryPtr url_loader_factory;
538 URLLoaderFactoryImpl::Create( 538 URLLoaderFactoryImpl::Create(
539 ResourceRequesterInfo::CreateForNavigationPreload(requester_info), 539 ResourceRequesterInfo::CreateForNavigationPreload(requester_info),
540 mojo::MakeRequest(&url_loader_factory)); 540 mojo::MakeRequest(&url_loader_factory),
541 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
541 542
542 ResourceRequest request; 543 ResourceRequest request;
543 request.method = original_request->method(); 544 request.method = original_request->method();
544 request.url = original_request->url(); 545 request.url = original_request->url();
545 // TODO(horo): Set first_party_for_cookies to support Same-site Cookies. 546 // TODO(horo): Set first_party_for_cookies to support Same-site Cookies.
546 request.request_initiator = original_request->initiator().has_value() 547 request.request_initiator = original_request->initiator().has_value()
547 ? original_request->initiator() 548 ? original_request->initiator()
548 : url::Origin(original_request->url()); 549 : url::Origin(original_request->url());
549 request.referrer = GURL(original_request->referrer()); 550 request.referrer = GURL(original_request->referrer());
550 request.referrer_policy = original_info->GetReferrerPolicy(); 551 request.referrer_policy = original_info->GetReferrerPolicy();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 ServiceWorkerVersion* version, 611 ServiceWorkerVersion* version,
611 int event_finish_id, 612 int event_finish_id,
612 scoped_refptr<URLLoaderAssets> url_loader_assets, 613 scoped_refptr<URLLoaderAssets> url_loader_assets,
613 ServiceWorkerStatusCode status, 614 ServiceWorkerStatusCode status,
614 base::Time dispatch_event_time) { 615 base::Time dispatch_event_time) {
615 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT, 616 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT,
616 dispatch_event_time); 617 dispatch_event_time);
617 } 618 }
618 619
619 } // namespace content 620 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698