• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/webkit


Commit MetaInfo

Revisión73a306c4d2dd650b9a083deb6362fc6ba3cf9032 (tree)
Tiempo2011-11-16 19:26:41
AutorBen Murdoch <benm@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "Fix CacheManager to correctly write CacheFiles to disk." into ics-mr1

Cambiar Resumen

Diferencia incremental

--- 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
134134 if (!thread)
135135 return false;
136136
137- CacheResult* me = const_cast<CacheResult*>(this);
138- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::writeToFileImpl));
139-
140137 m_filePath = filePath.threadsafeCopy();
141138 m_isAsyncOperationInProgress = true;
139+
140+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::writeToFileImpl));
141+
142142 while (m_isAsyncOperationInProgress)
143143 m_condition.wait(m_mutex);
144144
@@ -213,10 +213,9 @@ HttpResponseHeaders* CacheResult::responseHeaders() const
213213 if (!thread)
214214 return 0;
215215
216- CacheResult* me = const_cast<CacheResult*>(this);
217- thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::responseHeadersImpl));
218-
219216 m_isAsyncOperationInProgress = true;
217+ thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::responseHeadersImpl));
218+
220219 while (m_isAsyncOperationInProgress)
221220 m_condition.wait(m_mutex);
222221
--- 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)
9090 String urlWtfString = jstringToWtfString(env, url);
9191 Vector<char> encodedUrl;
9292 base64Encode(urlWtfString.utf8().data(), urlWtfString.length(), encodedUrl, false /*insertLFs*/);
93+ encodedUrl.append('\0');
9394 String filePath = pathByAppendingComponent(getCacheFileBaseDir(env), encodedUrl.data());
9495 if (!result->writeToFile(filePath))
9596 return 0;