summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/CacheManager.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-11-15 15:26:37 +0000
committerBen Murdoch <benm@google.com>2011-11-15 16:08:47 +0000
commit8d55fa6a7b44dd646774f089c2b88697d9d56096 (patch)
tree8bc2f6d46299bee1c9434ad58a9e6484d0c66f85 /Source/WebKit/android/jni/CacheManager.cpp
parent61a908361c8a96eeb70afdb5430e89845edb2bdd (diff)
downloadexternal_webkit-8d55fa6a7b44dd646774f089c2b88697d9d56096.zip
external_webkit-8d55fa6a7b44dd646774f089c2b88697d9d56096.tar.gz
external_webkit-8d55fa6a7b44dd646774f089c2b88697d9d56096.tar.bz2
Fix CacheManager to correctly write CacheFiles to disk.
There are two problems with the CacheManager - 1. Need to null terminate the file path used for the cache file on disk. 2. A race condition between starting the background task to write the file and updating internal state variables. These were causing a CTS test to fail. Bug: 5619303 Change-Id: I61f06d50b7ef560ede2f1141fc51d92255d4efbd
Diffstat (limited to 'Source/WebKit/android/jni/CacheManager.cpp')
-rw-r--r--Source/WebKit/android/jni/CacheManager.cpp1
1 files changed, 1 insertions, 0 deletions
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;