summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/WebRequest.cpp
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-11-01 14:28:16 +0000
committerKristian Monsen <kristianm@google.com>2010-11-04 12:05:17 +0000
commitabdfca3d9cf3a3d7728dd0b7a8ff35954fa7b8e4 (patch)
treeebda9439b356d49a89f467658d9cb9a82f7c945b /WebKit/android/WebCoreSupport/WebRequest.cpp
parentd5a8aa497723e8ab3b77f0ecb8c9c6cc7ab5d7b0 (diff)
downloadexternal_webkit-abdfca3d9cf3a3d7728dd0b7a8ff35954fa7b8e4.zip
external_webkit-abdfca3d9cf3a3d7728dd0b7a8ff35954fa7b8e4.tar.gz
external_webkit-abdfca3d9cf3a3d7728dd0b7a8ff35954fa7b8e4.tar.bz2
Add support for file uploads in WebKit
This also moves some of the android file handling to Java so it is not duplicated in both places. This CL needs https://android-git.corp.google.com/g/#change,77400 in frameworks/base Change-Id: I90c1726e6c323a9de3fd64f2e6feef4b64171053
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebRequest.cpp')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index ef09ff7..f21c1a2 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -130,10 +130,18 @@ void WebRequest::finish(bool success)
m_urlLoader = 0;
}
-void WebRequest::AppendBytesToUpload(WTF::Vector<char>* data)
+void WebRequest::appendFileToUpload(std::string filename)
+{
+ // AppendFileToUpload is only valid before calling start
+ ASSERT(m_loadState == Created, "appendFileToUpload called on a WebRequest not in CREATED state: (%s)", m_url.c_str());
+ FilePath filePath(filename);
+ m_request->AppendFileToUpload(filePath);
+}
+
+void WebRequest::appendBytesToUpload(WTF::Vector<char>* data)
{
// AppendBytesToUpload is only valid before calling start
- ASSERT(m_loadState == Created, "Start called on a WebRequest not in CREATED state: (%s)", m_url.c_str());
+ ASSERT(m_loadState == Created, "appendBytesToUpload called on a WebRequest not in CREATED state: (%s)", m_url.c_str());
m_request->AppendBytesToUpload(data->data(), data->size());
delete data;
}