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

Side by Side Diff: content/browser/loader/resource_requester_info.cc

Issue 2498193003: [WIP not ready for review] ServiceWorker Download support.
Patch Set: rebase Created 4 years, 1 month 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/loader/resource_requester_info.h ('k') | content/common/frame_messages.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 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"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ResourceRequesterInfo::CreateForBrowserSideNavigation( 85 ResourceRequesterInfo::CreateForBrowserSideNavigation(
86 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) { 86 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) {
87 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( 87 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo(
88 RequesterType::BROWSER_SIDE_NAVIGATION, -1, 88 RequesterType::BROWSER_SIDE_NAVIGATION, -1,
89 nullptr /* appcache_service */, nullptr /* blob_storage_context */, 89 nullptr /* appcache_service */, nullptr /* blob_storage_context */,
90 nullptr /* file_system_context */, service_worker_context.get(), 90 nullptr /* file_system_context */, service_worker_context.get(),
91 GetContextsCallback())); 91 GetContextsCallback()));
92 } 92 }
93 93
94 scoped_refptr<ResourceRequesterInfo> 94 scoped_refptr<ResourceRequesterInfo>
95 ResourceRequesterInfo::CreateForDownloadOrPageSave(int child_id) { 95 ResourceRequesterInfo::CreateForDownloadOrPageSave(
96 int child_id,
97 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) {
96 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( 98 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo(
97 RequesterType::DOWNLOAD_OR_PAGE_SAVE, child_id, 99 RequesterType::DOWNLOAD_OR_PAGE_SAVE, child_id,
98 nullptr /* appcache_service */, nullptr /* blob_storage_context */, 100 nullptr /* appcache_service */, nullptr /* blob_storage_context */,
99 nullptr /* file_system_context */, nullptr /*service_worker_context */, 101 nullptr /* file_system_context */, service_worker_context.get(),
100 GetContextsCallback())); 102 GetContextsCallback()));
101 } 103 }
102 104
103 scoped_refptr<ResourceRequesterInfo> 105 scoped_refptr<ResourceRequesterInfo>
104 ResourceRequesterInfo::CreateForNavigationPreload( 106 ResourceRequesterInfo::CreateForNavigationPreload(
105 const ResourceRequesterInfo& original_request_info) { 107 const ResourceRequesterInfo& original_request_info) {
106 if (IsBrowserSideNavigationEnabled()) 108 if (IsBrowserSideNavigationEnabled())
107 DCHECK(original_request_info.IsBrowserSideNavigation()); 109 DCHECK(original_request_info.IsBrowserSideNavigation());
108 else 110 else
109 DCHECK(original_request_info.IsRenderer()); 111 DCHECK(original_request_info.IsRenderer());
110 DCHECK(original_request_info.service_worker_context()); 112 DCHECK(original_request_info.service_worker_context());
111 113
112 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo( 114 return scoped_refptr<ResourceRequesterInfo>(new ResourceRequesterInfo(
113 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */, 115 RequesterType::NAVIGATION_PRELOAD, -1, nullptr /* appcache_service */,
114 nullptr /* blob_storage_context */, nullptr /* file_system_context */, 116 nullptr /* blob_storage_context */, nullptr /* file_system_context */,
115 original_request_info.service_worker_context(), 117 original_request_info.service_worker_context(),
116 base::Bind(&GetContextsCallbackForNavigationPreload, 118 base::Bind(&GetContextsCallbackForNavigationPreload,
117 scoped_refptr<ServiceWorkerContextWrapper>( 119 scoped_refptr<ServiceWorkerContextWrapper>(
118 original_request_info.service_worker_context())))); 120 original_request_info.service_worker_context()))));
119 } 121 }
120 122
121 } // namespace content 123 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_requester_info.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698