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

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

Issue 2448353002: [BlobAsync] Moving async handling into BlobStorageContext & quota out. (Closed)
Patch Set: comments 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 | « storage/browser/blob/blob_data_builder.h ('k') | storage/browser/blob/blob_data_handle.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 (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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 uint64_t BlobDataBuilder::GetFutureFileID(const DataElement& element) { 50 uint64_t BlobDataBuilder::GetFutureFileID(const DataElement& element) {
51 DCHECK(IsFutureFileItem(element)); 51 DCHECK(IsFutureFileItem(element));
52 uint64_t id = 0; 52 uint64_t id = 0;
53 bool success = 53 bool success =
54 base::StringToUint64(element.path().Extension().substr(1), &id); 54 base::StringToUint64(element.path().Extension().substr(1), &id);
55 DCHECK(success) << element.path().Extension(); 55 DCHECK(success) << element.path().Extension();
56 return id; 56 return id;
57 } 57 }
58 58
59 BlobDataBuilder::BlobDataBuilder(const std::string& uuid) : uuid_(uuid) {} 59 BlobDataBuilder::BlobDataBuilder(const std::string& uuid) : uuid_(uuid) {}
60
61 BlobDataBuilder::BlobDataBuilder(BlobDataBuilder&&) = default;
62 BlobDataBuilder& BlobDataBuilder::operator=(BlobDataBuilder&&) = default;
60 BlobDataBuilder::~BlobDataBuilder() {} 63 BlobDataBuilder::~BlobDataBuilder() {}
61 64
62 void BlobDataBuilder::AppendIPCDataElement(const DataElement& ipc_data) { 65 void BlobDataBuilder::AppendIPCDataElement(const DataElement& ipc_data) {
63 uint64_t length = ipc_data.length(); 66 uint64_t length = ipc_data.length();
64 switch (ipc_data.type()) { 67 switch (ipc_data.type()) {
65 case DataElement::TYPE_BYTES: 68 case DataElement::TYPE_BYTES:
66 DCHECK(!ipc_data.offset()); 69 DCHECK(!ipc_data.offset());
67 AppendData(ipc_data.bytes(), 70 AppendData(ipc_data.bytes(),
68 base::checked_cast<size_t>(length)); 71 base::checked_cast<size_t>(length));
69 break; 72 break;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 << ", content_type: " << x.content_type_ 250 << ", content_type: " << x.content_type_
248 << ", content_disposition: " << x.content_disposition_ << ", items: ["; 251 << ", content_disposition: " << x.content_disposition_ << ", items: [";
249 for (const auto& item : x.items_) { 252 for (const auto& item : x.items_) {
250 PrintTo(*item, os); 253 PrintTo(*item, os);
251 *os << ", "; 254 *os << ", ";
252 } 255 }
253 *os << "]}"; 256 *os << "]}";
254 } 257 }
255 258
256 } // namespace storage 259 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/blob/blob_data_builder.h ('k') | storage/browser/blob/blob_data_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698