summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_util.cc
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/fileapi/file_system_util.cc
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/fileapi/file_system_util.cc')
-rw-r--r--webkit/fileapi/file_system_util.cc24
1 files changed, 24 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,