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

Side by Side Diff: content/browser/loader/resource_requester_info.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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/loader/resource_requester_info.h" 5 #include "content/browser/loader/resource_requester_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/browser/appcache/chrome_appcache_service.h" 9 #include "content/browser/appcache/chrome_appcache_service.h"
10 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 10 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
11 #include "content/browser/service_worker/service_worker_context_wrapper.h" 11 #include "content/browser/service_worker/service_worker_context_wrapper.h"
12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/browser/resource_context.h" 12 #include "content/public/browser/resource_context.h"
14 #include "content/public/common/browser_side_navigation_policy.h" 13 #include "content/public/common/browser_side_navigation_policy.h"
15 #include "storage/browser/fileapi/file_system_context.h" 14 #include "storage/browser/fileapi/file_system_context.h"
16 15
17 namespace content { 16 namespace content {
18 17
19 namespace { 18 namespace {
20 19
21 void GetContextsCallbackForNavigationPreload( 20 void GetContextsCallbackForNavigationPreload(
22 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, 21 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
(...skipping 19 matching lines...) Expand all
42 appcache_service_(appcache_service), 41 appcache_service_(appcache_service),
43 blob_storage_context_(blob_storage_context), 42 blob_storage_context_(blob_storage_context),
44 file_system_context_(file_system_context), 43 file_system_context_(file_system_context),
45 service_worker_context_(service_worker_context), 44 service_worker_context_(service_worker_context),
46 get_contexts_callback_(get_contexts_callback) {} 45 get_contexts_callback_(get_contexts_callback) {}
47 46
48 ResourceRequesterInfo::~ResourceRequesterInfo() {} 47 ResourceRequesterInfo::~ResourceRequesterInfo() {}
49 48
50 void ResourceRequesterInfo::set_filter( 49 void ResourceRequesterInfo::set_filter(
51 base::WeakPtr<ResourceMessageFilter> filter) { 50 base::WeakPtr<ResourceMessageFilter> filter) {
52 DCHECK_CURRENTLY_ON(BrowserThread::IO);
53 DCHECK_EQ(RequesterType::RENDERER, type_); 51 DCHECK_EQ(RequesterType::RENDERER, type_);
54 filter_ = filter; 52 filter_ = filter;
55 } 53 }
56 54
57 void ResourceRequesterInfo::GetContexts( 55 void ResourceRequesterInfo::GetContexts(
58 ResourceType resource_type, 56 ResourceType resource_type,
59 ResourceContext** resource_context, 57 ResourceContext** resource_context,
60 net::URLRequestContext** request_context) const { 58 net::URLRequestContext** request_context) const {
61 get_contexts_callback_.Run(resource_type, resource_context, request_context); 59 get_contexts_callback_.Run(resource_type, resource_context, request_context);
62 } 60 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 DCHECK(get_contexts_callback); 119 DCHECK(get_contexts_callback);
122 } 120 }
123 121
124 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( 122 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo(
125 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */, 123 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */,
126 nullptr /* blob_storage_context */, nullptr /* file_system_context */, 124 nullptr /* blob_storage_context */, nullptr /* file_system_context */,
127 original_request_info->service_worker_context(), get_contexts_callback)); 125 original_request_info->service_worker_context(), get_contexts_callback));
128 } 126 }
129 127
130 } // namespace content 128 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_message_filter.cc ('k') | content/browser/loader/url_loader_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698