| Index: webkit/base/data_element.h
|
| ===================================================================
|
| --- webkit/base/data_element.h (revision 171309)
|
| +++ webkit/base/data_element.h (working copy)
|
| @@ -5,6 +5,7 @@
|
| #ifndef WEBKIT_BASE_DATA_ELEMENT_H_
|
| #define WEBKIT_BASE_DATA_ELEMENT_H_
|
|
|
| +#include <string>
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| @@ -34,7 +35,8 @@
|
| Type type() const { return type_; }
|
| const char* bytes() const { return bytes_ ? bytes_ : &buf_[0]; }
|
| const FilePath& path() const { return path_; }
|
| - const GURL& url() const { return url_; }
|
| + const GURL& filesystem_url() const { return filesystem_url_; }
|
| + const std::string& blob_uuid() const { return blob_uuid_; }
|
| uint64 offset() const { return offset_; }
|
| uint64 length() const { return length_; }
|
| const base::Time& expected_modification_time() const {
|
| @@ -62,8 +64,8 @@
|
| }
|
|
|
| // Sets TYPE_BLOB data.
|
| - void SetToBlobUrl(const GURL& blob_url) {
|
| - SetToBlobUrlRange(blob_url, 0, kuint64max);
|
| + void SetToBlob(const std::string& uuid) {
|
| + SetToBlobRange(uuid, 0, kuint64max);
|
| }
|
|
|
| // Sets TYPE_FILE data with range.
|
| @@ -72,8 +74,8 @@
|
| const base::Time& expected_modification_time);
|
|
|
| // Sets TYPE_BLOB data with range.
|
| - void SetToBlobUrlRange(const GURL& blob_url,
|
| - uint64 offset, uint64 length);
|
| + void SetToBlobRange(const std::string& uuid,
|
| + uint64 offset, uint64 length);
|
|
|
| // Sets TYPE_FILE_FILESYSTEM with range.
|
| void SetToFileSystemUrlRange(const GURL& filesystem_url,
|
| @@ -83,9 +85,10 @@
|
| private:
|
| Type type_;
|
| std::vector<char> buf_; // For TYPE_BYTES.
|
| - const char* bytes_; // For TYPE_BYTES.
|
| + const char* bytes_; // For TYPE_BYTES when we don't own the buffer.
|
| FilePath path_; // For TYPE_FILE.
|
| - GURL url_; // For TYPE_BLOB or TYPE_FILE_FILESYSTEM.
|
| + GURL filesystem_url_; // For TYPE_FILE_FILESYSTEM.
|
| + std::string blob_uuid_; // For TYPE_BLOB
|
| uint64 offset_;
|
| uint64 length_;
|
| base::Time expected_modification_time_;
|
| @@ -104,8 +107,9 @@
|
| return a.path() == b.path() &&
|
| a.expected_modification_time() == b.expected_modification_time();
|
| case DataElement::TYPE_BLOB:
|
| + return a.blob_uuid() == b.blob_uuid();
|
| case DataElement::TYPE_FILE_FILESYSTEM:
|
| - return a.url() == b.url();
|
| + return a.filesystem_url() == b.filesystem_url();
|
| case DataElement::TYPE_UNKNOWN:
|
| NOTREACHED();
|
| return false;
|
|
|