Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/loader/loader_globals.h" | |
| 11 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 12 #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" | 13 #include "content/public/browser/resource_context.h" |
| 14 #include "content/public/common/browser_side_navigation_policy.h" | 14 #include "content/public/common/browser_side_navigation_policy.h" |
| 15 #include "storage/browser/fileapi/file_system_context.h" | 15 #include "storage/browser/fileapi/file_system_context.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 void GetContextsCallbackForNavigationPreload( | 21 void GetContextsCallbackForNavigationPreload( |
| 22 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, | 22 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context, |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 42 appcache_service_(appcache_service), | 42 appcache_service_(appcache_service), |
| 43 blob_storage_context_(blob_storage_context), | 43 blob_storage_context_(blob_storage_context), |
| 44 file_system_context_(file_system_context), | 44 file_system_context_(file_system_context), |
| 45 service_worker_context_(service_worker_context), | 45 service_worker_context_(service_worker_context), |
| 46 get_contexts_callback_(get_contexts_callback) {} | 46 get_contexts_callback_(get_contexts_callback) {} |
| 47 | 47 |
| 48 ResourceRequesterInfo::~ResourceRequesterInfo() {} | 48 ResourceRequesterInfo::~ResourceRequesterInfo() {} |
| 49 | 49 |
| 50 void ResourceRequesterInfo::set_filter( | 50 void ResourceRequesterInfo::set_filter( |
| 51 base::WeakPtr<ResourceMessageFilter> filter) { | 51 base::WeakPtr<ResourceMessageFilter> filter) { |
| 52 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 52 DCHECK( |
| 53 LoaderGlobals::Get()->io_thread_task_runner()->BelongsToCurrentThread()); | |
|
jam
2017/03/29 15:44:33
i think we can take this out, there's one caller i
ananta
2017/03/29 19:41:04
Done.
| |
| 53 DCHECK_EQ(RequesterType::RENDERER, type_); | 54 DCHECK_EQ(RequesterType::RENDERER, type_); |
| 54 filter_ = filter; | 55 filter_ = filter; |
| 55 } | 56 } |
| 56 | 57 |
| 57 void ResourceRequesterInfo::GetContexts( | 58 void ResourceRequesterInfo::GetContexts( |
| 58 ResourceType resource_type, | 59 ResourceType resource_type, |
| 59 ResourceContext** resource_context, | 60 ResourceContext** resource_context, |
| 60 net::URLRequestContext** request_context) const { | 61 net::URLRequestContext** request_context) const { |
| 61 get_contexts_callback_.Run(resource_type, resource_context, request_context); | 62 get_contexts_callback_.Run(resource_type, resource_context, request_context); |
| 62 } | 63 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 DCHECK(get_contexts_callback); | 122 DCHECK(get_contexts_callback); |
| 122 } | 123 } |
| 123 | 124 |
| 124 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( | 125 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( |
| 125 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */, | 126 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */, |
| 126 nullptr /* blob_storage_context */, nullptr /* file_system_context */, | 127 nullptr /* blob_storage_context */, nullptr /* file_system_context */, |
| 127 original_request_info->service_worker_context(), get_contexts_callback)); | 128 original_request_info->service_worker_context(), get_contexts_callback)); |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace content | 131 } // namespace content |
| OLD | NEW |