diff options
author | Ben Murdoch <benm@google.com> | 2011-11-16 02:30:29 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-16 02:30:29 -0800 |
commit | c1e474070715604e662ed46a1dcf25d5d5e187a1 (patch) | |
tree | 8b3f502552c4da226f1b12e75e5d923e025e7c85 /Source | |
parent | 5309397b8a57127bf27bc3bfd7d54fe977f086af (diff) | |
parent | 73a306c4d2dd650b9a083deb6362fc6ba3cf9032 (diff) | |
download | external_webkit-c1e474070715604e662ed46a1dcf25d5d5e187a1.zip external_webkit-c1e474070715604e662ed46a1dcf25d5d5e187a1.tar.gz external_webkit-c1e474070715604e662ed46a1dcf25d5d5e187a1.tar.bz2 |
am 73a306c4: Merge "Fix CacheManager to correctly write CacheFiles to disk." into ics-mr1
* commit '73a306c4d2dd650b9a083deb6362fc6ba3cf9032':
Fix CacheManager to correctly write CacheFiles to disk.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebKit/android/WebCoreSupport/CacheResult.cpp | 11 | ||||
-rw-r--r-- | Source/WebKit/android/jni/CacheManager.cpp | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/CacheResult.cpp b/Source/WebKit/android/WebCoreSupport/CacheResult.cpp index 5309c66..6710e49 100644 --- a/Source/WebKit/android/WebCoreSupport/CacheResult.cpp +++ b/Source/WebKit/android/WebCoreSupport/CacheResult.cpp @@ -134,11 +134,11 @@ bool CacheResult::writeToFile(const String& filePath) const if (!thread) return false; - CacheResult* me = const_cast<CacheResult*>(this); - thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::writeToFileImpl)); - m_filePath = filePath.threadsafeCopy(); m_isAsyncOperationInProgress = true; + + thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::writeToFileImpl)); + while (m_isAsyncOperationInProgress) m_condition.wait(m_mutex); @@ -213,10 +213,9 @@ HttpResponseHeaders* CacheResult::responseHeaders() const if (!thread) return 0; - CacheResult* me = const_cast<CacheResult*>(this); - thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::responseHeadersImpl)); - m_isAsyncOperationInProgress = true; + thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::responseHeadersImpl)); + while (m_isAsyncOperationInProgress) m_condition.wait(m_mutex); diff --git a/Source/WebKit/android/jni/CacheManager.cpp b/Source/WebKit/android/jni/CacheManager.cpp index 144b62a..f600d00 100644 --- a/Source/WebKit/android/jni/CacheManager.cpp +++ b/Source/WebKit/android/jni/CacheManager.cpp @@ -90,6 +90,7 @@ static jobject getCacheResult(JNIEnv* env, jobject, jstring url) String urlWtfString = jstringToWtfString(env, url); Vector<char> encodedUrl; base64Encode(urlWtfString.utf8().data(), urlWtfString.length(), encodedUrl, false /*insertLFs*/); + encodedUrl.append('\0'); String filePath = pathByAppendingComponent(getCacheFileBaseDir(env), encodedUrl.data()); if (!result->writeToFile(filePath)) return 0; |