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

Side by Side Diff: ppapi/shared_impl/file_system_util.cc

Issue 26803004: PPAPI: Add PluginPrivateFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/file_system_util.h" 5 #include "ppapi/shared_impl/file_system_util.h"
6 6
7 #include "base/logging.h"
8
7 namespace ppapi { 9 namespace ppapi {
8 10
9 fileapi::FileSystemType PepperFileSystemTypeToFileSystemType( 11 fileapi::FileSystemType PepperFileSystemTypeToFileSystemType(
10 PP_FileSystemType type) { 12 PP_FileSystemType type) {
11 switch (type) { 13 switch (type) {
12 case PP_FILESYSTEMTYPE_LOCALTEMPORARY: 14 case PP_FILESYSTEMTYPE_LOCALTEMPORARY:
13 return fileapi::kFileSystemTypeTemporary; 15 return fileapi::kFileSystemTypeTemporary;
14 case PP_FILESYSTEMTYPE_LOCALPERSISTENT: 16 case PP_FILESYSTEMTYPE_LOCALPERSISTENT:
15 return fileapi::kFileSystemTypePersistent; 17 return fileapi::kFileSystemTypePersistent;
16 case PP_FILESYSTEMTYPE_EXTERNAL: 18 case PP_FILESYSTEMTYPE_EXTERNAL:
17 return fileapi::kFileSystemTypeExternal; 19 return fileapi::kFileSystemTypeExternal;
18 default: 20 default:
19 return fileapi::kFileSystemTypeUnknown; 21 return fileapi::kFileSystemTypeUnknown;
20 } 22 }
21 } 23 }
22 24
23 bool FileSystemTypeIsValid(PP_FileSystemType type) { 25 bool FileSystemTypeIsValid(PP_FileSystemType type) {
24 return (type == PP_FILESYSTEMTYPE_LOCALPERSISTENT || 26 return (type == PP_FILESYSTEMTYPE_LOCALPERSISTENT ||
25 type == PP_FILESYSTEMTYPE_LOCALTEMPORARY || 27 type == PP_FILESYSTEMTYPE_LOCALTEMPORARY ||
26 type == PP_FILESYSTEMTYPE_EXTERNAL || 28 type == PP_FILESYSTEMTYPE_EXTERNAL ||
27 type == PP_FILESYSTEMTYPE_ISOLATED); 29 type == PP_FILESYSTEMTYPE_ISOLATED);
28 } 30 }
29 31
30 bool FileSystemTypeHasQuota(PP_FileSystemType type) { 32 bool FileSystemTypeHasQuota(PP_FileSystemType type) {
31 return (type == PP_FILESYSTEMTYPE_LOCALTEMPORARY || 33 return (type == PP_FILESYSTEMTYPE_LOCALTEMPORARY ||
32 type == PP_FILESYSTEMTYPE_LOCALPERSISTENT); 34 type == PP_FILESYSTEMTYPE_LOCALPERSISTENT);
33 } 35 }
34 36
37 std::string IsolatedFileSystemTypeToRootName(
38 PP_IsolatedFileSystemType_Private type) {
39 switch (type) {
40 case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_CRX:
41 return "crxfs";
42 case PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE:
43 return "pluginprivate";
44 default:
45 NOTREACHED() << type;
46 return std::string();
47 }
48 }
49
35 } // namespace ppapi 50 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/shared_impl/file_system_util.h ('k') | ppapi/thunk/interfaces_ppb_private_no_permissions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698