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

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

Issue 1098853003: [BlobAsync] Patch 4: Browser Classes & Logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed duplicate invalid test Created 5 years 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/blob/blob_async_transport_strategy.cc ('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 8627ebaf3756f574e9f373fd77a4b5a3e9455d33..f075c2161f96b37a20b90723c2288bab0e8f780f 100644
--- a/storage/browser/blob/blob_data_builder.h
+++ b/storage/browser/blob/blob_data_builder.h
@@ -23,11 +23,16 @@ class Entry;
namespace storage {
class BlobStorageContext;
+class ShareableFileReference;
class STORAGE_EXPORT BlobDataBuilder {
public:
using DataHandle = BlobDataItem::DataHandle;
+ // This is the filename used for the temporary file items added by
+ // AppendFutureFile.
+ const static char kAppendFutureFileTemporaryFileName[];
+
explicit BlobDataBuilder(const std::string& uuid);
~BlobDataBuilder();
@@ -49,8 +54,7 @@ class STORAGE_EXPORT BlobDataBuilder {
// Adds an item that is flagged for future data population. The memory is not
// allocated until the first call to PopulateFutureData. Returns the index of
- // the item (to be used in PopulateFutureData).
- // Length cannot be 0.
+ // the item (to be used in PopulateFutureData). |length| cannot be 0.
size_t AppendFutureData(size_t length);
// Populates a part of an item previously allocated with AppendFutureData.
@@ -65,6 +69,22 @@ class STORAGE_EXPORT BlobDataBuilder {
size_t offset,
size_t length);
+ // Adds an item that is flagged for future data population. Use
+ // 'PopulateFutureFile' to set the file path and expected modification time
+ // of this file. Returns the index of the item (to be used in
+ // PopulateFutureFile). The temporary filename used by this method is
+ // kAppendFutureFileTemporaryFileName. |length| cannot be 0.
+ size_t AppendFutureFile(uint64_t offset, uint64_t length);
+
+ // Populates a part of an item previously allocated with AppendFutureFile.
+ // Returns true if:
+ // * The item was created by using AppendFutureFile and
+ // * The filepath is valid.
+ bool PopulateFutureFile(
+ size_t index,
+ const scoped_refptr<ShareableFileReference>& file_reference,
+ const base::Time& expected_modification_time);
+
// You must know the length of the file, you cannot use kuint64max to specify
// the whole file. This method creates a ShareableFileReference to the given
// file, which is stored in this builder.
« no previous file with comments | « storage/browser/blob/blob_async_transport_strategy.cc ('k') | storage/browser/blob/blob_data_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698