external/webkit
Revisión | 73a306c4d2dd650b9a083deb6362fc6ba3cf9032 (tree) |
---|---|
Tiempo | 2011-11-16 19:26:41 |
Autor | Ben Murdoch <benm@goog...> |
Commiter | Android (Google) Code Review |
Merge "Fix CacheManager to correctly write CacheFiles to disk." into ics-mr1
@@ -134,11 +134,11 @@ bool CacheResult::writeToFile(const String& filePath) const | ||
134 | 134 | if (!thread) |
135 | 135 | return false; |
136 | 136 | |
137 | - CacheResult* me = const_cast<CacheResult*>(this); | |
138 | - thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::writeToFileImpl)); | |
139 | - | |
140 | 137 | m_filePath = filePath.threadsafeCopy(); |
141 | 138 | m_isAsyncOperationInProgress = true; |
139 | + | |
140 | + thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::writeToFileImpl)); | |
141 | + | |
142 | 142 | while (m_isAsyncOperationInProgress) |
143 | 143 | m_condition.wait(m_mutex); |
144 | 144 |
@@ -213,10 +213,9 @@ HttpResponseHeaders* CacheResult::responseHeaders() const | ||
213 | 213 | if (!thread) |
214 | 214 | return 0; |
215 | 215 | |
216 | - CacheResult* me = const_cast<CacheResult*>(this); | |
217 | - thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(me, &CacheResult::responseHeadersImpl)); | |
218 | - | |
219 | 216 | m_isAsyncOperationInProgress = true; |
217 | + thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(const_cast<CacheResult*>(this), &CacheResult::responseHeadersImpl)); | |
218 | + | |
220 | 219 | while (m_isAsyncOperationInProgress) |
221 | 220 | m_condition.wait(m_mutex); |
222 | 221 |
@@ -90,6 +90,7 @@ static jobject getCacheResult(JNIEnv* env, jobject, jstring url) | ||
90 | 90 | String urlWtfString = jstringToWtfString(env, url); |
91 | 91 | Vector<char> encodedUrl; |
92 | 92 | base64Encode(urlWtfString.utf8().data(), urlWtfString.length(), encodedUrl, false /*insertLFs*/); |
93 | + encodedUrl.append('\0'); | |
93 | 94 | String filePath = pathByAppendingComponent(getCacheFileBaseDir(env), encodedUrl.data()); |
94 | 95 | if (!result->writeToFile(filePath)) |
95 | 96 | return 0; |