summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-11-26 04:28:14 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-26 04:28:14 -0800
commit9939893040b1fcacaa96e26fd688e7c7db271ba3 (patch)
tree23a79697a77b7312504662186e6f8e4f26a77ec4 /WebKit/android
parentd907899557afb7685e9e8906c6f03abbacfa2a97 (diff)
parent20abb0328abff7ab53b49399ba3b2122c37d8249 (diff)
downloadexternal_webkit-9939893040b1fcacaa96e26fd688e7c7db271ba3.zip
external_webkit-9939893040b1fcacaa96e26fd688e7c7db271ba3.tar.gz
external_webkit-9939893040b1fcacaa96e26fd688e7c7db271ba3.tar.bz2
Merge "No longer need to pass storage paths to WebRequestContext.cleanupPrivateBrowsingFiles()"
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.cpp6
-rw-r--r--WebKit/android/WebCoreSupport/WebRequestContext.h2
-rw-r--r--WebKit/android/nav/WebView.cpp17
3 files changed, 8 insertions, 17 deletions
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.cpp b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
index 1a82449..9d8ad66 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.cpp
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.cpp
@@ -224,7 +224,7 @@ static void removeFileOrDirectory(const char* filename)
unlink(filename);
}
-bool WebRequestContext::cleanupPrivateBrowsingFiles(const std::string& databaseDirectory, const std::string& cacheDirectory)
+bool WebRequestContext::cleanupPrivateBrowsingFiles()
{
// This is called on the UI thread.
MutexLocker lock(privateBrowsingContextMutex);
@@ -232,10 +232,10 @@ bool WebRequestContext::cleanupPrivateBrowsingFiles(const std::string& databaseD
if (!privateBrowsingContext || privateBrowsingContext->HasOneRef()) {
privateBrowsingContext = 0;
- std::string cookiePath(databaseDirectory);
+ std::string cookiePath = getDatabaseDirectory();
cookiePath.append(kCookiesDatabaseFilenamePrivate);
removeFileOrDirectory(cookiePath.c_str());
- std::string cachePath(cacheDirectory);
+ std::string cachePath = getCacheDirectory();
cachePath.append(kCacheDirectoryPrivate);
removeFileOrDirectory(cachePath.c_str());
return true;
diff --git a/WebKit/android/WebCoreSupport/WebRequestContext.h b/WebKit/android/WebCoreSupport/WebRequestContext.h
index f4a579c..ba7dc4f 100644
--- a/WebKit/android/WebCoreSupport/WebRequestContext.h
+++ b/WebKit/android/WebCoreSupport/WebRequestContext.h
@@ -50,7 +50,7 @@ public:
static WebRequestContext* get(bool isPrivateBrowsing);
// These methods are threadsafe.
- static bool cleanupPrivateBrowsingFiles(const std::string& databaseDirectory, const std::string& cacheDirectory);
+ static bool cleanupPrivateBrowsingFiles();
static void setUserAgent(WTF::String);
static void setAcceptLanguage(WTF::String);
bool allowCookies();
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 03052ca..d491b37 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -2048,19 +2048,10 @@ static void nativeMoveSelection(JNIEnv *env, jobject obj, int x, int y)
GET_NATIVE_VIEW(env, obj)->moveSelection(x, y);
}
-static jboolean nativeCleanupPrivateBrowsingFiles(
- JNIEnv *env, jobject obj, jstring databaseDirectoryJString, jstring cacheDirectoryJString) {
+static jboolean nativeCleanupPrivateBrowsingFiles(JNIEnv*, jobject)
+{
#if USE(CHROME_NETWORK_STACK)
- jboolean isCopy;
- const char* cString = env->GetStringUTFChars(databaseDirectoryJString, &isCopy);
- std::string databaseDirectory(cString);
- if (isCopy == JNI_TRUE)
- env->ReleaseStringUTFChars(databaseDirectoryJString, cString);
- cString = env->GetStringUTFChars(cacheDirectoryJString, &isCopy);
- std::string cacheDirectory(cString);
- if (isCopy == JNI_TRUE)
- env->ReleaseStringUTFChars(cacheDirectoryJString, cString);
- return WebRequestContext::cleanupPrivateBrowsingFiles(databaseDirectory, cacheDirectory);
+ return WebRequestContext::cleanupPrivateBrowsingFiles();
#else
return JNI_FALSE;
#endif
@@ -2322,7 +2313,7 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeMoveGeneration },
{ "nativeMoveSelection", "(II)V",
(void*) nativeMoveSelection },
- { "nativeCleanupPrivateBrowsingFiles", "(Ljava/lang/String;Ljava/lang/String;)Z",
+ { "nativeCleanupPrivateBrowsingFiles", "()Z",
(void*) nativeCleanupPrivateBrowsingFiles },
{ "nativePointInNavCache", "(III)Z",
(void*) nativePointInNavCache },