| Index: webkit/blob/blob_data.h
|
| ===================================================================
|
| --- webkit/blob/blob_data.h (revision 102191)
|
| +++ webkit/blob/blob_data.h (working copy)
|
| @@ -28,8 +28,7 @@
|
| TYPE_BLOB
|
| };
|
|
|
| - class Item {
|
| - public:
|
| + struct Item {
|
| Item();
|
| ~Item();
|
|
|
| @@ -55,6 +54,13 @@
|
| length_ = length;
|
| }
|
|
|
| + void SetToData(const char* data, uint64 length) {
|
| + type_ = TYPE_DATA;
|
| + data_.assign(data, length);
|
| + offset_ = 0;
|
| + length_ = length;
|
| + }
|
| +
|
| void SetToFile(const FilePath& file_path, uint64 offset, uint64 length,
|
| const base::Time& expected_modification_time) {
|
| type_ = TYPE_FILE;
|
| @@ -71,7 +77,6 @@
|
| length_ = length;
|
| }
|
|
|
| - private:
|
| Type type_;
|
|
|
| // For Data type.
|
| @@ -91,6 +96,10 @@
|
| BlobData();
|
| explicit BlobData(const WebKit::WebBlobData& data);
|
|
|
| + void AppendItem(const Item& item) {
|
| + items_.push_back(item);
|
| + }
|
| +
|
| void AppendData(const std::string& data) {
|
| // TODO(jianli): Consider writing the big data to the disk.
|
| AppendData(data, 0, static_cast<uint32>(data.size()));
|
| @@ -133,11 +142,6 @@
|
| content_disposition_ = content_disposition;
|
| }
|
|
|
| - // Should only be called by the IPC ParamTraits for this class.
|
| - void swap_items(std::vector<Item>* items) {
|
| - items_.swap(*items);
|
| - }
|
| -
|
| private:
|
| friend class base::RefCounted<BlobData>;
|
|
|
|
|