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

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

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BUILD.gn file changes Created 5 years, 11 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 (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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 #include "net/cookies/cookie_monster.h" 87 #include "net/cookies/cookie_monster.h"
88 #include "net/http/http_response_headers.h" 88 #include "net/http/http_response_headers.h"
89 #include "net/http/http_response_info.h" 89 #include "net/http/http_response_info.h"
90 #include "net/ssl/ssl_cert_request_info.h" 90 #include "net/ssl/ssl_cert_request_info.h"
91 #include "net/url_request/url_request.h" 91 #include "net/url_request/url_request.h"
92 #include "net/url_request/url_request_context.h" 92 #include "net/url_request/url_request_context.h"
93 #include "net/url_request/url_request_job_factory.h" 93 #include "net/url_request/url_request_job_factory.h"
94 #include "storage/browser/blob/blob_data_handle.h" 94 #include "storage/browser/blob/blob_data_handle.h"
95 #include "storage/browser/blob/blob_storage_context.h" 95 #include "storage/browser/blob/blob_storage_context.h"
96 #include "storage/browser/blob/blob_url_request_job_factory.h" 96 #include "storage/browser/blob/blob_url_request_job_factory.h"
97 #include "storage/browser/blob/shareable_file_reference.h"
97 #include "storage/browser/fileapi/file_permission_policy.h" 98 #include "storage/browser/fileapi/file_permission_policy.h"
98 #include "storage/browser/fileapi/file_system_context.h" 99 #include "storage/browser/fileapi/file_system_context.h"
99 #include "storage/common/blob/blob_data.h"
100 #include "storage/common/blob/shareable_file_reference.h"
101 #include "url/url_constants.h" 100 #include "url/url_constants.h"
102 101
103 using base::Time; 102 using base::Time;
104 using base::TimeDelta; 103 using base::TimeDelta;
105 using base::TimeTicks; 104 using base::TimeTicks;
106 using storage::ShareableFileReference; 105 using storage::ShareableFileReference;
107 106
108 // ---------------------------------------------------------------------------- 107 // ----------------------------------------------------------------------------
109 108
110 namespace content { 109 namespace content {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 371
373 storage::BlobStorageContext* GetBlobStorageContext( 372 storage::BlobStorageContext* GetBlobStorageContext(
374 ChromeBlobStorageContext* blob_storage_context) { 373 ChromeBlobStorageContext* blob_storage_context) {
375 if (!blob_storage_context) 374 if (!blob_storage_context)
376 return NULL; 375 return NULL;
377 return blob_storage_context->context(); 376 return blob_storage_context->context();
378 } 377 }
379 378
380 void AttachRequestBodyBlobDataHandles( 379 void AttachRequestBodyBlobDataHandles(
381 ResourceRequestBody* body, 380 ResourceRequestBody* body,
382 storage::BlobStorageContext* blob_context) { 381 storage::BlobStorageContext* blob_context) {
mmenke 2015/01/22 00:04:47 Is this still needed, now that you're attaching th
dmurph 2015/01/22 00:18:29 Yes. The Handle and Snapshot are two different th
383 DCHECK(blob_context); 382 DCHECK(blob_context);
384 for (size_t i = 0; i < body->elements()->size(); ++i) { 383 for (size_t i = 0; i < body->elements()->size(); ++i) {
385 const ResourceRequestBody::Element& element = (*body->elements())[i]; 384 const ResourceRequestBody::Element& element = (*body->elements())[i];
386 if (element.type() != ResourceRequestBody::Element::TYPE_BLOB) 385 if (element.type() != ResourceRequestBody::Element::TYPE_BLOB)
387 continue; 386 continue;
388 scoped_ptr<storage::BlobDataHandle> handle = 387 scoped_ptr<storage::BlobDataHandle> handle =
389 blob_context->GetBlobDataFromUUID(element.blob_uuid()); 388 blob_context->GetBlobDataFromUUID(element.blob_uuid());
390 DCHECK(handle); 389 DCHECK(handle);
391 if (!handle) 390 if (!handle)
392 continue; 391 continue;
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 2367
2369 // Add a flag to selectively bypass the data reduction proxy if the resource 2368 // Add a flag to selectively bypass the data reduction proxy if the resource
2370 // type is not an image. 2369 // type is not an image.
2371 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) 2370 if (request_data.resource_type != RESOURCE_TYPE_IMAGE)
2372 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; 2371 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY;
2373 2372
2374 return load_flags; 2373 return load_flags;
2375 } 2374 }
2376 2375
2377 } // namespace content 2376 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698