Home | History | Annotate | Download | only in fileapi
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
      6 #define WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
      7 
      8 #include "third_party/WebKit/public/platform/WebFileSystemType.h"
      9 
     10 namespace fileapi {
     11 
     12 enum FileSystemType {
     13   // Indicates uninitialized or invalid filesystem type.
     14   kFileSystemTypeUnknown = -1,
     15 
     16   // ------------------------------------------------------------------------
     17   // Public FileSystem types, that are embedded in filesystem: URL and exposed
     18   // to WebKit/renderer. Both Chrome and WebKit know how to handle these types.
     19 
     20   // Following two types are for TEMPORARY or PERSISTENT filesystems that
     21   // can be used by webapps via standard app-facing API
     22   // as defined in File API: Directories and System.
     23   // http://www.w3.org/TR/file-system-api/#temporary-vs.-persistent-storage
     24   // They are sandboxed filesystems; all the files in the filesystems are
     25   // placed under the profile directory with path obfuscation and quota
     26   // enforcement.
     27   kFileSystemTypeTemporary = blink::WebFileSystemTypeTemporary,
     28   kFileSystemTypePersistent = blink::WebFileSystemTypePersistent,
     29 
     30   // Indicates non-sandboxed isolated filesystem.
     31   kFileSystemTypeIsolated = blink::WebFileSystemTypeIsolated,
     32 
     33   // Indicates filesystems that are mounted externally via
     34   // ExternalMountPoints with a well-known mount name.  The mounted
     35   // filesystems can be sandboxed or non-sandboxed.  (E.g. Chrome OS mounts
     36   // non-sandboxed removable media folder with a name 'removable', while
     37   // chrome.syncFileSystem mounts a sandboxed filesystem with a name
     38   // 'syncfs'.)
     39   kFileSystemTypeExternal = blink::WebFileSystemTypeExternal,
     40 
     41   // ------------------------------------------------------------------------
     42   // Marks the beginning of internal type enum. (This is not the actual fs type)
     43   kFileSystemInternalTypeEnumStart = 99,
     44 
     45   // Private FileSystem types, that should not appear in filesystem: URL as
     46   // WebKit has no idea how to handle those types.
     47   //
     48   // One can register (mount) a new file system with a private file system type
     49   // using IsolatedContext.  Files in such file systems can be accessed via
     50   // either Isolated or External public file system types (depending on
     51   // how the file system is registered).
     52   // See the comments for IsolatedContext and/or FileSystemURL for more details.
     53 
     54   // Should be used only for testing.
     55   kFileSystemTypeTest,
     56 
     57   // Indicates a local filesystem where we can access files using native
     58   // local path.
     59   kFileSystemTypeNativeLocal,
     60 
     61   // Indicates a local filesystem where we can access files using native
     62   // local path, but with restricted access.
     63   // Restricted native local file system is in read-only mode.
     64   kFileSystemTypeRestrictedNativeLocal,
     65 
     66   // Indicates a transient, isolated file system for dragged files (which could
     67   // contain multiple dragged paths in the virtual root).
     68   kFileSystemTypeDragged,
     69 
     70   // Indicates media filesystem which we can access with same manner to
     71   // regular filesystem.
     72   kFileSystemTypeNativeMedia,
     73 
     74   // Indicates media filesystem to which we need special protocol to access,
     75   // such as MTP or PTP.
     76   kFileSystemTypeDeviceMedia,
     77 
     78   // Indicates a Picasa virtual filesystem provided by Media Galleries API.
     79   kFileSystemTypePicasa,
     80 
     81   // Indicates a synthetic iTunes filesystem.
     82   kFileSystemTypeItunes,
     83 
     84   // Indicates a synthetic iPhoto filesystem.
     85   kFileSystemTypeIphoto,
     86 
     87   // Indicates a Drive filesystem which provides access to Google Drive.
     88   kFileSystemTypeDrive,
     89 
     90   // Indicates a Syncable sandboxed filesystem which can be backed by a
     91   // cloud storage service.
     92   kFileSystemTypeSyncable,
     93 
     94   // Indicates a special filesystem type for internal file sync operation
     95   // for Syncable sandboxed filesystems. The file system is overlayed, i.e.
     96   // points to the same sandboxed filesystem as that of kFileSystemTypeSyncable,
     97   // but the changes made with this filesystem type are not recorded for
     98   // further sync.
     99   kFileSystemTypeSyncableForInternalSync,
    100 
    101   // Indicates an external filesystem accessible by file paths from platform
    102   // Apps. As of writing, on non Chrome OS platform, this is merely a
    103   // kFileSystemTypeNativeLocal. On Chrome OS, the path is parsed by
    104   // the handlers of kFileSystemTypeExternal.
    105   kFileSystemTypeNativeForPlatformApp,
    106 
    107   // Indicates an isolated filesystem which is supposed to contain one
    108   // temporary which is supposed to go away when the last reference of
    109   // its snapshot is dropped.
    110   // This type is useful for creating a blob reference for a temporary
    111   // file which must go away when the blob's last reference is dropped.
    112   kFileSystemTypeForTransientFile,
    113 
    114   // Sandboxed private filesystem. This filesystem cannot be opened
    115   // via regular OpenFileSystem, and provides private filesystem space for
    116   // given identifier in each origin.
    117   kFileSystemTypePluginPrivate,
    118 
    119   // --------------------------------------------------------------------
    120   // Marks the end of internal type enum. (This is not the actual fs type)
    121   // New internal filesystem types must be added above this line.
    122   kFileSystemInternalTypeEnumEnd,
    123 };
    124 
    125 }  // namespace fileapi
    126 
    127 #endif  // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
    128