summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authordmurph <dmurph@chromium.org>2015-02-11 16:31:44 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-12 00:32:26 +0000
commit24dc5eece51abf42b79c885573abc782c413945f (patch)
treee91efb9bf57b704e4068bece5c8d18588e87c8da /storage
parentab1e915aa5359cce68e1f861a612f1c735d86fb0 (diff)
downloadchromium_src-24dc5eece51abf42b79c885573abc782c413945f.zip
chromium_src-24dc5eece51abf42b79c885573abc782c413945f.tar.gz
chromium_src-24dc5eece51abf42b79c885573abc782c413945f.tar.bz2
Fixed IndexedDB blob retention
R=michaeln BUG=457536 Review URL: https://codereview.chromium.org/913303002 Cr-Commit-Position: refs/heads/master@{#315885}
Diffstat (limited to 'storage')
-rw-r--r--storage/browser/blob/blob_data_builder.cc17
-rw-r--r--storage/browser/blob/blob_data_builder.h11
2 files changed, 5 insertions, 23 deletions
diff --git a/storage/browser/blob/blob_data_builder.cc b/storage/browser/blob/blob_data_builder.cc
index 38b3923..51946c8 100644
--- a/storage/browser/blob/blob_data_builder.cc
+++ b/storage/browser/blob/blob_data_builder.cc
@@ -5,6 +5,7 @@
#include "storage/browser/blob/blob_data_builder.h"
#include "base/time/time.h"
+#include "storage/browser/blob/shareable_file_reference.h"
namespace storage {
@@ -28,20 +29,8 @@ void BlobDataBuilder::AppendFile(const base::FilePath& file_path,
scoped_ptr<DataElement> element(new DataElement());
element->SetToFilePathRange(file_path, offset, length,
expected_modification_time);
- items_.push_back(new BlobDataItem(element.Pass()));
-}
-
-void BlobDataBuilder::AppendFile(
- const base::FilePath& file_path,
- uint64_t offset,
- uint64_t length,
- const base::Time& expected_modification_time,
- scoped_refptr<ShareableFileReference> shareable_file) {
- DCHECK(length > 0);
- scoped_ptr<DataElement> element(new DataElement());
- element->SetToFilePathRange(file_path, offset, length,
- expected_modification_time);
- items_.push_back(new BlobDataItem(element.Pass(), shareable_file));
+ items_.push_back(
+ new BlobDataItem(element.Pass(), ShareableFileReference::Get(file_path)));
}
void BlobDataBuilder::AppendBlob(const std::string& uuid,
diff --git a/storage/browser/blob/blob_data_builder.h b/storage/browser/blob/blob_data_builder.h
index 0316521..8119538 100644
--- a/storage/browser/blob/blob_data_builder.h
+++ b/storage/browser/blob/blob_data_builder.h
@@ -33,20 +33,13 @@ 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.
+ // the whole file. This method creates a ShareableFileReference to the given
+ // file, which is stored in this builder.
void AppendFile(const base::FilePath& file_path,
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_t offset,
- uint64_t length,
- const base::Time& expected_modification_time,
- scoped_refptr<ShareableFileReference> shareable_file);
-
void AppendBlob(const std::string& uuid, uint64_t offset, uint64_t length);
void AppendBlob(const std::string& uuid);