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

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

Issue 810403004: [Storage] Blob Storage Refactoring pt 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed copyright Created 5 years, 11 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698