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

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

Issue 293083002: Add a blob field to ServiceWorkerFetchResponse and read the blob (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dont crash in loader Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (!web_contents) 303 if (!web_contents)
304 return; 304 return;
305 web_contents->DidGetResourceResponseStart(*details.get()); 305 web_contents->DidGetResourceResponseStart(*details.get());
306 } 306 }
307 307
308 bool IsValidatedSCT( 308 bool IsValidatedSCT(
309 const net::SignedCertificateTimestampAndStatus& sct_status) { 309 const net::SignedCertificateTimestampAndStatus& sct_status) {
310 return sct_status.status == net::ct::SCT_STATUS_OK; 310 return sct_status.status == net::ct::SCT_STATUS_OK;
311 } 311 }
312 312
313 webkit_blob::BlobStorageContext* GetBlobStorageContext(
michaeln 2014/05/23 02:23:23 might make this helper take filter_ as input since
falken 2014/05/23 11:15:46 yea that's a better, done
314 ChromeBlobStorageContext* context) {
315 if (!context)
316 return NULL;
317 return context->context();
318 }
319
313 } // namespace 320 } // namespace
314 321
315 // static 322 // static
316 ResourceDispatcherHost* ResourceDispatcherHost::Get() { 323 ResourceDispatcherHost* ResourceDispatcherHost::Get() {
317 return g_resource_dispatcher_host; 324 return g_resource_dispatcher_host;
318 } 325 }
319 326
320 ResourceDispatcherHostImpl::ResourceDispatcherHostImpl() 327 ResourceDispatcherHostImpl::ResourceDispatcherHostImpl()
321 : save_file_manager_(new SaveFileManager()), 328 : save_file_manager_(new SaveFileManager()),
322 request_id_(-1), 329 request_id_(-1),
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 SetReferrerForRequest(new_request.get(), referrer); 1050 SetReferrerForRequest(new_request.get(), referrer);
1044 1051
1045 net::HttpRequestHeaders headers; 1052 net::HttpRequestHeaders headers;
1046 headers.AddHeadersFromString(request_data.headers); 1053 headers.AddHeadersFromString(request_data.headers);
1047 new_request->SetExtraRequestHeaders(headers); 1054 new_request->SetExtraRequestHeaders(headers);
1048 1055
1049 new_request->SetLoadFlags(load_flags); 1056 new_request->SetLoadFlags(load_flags);
1050 1057
1051 // Resolve elements from request_body and prepare upload data. 1058 // Resolve elements from request_body and prepare upload data.
1052 if (request_data.request_body.get()) { 1059 if (request_data.request_body.get()) {
1053 webkit_blob::BlobStorageContext* blob_context = NULL; 1060 webkit_blob::BlobStorageContext* blob_context =
1054 if (filter_->blob_storage_context()) 1061 GetBlobStorageContext(filter_->blob_storage_context());
1055 blob_context = filter_->blob_storage_context()->context();
1056 new_request->set_upload(UploadDataStreamBuilder::Build( 1062 new_request->set_upload(UploadDataStreamBuilder::Build(
1057 request_data.request_body.get(), 1063 request_data.request_body.get(),
1058 blob_context, 1064 blob_context,
1059 filter_->file_system_context(), 1065 filter_->file_system_context(),
1060 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) 1066 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
1061 .get())); 1067 .get()));
1062 } 1068 }
1063 1069
1064 bool allow_download = request_data.allow_download && 1070 bool allow_download = request_data.allow_download &&
1065 ResourceType::IsFrame(request_data.resource_type); 1071 ResourceType::IsFrame(request_data.resource_type);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle( 1103 webkit_blob::BlobProtocolHandler::SetRequestedBlobDataHandle(
1098 new_request.get(), 1104 new_request.get(),
1099 filter_->blob_storage_context()->context()-> 1105 filter_->blob_storage_context()->context()->
1100 GetBlobDataFromPublicURL(new_request->url())); 1106 GetBlobDataFromPublicURL(new_request->url()));
1101 } 1107 }
1102 1108
1103 // Initialize the service worker handler for the request. 1109 // Initialize the service worker handler for the request.
1104 ServiceWorkerRequestHandler::InitializeHandler( 1110 ServiceWorkerRequestHandler::InitializeHandler(
1105 new_request.get(), 1111 new_request.get(),
1106 filter_->service_worker_context(), 1112 filter_->service_worker_context(),
1113 GetBlobStorageContext(filter_->blob_storage_context()),
1107 child_id, 1114 child_id,
1108 request_data.service_worker_provider_id, 1115 request_data.service_worker_provider_id,
1109 request_data.resource_type); 1116 request_data.resource_type);
1110 1117
1111 // Have the appcache associate its extra info with the request. 1118 // Have the appcache associate its extra info with the request.
1112 AppCacheInterceptor::SetExtraRequestInfo( 1119 AppCacheInterceptor::SetExtraRequestInfo(
1113 new_request.get(), filter_->appcache_service(), child_id, 1120 new_request.get(), filter_->appcache_service(), child_id,
1114 request_data.appcache_host_id, request_data.resource_type); 1121 request_data.appcache_host_id, request_data.resource_type);
1115 1122
1116 scoped_ptr<ResourceHandler> handler( 1123 scoped_ptr<ResourceHandler> handler(
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) 1979 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS)
1973 && !policy->CanReadRawCookies(child_id)) { 1980 && !policy->CanReadRawCookies(child_id)) {
1974 VLOG(1) << "Denied unauthorized request for raw headers"; 1981 VLOG(1) << "Denied unauthorized request for raw headers";
1975 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; 1982 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS;
1976 } 1983 }
1977 1984
1978 return load_flags; 1985 return load_flags;
1979 } 1986 }
1980 1987
1981 } // namespace content 1988 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698