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

Unified Diff: webkit/blob/blob_data.h

Issue 7974011: Break large blobs into multiple ipcs during creation. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
===================================================================
--- 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>;

Powered by Google App Engine
This is Rietveld 408576698