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

Unified Diff: storage/browser/blob/blob_data_builder.h

Issue 895933007: [Storage] Blob items are now shared between blobs. Ready for disk swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and added one more histogram Created 5 years, 10 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
« no previous file with comments | « storage/browser/BUILD.gn ('k') | storage/browser/blob/blob_data_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: storage/browser/blob/blob_data_builder.h
diff --git a/storage/browser/blob/blob_data_builder.h b/storage/browser/blob/blob_data_builder.h
index 3c426406c5e129cc641983ceba0b57bd26a2e9b6..0316521de0bed0819744ae9c24293e65b6225760 100644
--- a/storage/browser/blob/blob_data_builder.h
+++ b/storage/browser/blob/blob_data_builder.h
@@ -1,15 +1,17 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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.
#ifndef STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
#define STORAGE_BROWSER_BLOB_BLOB_DATA_BUILDER_H_
+#include <stdint.h>
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/files/file_path.h"
+#include "base/memory/ref_counted.h"
#include "storage/browser/blob/blob_data_item.h"
#include "storage/browser/blob/blob_data_snapshot.h"
#include "storage/browser/storage_browser_export.h"
@@ -20,7 +22,7 @@ class BlobStorageContext;
class STORAGE_EXPORT BlobDataBuilder {
public:
explicit BlobDataBuilder(const std::string& uuid);
- virtual ~BlobDataBuilder();
+ ~BlobDataBuilder();
const std::string& uuid() const { return uuid_; }
@@ -30,21 +32,28 @@ class STORAGE_EXPORT BlobDataBuilder {
void AppendData(const char* data, size_t length);
+ // You must know the length of the file, you cannot use kuint64max to specify
+ // the whole file.
void AppendFile(const base::FilePath& file_path,
- uint64 offset,
- uint64 length,
+ uint64_t offset,
+ uint64_t length,
const base::Time& expected_modification_time);
+ // You must know the length of the file, you cannot use kuint64max to specify
+ // the whole file.
void AppendFile(const base::FilePath& file_path,
- uint64 offset,
- uint64 length,
+ uint64_t offset,
+ uint64_t length,
const base::Time& expected_modification_time,
scoped_refptr<ShareableFileReference> shareable_file);
- void AppendBlob(const std::string& uuid, uint64 offset, uint64 length);
+ void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length);
+
+ void AppendBlob(const std::string& uuid);
+
void AppendFileSystemFile(const GURL& url,
- uint64 offset,
- uint64 length,
+ uint64_t offset,
+ uint64_t length,
const base::Time& expected_modification_time);
void set_content_type(const std::string& content_type) {
@@ -55,10 +64,6 @@ class STORAGE_EXPORT BlobDataBuilder {
content_disposition_ = content_disposition;
}
- size_t GetMemoryUsage() const;
-
- scoped_ptr<BlobDataSnapshot> BuildSnapshot();
-
private:
friend class BlobStorageContext;
friend bool operator==(const BlobDataBuilder& a, const BlobDataBuilder& b);
@@ -98,9 +103,8 @@ inline bool operator==(const BlobDataSnapshot& a, const BlobDataBuilder& b) {
return false;
}
for (size_t i = 0; i < a.items().size(); ++i) {
- if (*(a.items()[i]) != *(b.items_[i])) {
+ if (*(a.items()[i]) != *(b.items_[i]))
return false;
- }
}
return true;
}
« no previous file with comments | « storage/browser/BUILD.gn ('k') | storage/browser/blob/blob_data_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698