OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "storage/browser/blob/blob_data_snapshot.h" |
| 6 |
| 7 namespace storage { |
| 8 |
| 9 BlobDataSnapshot::BlobDataSnapshot( |
| 10 const std::string& uuid, |
| 11 const std::string& content_type, |
| 12 const std::string& content_disposition, |
| 13 const std::vector<scoped_refptr<BlobDataItem>>& items) |
| 14 : uuid_(uuid), |
| 15 content_type_(content_type), |
| 16 content_disposition_(content_disposition), |
| 17 items_(items) { |
| 18 } |
| 19 |
| 20 BlobDataSnapshot::BlobDataSnapshot(const BlobDataSnapshot& other) |
| 21 : uuid_(other.uuid_), |
| 22 content_type_(other.content_type_), |
| 23 content_disposition_(other.content_disposition_), |
| 24 items_(other.items_) { |
| 25 } |
| 26 |
| 27 BlobDataSnapshot::~BlobDataSnapshot() { |
| 28 } |
| 29 |
| 30 size_t BlobDataSnapshot::GetMemoryUsage() const { |
| 31 int64 memory = 0; |
| 32 for (const auto& data_item : items_) { |
| 33 if (data_item->type() == DataElement::TYPE_BYTES) |
| 34 memory += data_item->length(); |
| 35 } |
| 36 return memory; |
| 37 } |
| 38 |
| 39 } // namespace storage |
OLD | NEW |