Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(676)

Unified Diff: ppapi/shared_impl/file_system_util.cc

Issue 58853009: Pepper: Add shared Utilities for file systems. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsValid function. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/file_system_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/file_system_util.cc
diff --git a/ppapi/shared_impl/file_system_util.cc b/ppapi/shared_impl/file_system_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..27bcf7b39d0ab54e79085fa7de46e3739e6842ea
--- /dev/null
+++ b/ppapi/shared_impl/file_system_util.cc
@@ -0,0 +1,35 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/shared_impl/file_system_util.h"
+
+namespace ppapi {
+
+fileapi::FileSystemType PepperFileSystemTypeToFileSystemType(
+ PP_FileSystemType type) {
+ switch (type) {
+ case PP_FILESYSTEMTYPE_LOCALTEMPORARY:
+ return fileapi::kFileSystemTypeTemporary;
+ case PP_FILESYSTEMTYPE_LOCALPERSISTENT:
+ return fileapi::kFileSystemTypePersistent;
+ case PP_FILESYSTEMTYPE_EXTERNAL:
+ return fileapi::kFileSystemTypeExternal;
+ default:
+ return fileapi::kFileSystemTypeUnknown;
+ }
+}
+
+bool FileSystemTypeIsValid(PP_FileSystemType type) {
+ return (type == PP_FILESYSTEMTYPE_LOCALPERSISTENT ||
+ type == PP_FILESYSTEMTYPE_LOCALTEMPORARY ||
+ type == PP_FILESYSTEMTYPE_EXTERNAL ||
+ type == PP_FILESYSTEMTYPE_ISOLATED);
+}
+
+bool FileSystemTypeHasQuota(PP_FileSystemType type) {
+ return (type == PP_FILESYSTEMTYPE_LOCALTEMPORARY ||
+ type == PP_FILESYSTEMTYPE_LOCALPERSISTENT);
+}
+
+} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/file_system_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698