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

Side by Side Diff: storage/browser/blob/blob_data_builder.cc

Issue 1108083002: Create blobs from Disk Cache entries. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first pass michaeln remediation... Created 5 years, 6 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "storage/browser/blob/blob_data_builder.h" 5 #include "storage/browser/blob/blob_data_builder.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "storage/browser/blob/shareable_file_reference.h" 8 #include "storage/browser/blob/shareable_file_reference.h"
9 9
10 namespace storage { 10 namespace storage {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 uint64_t offset, 53 uint64_t offset,
54 uint64_t length, 54 uint64_t length,
55 const base::Time& expected_modification_time) { 55 const base::Time& expected_modification_time) {
56 DCHECK(length > 0); 56 DCHECK(length > 0);
57 scoped_ptr<DataElement> element(new DataElement()); 57 scoped_ptr<DataElement> element(new DataElement());
58 element->SetToFileSystemUrlRange(url, offset, length, 58 element->SetToFileSystemUrlRange(url, offset, length,
59 expected_modification_time); 59 expected_modification_time);
60 items_.push_back(new BlobDataItem(element.Pass())); 60 items_.push_back(new BlobDataItem(element.Pass()));
61 } 61 }
62 62
63 void BlobDataBuilder::AppendDiskCacheEntry(
64 const scoped_refptr<DataHandle>& data_handle,
65 disk_cache::Entry* disk_cache_entry,
66 int disk_cache_stream_index) {
67 scoped_ptr<DataElement> element(new DataElement());
68 element->SetToDiskCacheEntryRange(
69 0U, disk_cache_entry->GetDataSize(disk_cache_stream_index));
70 items_.push_back(
71 new BlobDataItem(element.Pass(), data_handle, disk_cache_entry,
72 disk_cache_stream_index));
73 }
74
63 } // namespace storage 75 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698