[WK2][EFL] Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSys...
authorjh718.park@samsung.com <jh718.park@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Dec 2015 03:37:07 +0000 (03:37 +0000)
committerjh718.park@samsung.com <jh718.park@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Dec 2015 03:37:07 +0000 (03:37 +0000)
to refactor APIWebsiteDataStoreEfl
https://bugs.webkit.org/show_bug.cgi?id=152475

Reviewed by Gyuyoung Kim.

Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSystemRepresentation
instead of to use efreet_cache_home_get
and efreet_data_home_get directly.
And also use EINA_PATH_SEP_S instead of "/" as directory separator,
and WebCore::pathByAppendingComponent instead of operator+.

* UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp:
(API::WebsiteDataStore::defaultApplicationCacheDirectory):
(API::WebsiteDataStore::defaultNetworkCacheDirectory):
(API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
(API::WebsiteDataStore::defaultLocalStorageDirectory):
(API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
(API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194358 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp

index 0e3d425..cfdb163 100644 (file)
@@ -1,3 +1,27 @@
+2015-12-21  Joonghun Park  <jh718.park@samsung.com>
+
+        [WK2][EFL] Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSystemRepresentation
+        to refactor APIWebsiteDataStoreEfl
+        https://bugs.webkit.org/show_bug.cgi?id=152475
+
+        Reviewed by Gyuyoung Kim.
+
+        Use cacheDirectoryFileSystemRepresentation and websiteDataDirectoryFileSystemRepresentation
+        instead of to use efreet_cache_home_get
+        and efreet_data_home_get directly.
+        And also use EINA_PATH_SEP_S instead of "/" as directory separator,
+        and WebCore::pathByAppendingComponent instead of operator+.
+
+        * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp:
+        (API::WebsiteDataStore::defaultApplicationCacheDirectory):
+        (API::WebsiteDataStore::defaultNetworkCacheDirectory):
+        (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
+        (API::WebsiteDataStore::defaultLocalStorageDirectory):
+        (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
+        (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
+        (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
+        (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
+
 2015-12-21  Antti Koivisto  <antti@apple.com>
 
         Factor NetworkResourceLoader code for storing a cache entry into a function
index bac53fa..e5cc61f 100644 (file)
 #include "APIWebsiteDataStore.h"
 
 #include <Efreet.h>
+#include <WebCore/FileSystem.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace API {
 
 String WebsiteDataStore::defaultApplicationCacheDirectory()
 {
-    return String::fromUTF8(efreet_cache_home_get()) + "/WebKitEfl/Applications";
+    return cacheDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "Applications");
 }
 
 String WebsiteDataStore::defaultNetworkCacheDirectory()
@@ -44,42 +45,37 @@ String WebsiteDataStore::defaultNetworkCacheDirectory()
     static const char networkCacheSubdirectory[] = "webkit";
 #endif
 
-    StringBuilder diskCacheDirectory;
-    diskCacheDirectory.append(efreet_cache_home_get());
-    diskCacheDirectory.appendLiteral("/");
-    diskCacheDirectory.append(networkCacheSubdirectory);
-
-    return diskCacheDirectory.toString();
+    return cacheDirectoryFileSystemRepresentation(networkCacheSubdirectory);
 }
 
 String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
 {
-    return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/IndexedDB";
+    return websiteDataDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "IndexedDB");
 }
 
 String WebsiteDataStore::defaultLocalStorageDirectory()
 {
-    return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/LocalStorage";
+    return websiteDataDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "LocalStorage");
 }
 
 String WebsiteDataStore::defaultMediaKeysStorageDirectory()
 {
-    return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/MediaKeys";
+    return websiteDataDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "MediaKeys");
 }
 
 String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
 {
-    return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/Databases";
+    return websiteDataDirectoryFileSystemRepresentation("WebKitEfl" EINA_PATH_SEP_S "Databases");
 }
 
 String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String& directoryName)
 {
-    return String::fromUTF8(efreet_cache_home_get()) + directoryName;
+    return WebCore::pathByAppendingComponent(String::fromUTF8(efreet_cache_home_get()), directoryName);
 }
 
 String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String& directoryName)
 {
-    return String::fromUTF8(efreet_data_home_get()) + directoryName;
+    return WebCore::pathByAppendingComponent(String::fromUTF8(efreet_data_home_get()), directoryName);
 }
 
 WebKit::WebsiteDataStore::Configuration WebsiteDataStore::defaultDataStoreConfiguration()