| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 BlobDataBuilder::BlobDataBuilder(const std::string& uuid) : uuid_(uuid) {} | 59 BlobDataBuilder::BlobDataBuilder(const std::string& uuid) : uuid_(uuid) {} |
| 60 BlobDataBuilder::~BlobDataBuilder() {} | 60 BlobDataBuilder::~BlobDataBuilder() {} |
| 61 | 61 |
| 62 void BlobDataBuilder::AppendIPCDataElement(const DataElement& ipc_data) { | 62 void BlobDataBuilder::AppendIPCDataElement(const DataElement& ipc_data) { |
| 63 uint64_t length = ipc_data.length(); | 63 uint64_t length = ipc_data.length(); |
| 64 switch (ipc_data.type()) { | 64 switch (ipc_data.type()) { |
| 65 case DataElement::TYPE_BYTES: | 65 case DataElement::TYPE_BYTES: |
| 66 DCHECK(!ipc_data.offset()); | 66 DCHECK(!ipc_data.offset()); |
| 67 AppendData(ipc_data.bytes(), | 67 AppendData(ipc_data.bytes(), |
| 68 base::checked_cast<size_t, uint64_t>(length)); | 68 base::checked_cast<size_t>(length)); |
| 69 break; | 69 break; |
| 70 case DataElement::TYPE_FILE: | 70 case DataElement::TYPE_FILE: |
| 71 AppendFile(ipc_data.path(), ipc_data.offset(), length, | 71 AppendFile(ipc_data.path(), ipc_data.offset(), length, |
| 72 ipc_data.expected_modification_time()); | 72 ipc_data.expected_modification_time()); |
| 73 break; | 73 break; |
| 74 case DataElement::TYPE_FILE_FILESYSTEM: | 74 case DataElement::TYPE_FILE_FILESYSTEM: |
| 75 AppendFileSystemFile(ipc_data.filesystem_url(), ipc_data.offset(), length, | 75 AppendFileSystemFile(ipc_data.filesystem_url(), ipc_data.offset(), length, |
| 76 ipc_data.expected_modification_time()); | 76 ipc_data.expected_modification_time()); |
| 77 break; | 77 break; |
| 78 case DataElement::TYPE_BLOB: | 78 case DataElement::TYPE_BLOB: |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 << ", content_type: " << x.content_type_ | 247 << ", content_type: " << x.content_type_ |
| 248 << ", content_disposition: " << x.content_disposition_ << ", items: ["; | 248 << ", content_disposition: " << x.content_disposition_ << ", items: ["; |
| 249 for (const auto& item : x.items_) { | 249 for (const auto& item : x.items_) { |
| 250 PrintTo(*item, os); | 250 PrintTo(*item, os); |
| 251 *os << ", "; | 251 *os << ", "; |
| 252 } | 252 } |
| 253 *os << "]}"; | 253 *os << "]}"; |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace storage | 256 } // namespace storage |
| OLD | NEW |