summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-10-18 17:41:38 -0400
committerPatrick Scott <phanna@android.com>2010-10-18 17:41:38 -0400
commit0bfbe2599b9b089efe6e6b111b9a824f4cbe720f (patch)
treece214b6c198fc36c864dede1632d92e05f310c43 /WebKit/android/WebCoreSupport
parent38739d1775cff08915cd14d0c77356b21f4f77b7 (diff)
downloadexternal_webkit-0bfbe2599b9b089efe6e6b111b9a824f4cbe720f.zip
external_webkit-0bfbe2599b9b089efe6e6b111b9a824f4cbe720f.tar.gz
external_webkit-0bfbe2599b9b089efe6e6b111b9a824f4cbe720f.tar.bz2
Fix books.google.com purchase page.
We have to copy the data between threads. Bug: 3105145 Change-Id: I955d033815aaf3fd18fdac52ab8cf9b23c107436
Diffstat (limited to 'WebKit/android/WebCoreSupport')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.cpp5
-rw-r--r--WebKit/android/WebCoreSupport/WebRequest.h3
-rw-r--r--WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp8
3 files changed, 9 insertions, 7 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequest.cpp b/WebKit/android/WebCoreSupport/WebRequest.cpp
index d24c6cc..937a365 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequest.cpp
@@ -113,11 +113,12 @@ void WebRequest::finish(bool success)
m_request = 0;
}
-void WebRequest::AppendBytesToUpload(const char* bytes, int bytesLen)
+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());
- m_request->AppendBytesToUpload(bytes, bytesLen);
+ m_request->AppendBytesToUpload(data->data(), data->size());
+ delete data;
}
void WebRequest::start(bool isPrivateBrowsing)
diff --git a/WebKit/android/WebCoreSupport/WebRequest.h b/WebKit/android/WebCoreSupport/WebRequest.h
index 987d8ae..408ec4e 100644
--- a/WebKit/android/WebCoreSupport/WebRequest.h
+++ b/WebKit/android/WebCoreSupport/WebRequest.h
@@ -28,6 +28,7 @@
#include "ChromiumIncludes.h"
#include "WebUrlLoaderClient.h"
+#include "wtf/Vector.h"
class MessageLoop;
@@ -58,7 +59,7 @@ public:
WebRequest(WebUrlLoaderClient*, WebResourceRequest, int inputStream);
// Optional, but if used has to be called before start
- void AppendBytesToUpload(const char* bytes, int bytesLen);
+ void AppendBytesToUpload(Vector<char>* data);
void start(bool isPrivateBrowsing);
void cancel();
diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
index 6225413..7a9125a 100644
--- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
+++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp
@@ -120,11 +120,11 @@ WebUrlLoaderClient::WebUrlLoaderClient(WebFrame* webFrame, WebCore::ResourceHand
if (!element.m_data.isEmpty()) {
// WebKit sometimes gives up empty data to append. These aren't
// necessary so we just optimize those out here.
- int size = static_cast<int>(element.m_data.size());
- // TODO: do we have to make a copy of this data?
base::Thread* thread = ioThread();
- if (thread)
- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request, &WebRequest::AppendBytesToUpload, element.m_data.data(), size));
+ if (thread) {
+ Vector<char>* data = new Vector<char>(element.m_data);
+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(m_request, &WebRequest::AppendBytesToUpload, data));
+ }
}
break;
#if ENABLE(BLOB)