summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorcalvinlo@chromium.org <calvinlo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 16:14:53 +0000
committercalvinlo@chromium.org <calvinlo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-06 16:14:53 +0000
commit9a70a6a3b99e5aef28a8cc1963907955732c9888 (patch)
treecc3f66ef3c2e5673f47df824c232681c31138d41 /webkit
parentd0c36eca5099e2972f96ee3dec6b92ac1deb4af8 (diff)
downloadchromium_src-9a70a6a3b99e5aef28a8cc1963907955732c9888.zip
chromium_src-9a70a6a3b99e5aef28a8cc1963907955732c9888.tar.gz
chromium_src-9a70a6a3b99e5aef28a8cc1963907955732c9888.tar.bz2
Return a FileEntry object from onFileSynced events so both input and output types of API functions involving single files all use FileEntry.
BUG=167552 TEST=SyncFileSystemApiTest.OnFileSynced Review URL: https://chromiumcodereview.appspot.com/11819058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/fileapi/file_system_util.cc24
-rw-r--r--webkit/fileapi/file_system_util.h6
2 files changed, 30 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 9b2aae0..24513d8 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -256,6 +256,30 @@ WebKit::WebFileError PlatformFileErrorToWebFileError(
}
}
+bool GetFileSystemPublicType(
+ const std::string type_string,
+ WebKit::WebFileSystem::Type* type) {
+ DCHECK(type);
+ if (type_string == "Temporary") {
+ *type = WebKit::WebFileSystem::TypeTemporary;
+ return true;
+ }
+ if (type_string == "Persistent") {
+ *type = WebKit::WebFileSystem::TypePersistent;
+ return true;
+ }
+ if (type_string == "Isolated") {
+ *type = WebKit::WebFileSystem::TypeIsolated;
+ return true;
+ }
+ if (type_string == "External") {
+ *type = WebKit::WebFileSystem::TypeExternal;
+ return true;
+ }
+ NOTREACHED();
+ return false;
+}
+
std::string GetIsolatedFileSystemName(const GURL& origin_url,
const std::string& filesystem_id) {
std::string name(fileapi::GetFileSystemName(origin_url,
diff --git a/webkit/fileapi/file_system_util.h b/webkit/fileapi/file_system_util.h
index 6ba6dee..ffefe57 100644
--- a/webkit/fileapi/file_system_util.h
+++ b/webkit/fileapi/file_system_util.h
@@ -102,6 +102,12 @@ WEBKIT_STORAGE_EXPORT GURL GetOriginURLFromIdentifier(
// Returns an empty string if the |type| is invalid.
WEBKIT_STORAGE_EXPORT std::string GetFileSystemTypeString(FileSystemType type);
+// Sets type to FileSystemType enum that corresponds to the string name.
+// Returns false if the |type_string| is invalid.
+WEBKIT_STORAGE_EXPORT bool GetFileSystemPublicType(
+ std::string type_string,
+ WebKit::WebFileSystem::Type* type);
+
// Encodes |file_path| to a string.
// Following conditions should be held:
// - StringToFilePath(FilePathToString(path)) == path