From abdfca3d9cf3a3d7728dd0b7a8ff35954fa7b8e4 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Mon, 1 Nov 2010 14:28:16 +0000 Subject: 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 --- WebKit/android/WebCoreSupport/WebRequest.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'WebKit/android/WebCoreSupport/WebRequest.cpp') 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* 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* 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; } -- cgit v1.1