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

Unified Diff: net/base/upload_data.h

Issue 3108042: Support sending BlobData to browser process. Also support sending UploadData... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
« no previous file with comments | « chrome/worker/worker_webkitclient_impl.cc ('k') | net/base/upload_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/upload_data.h
===================================================================
--- net/base/upload_data.h (revision 57697)
+++ net/base/upload_data.h (working copy)
@@ -13,6 +13,7 @@
#include "base/gtest_prod_util.h"
#include "base/logging.h"
#include "base/ref_counted.h"
+#include "googleurl/src/gurl.h"
#include "net/base/file_stream.h"
#include "base/time.h"
@@ -24,7 +25,8 @@
enum Type {
TYPE_BYTES,
- TYPE_FILE
+ TYPE_FILE,
+ TYPE_BLOB
};
class Element {
@@ -50,6 +52,7 @@
const base::Time& expected_file_modification_time() const {
return expected_file_modification_time_;
}
+ const GURL& blob_url() const { return blob_url_; }
void SetToBytes(const char* bytes, int bytes_len) {
type_ = TYPE_BYTES;
@@ -73,6 +76,13 @@
expected_file_modification_time_ = expected_modification_time;
}
+ // TODO(jianli): UploadData should not contain any blob reference. We need
+ // to define another structure to represent WebKit::WebHTTPBody.
+ void SetToBlobUrl(const GURL& blob_url) {
+ type_ = TYPE_BLOB;
+ blob_url_ = blob_url;
+ }
+
// Returns the byte-length of the element. For files that do not exist, 0
// is returned. This is done for consistency with Mozilla.
// Once called, this function will always return the same value.
@@ -97,6 +107,7 @@
uint64 file_range_offset_;
uint64 file_range_length_;
base::Time expected_file_modification_time_;
+ GURL blob_url_;
bool override_content_length_;
bool content_length_computed_;
uint64 content_length_;
@@ -127,6 +138,11 @@
expected_modification_time);
}
+ void AppendBlob(const GURL& blob_url) {
+ elements_.push_back(Element());
+ elements_.back().SetToBlobUrl(blob_url);
+ }
+
// Returns the total size in bytes of the data to upload.
uint64 GetContentLength();
« no previous file with comments | « chrome/worker/worker_webkitclient_impl.cc ('k') | net/base/upload_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698