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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: storage/browser/blob/blob_data_snapshot.cc
diff --git a/storage/browser/blob/blob_data_snapshot.cc b/storage/browser/blob/blob_data_snapshot.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6ae74cd8d3220eef0ddfea2a2b4d5e87da788fe2
--- /dev/null
+++ b/storage/browser/blob/blob_data_snapshot.cc
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "storage/browser/blob/blob_data_snapshot.h"
+
+namespace storage {
+
+BlobDataSnapshot::BlobDataSnapshot(
+ const std::string& uuid,
+ const std::string& content_type,
+ const std::string& content_disposition,
+ const std::vector<scoped_refptr<BlobDataItem>>& items)
+ : uuid_(uuid),
+ content_type_(content_type),
+ content_disposition_(content_disposition),
+ items_(items) {
+}
+
+BlobDataSnapshot::BlobDataSnapshot(const BlobDataSnapshot& other)
+ : uuid_(other.uuid_),
+ content_type_(other.content_type_),
+ content_disposition_(other.content_disposition_),
+ items_(other.items_) {
+}
+
+BlobDataSnapshot::~BlobDataSnapshot() {
+}
+
+size_t BlobDataSnapshot::GetMemoryUsage() const {
+ int64 memory = 0;
+ for (const auto& data_item : items_) {
+ if (data_item->type() == DataElement::TYPE_BYTES)
+ memory += data_item->length();
+ }
+ return memory;
+}
+
+} // namespace storage

Powered by Google App Engine
This is Rietveld 408576698