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

Unified Diff: webkit/blob/blob_data.h

Issue 10828252: Support FileSystem URL in File object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: webkit/blob/blob_data.h
diff --git a/webkit/blob/blob_data.h b/webkit/blob/blob_data.h
index 3d276f0509e70872c9646a30af2030d9b1d9e605..1f7191ff3b646b854b0a5fcfa77abcde95a61c77 100644
--- a/webkit/blob/blob_data.h
+++ b/webkit/blob/blob_data.h
@@ -27,7 +27,8 @@ class BLOB_EXPORT BlobData : public base::RefCounted<BlobData> {
TYPE_DATA,
TYPE_DATA_EXTERNAL,
TYPE_FILE,
- TYPE_BLOB
+ TYPE_BLOB,
+ TYPE_FILE_FILESYSTEM,
};
struct BLOB_EXPORT Item {
@@ -63,15 +64,25 @@ class BLOB_EXPORT BlobData : public base::RefCounted<BlobData> {
void SetToBlob(const GURL& blob_url, uint64 offset, uint64 length) {
type = TYPE_BLOB;
- this->blob_url = blob_url;
+ this->url = blob_url;
this->offset = offset;
this->length = length;
}
+ void SetToFileSystemFile(
+ const GURL& url, uint64 offset, uint64 length,
+ const base::Time& expected_modification_time) {
+ type = TYPE_FILE_FILESYSTEM;
+ this->url = url;
+ this->offset = offset;
+ this->length = length;
+ this->expected_modification_time = expected_modification_time;
+ }
+
Type type;
std::string data; // For Data type.
const char* data_external; // For DataExternal type.
- GURL blob_url; // For Blob type.
+ GURL url; // For Blob or FileSystem File type.
FilePath file_path; // For File type.
base::Time expected_modification_time; // Also for File type.
uint64 offset;
@@ -90,6 +101,9 @@ class BLOB_EXPORT BlobData : public base::RefCounted<BlobData> {
void AppendFile(const FilePath& file_path, uint64 offset, uint64 length,
const base::Time& expected_modification_time);
+ void AppendFileSystemFile(const GURL& url, uint64 offset, uint64 length,
+ const base::Time& expected_modification_time);
+
void AppendBlob(const GURL& blob_url, uint64 offset, uint64 length);
void AttachShareableFileReference(ShareableFileReference* reference) {
@@ -141,7 +155,7 @@ inline bool operator==(const BlobData::Item& a, const BlobData::Item& b) {
a.expected_modification_time == b.expected_modification_time;
}
if (a.type == BlobData::TYPE_BLOB) {
- return a.blob_url == b.blob_url &&
+ return a.url == b.url &&
a.offset == b.offset &&
a.length == b.length;
}
« net/base/upload_data.h ('K') | « net/base/upload_data.cc ('k') | webkit/blob/blob_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698