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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include "storage/browser/blob/blob_data_snapshot.h" | 8 #include "storage/browser/blob/blob_data_snapshot.h" |
9 | 9 |
10 namespace storage { | 10 namespace storage { |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 size_t BlobDataSnapshot::GetMemoryUsage() const { | 41 size_t BlobDataSnapshot::GetMemoryUsage() const { |
42 int64_t memory = 0; | 42 int64_t memory = 0; |
43 for (const auto& data_item : items_) { | 43 for (const auto& data_item : items_) { |
44 if (data_item->type() == DataElement::TYPE_BYTES) | 44 if (data_item->type() == DataElement::TYPE_BYTES) |
45 memory += data_item->length(); | 45 memory += data_item->length(); |
46 } | 46 } |
47 return memory; | 47 return memory; |
48 } | 48 } |
49 | 49 |
| 50 void PrintTo(const BlobDataSnapshot& x, std::ostream* os) { |
| 51 DCHECK(os); |
| 52 *os << "<BlobDataSnapshot>{uuid: " << x.uuid() |
| 53 << ", content_type: " << x.content_type_ |
| 54 << ", content_disposition: " << x.content_disposition_ << ", items: ["; |
| 55 for (const auto& item : x.items_) { |
| 56 PrintTo(*item, os); |
| 57 *os << ", "; |
| 58 } |
| 59 *os << "]}"; |
| 60 } |
| 61 |
50 } // namespace storage | 62 } // namespace storage |
OLD | NEW |