15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#ifndef STORAGE_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
61320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#define STORAGE_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "third_party/WebKit/public/platform/WebFileSystemType.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)namespace storage {
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)enum FileSystemType {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates uninitialized or invalid filesystem type.
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeUnknown = -1,
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ------------------------------------------------------------------------
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Public FileSystem types, that are embedded in filesystem: URL and exposed
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to WebKit/renderer. Both Chrome and WebKit know how to handle these types.
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Following two types are for TEMPORARY or PERSISTENT filesystems that
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // can be used by webapps via standard app-facing API
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // as defined in File API: Directories and System.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // http://www.w3.org/TR/file-system-api/#temporary-vs.-persistent-storage
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // They are sandboxed filesystems; all the files in the filesystems are
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // placed under the profile directory with path obfuscation and quota
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // enforcement.
27f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  kFileSystemTypeTemporary = blink::WebFileSystemTypeTemporary,
28f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  kFileSystemTypePersistent = blink::WebFileSystemTypePersistent,
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates non-sandboxed isolated filesystem.
31f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  kFileSystemTypeIsolated = blink::WebFileSystemTypeIsolated,
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Indicates filesystems that are mounted externally via
34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // ExternalMountPoints with a well-known mount name.  The mounted
35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // filesystems can be sandboxed or non-sandboxed.  (E.g. Chrome OS mounts
36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // non-sandboxed removable media folder with a name 'removable', while
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // chrome.syncFileSystem mounts a sandboxed filesystem with a name
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // 'syncfs'.)
39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  kFileSystemTypeExternal = blink::WebFileSystemTypeExternal,
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // ------------------------------------------------------------------------
42c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // Marks the beginning of internal type enum. (This is not the actual fs type)
43c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  kFileSystemInternalTypeEnumStart = 99,
44c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Private FileSystem types, that should not appear in filesystem: URL as
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // WebKit has no idea how to handle those types.
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  //
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // One can register (mount) a new file system with a private file system type
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // using IsolatedContext.  Files in such file systems can be accessed via
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // either Isolated or External public file system types (depending on
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // how the file system is registered).
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // See the comments for IsolatedContext and/or FileSystemURL for more details.
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Should be used only for testing.
55c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  kFileSystemTypeTest,
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates a local filesystem where we can access files using native
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // local path.
595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeNativeLocal,
605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates a local filesystem where we can access files using native
625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // local path, but with restricted access.
635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Restricted native local file system is in read-only mode.
645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeRestrictedNativeLocal,
655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates a transient, isolated file system for dragged files (which could
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // contain multiple dragged paths in the virtual root).
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeDragged,
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates media filesystem which we can access with same manner to
715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // regular filesystem.
725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeNativeMedia,
735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates media filesystem to which we need special protocol to access,
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // such as MTP or PTP.
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeDeviceMedia,
775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
7890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // Indicates a Picasa virtual filesystem provided by Media Galleries API.
7990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  kFileSystemTypePicasa,
8090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
81b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  // Indicates a synthetic iTunes filesystem.
82b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)  kFileSystemTypeItunes,
83b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)
8468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  // Indicates a synthetic iPhoto filesystem.
8568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)  kFileSystemTypeIphoto,
8668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles)
875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates a Drive filesystem which provides access to Google Drive.
885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeDrive,
895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates a Syncable sandboxed filesystem which can be backed by a
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // cloud storage service.
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  kFileSystemTypeSyncable,
932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
94868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Indicates a special filesystem type for internal file sync operation
95868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // for Syncable sandboxed filesystems. The file system is overlayed, i.e.
96868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // points to the same sandboxed filesystem as that of kFileSystemTypeSyncable,
97868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // but the changes made with this filesystem type are not recorded for
98868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // further sync.
99868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  kFileSystemTypeSyncableForInternalSync,
100868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Indicates an external filesystem accessible by file paths from platform
1022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Apps. As of writing, on non Chrome OS platform, this is merely a
1032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // kFileSystemTypeNativeLocal. On Chrome OS, the path is parsed by
1042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // the handlers of kFileSystemTypeExternal.
1052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  kFileSystemTypeNativeForPlatformApp,
106c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
107a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  // Indicates an isolated filesystem which is supposed to contain one
108a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  // temporary which is supposed to go away when the last reference of
109a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  // its snapshot is dropped.
110a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  // This type is useful for creating a blob reference for a temporary
111a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  // file which must go away when the blob's last reference is dropped.
112a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  kFileSystemTypeForTransientFile,
113a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)
1148bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  // Sandboxed private filesystem. This filesystem cannot be opened
1158bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  // via regular OpenFileSystem, and provides private filesystem space for
1168bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  // given identifier in each origin.
1178bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)  kFileSystemTypePluginPrivate,
1188bcbed890bc3ce4d7a057a8f32cab53fa534672eTorne (Richard Coles)
1195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  // A filesystem that is mounted via the Privet storage protocol.
1205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  kFileSystemTypeCloudDevice,
1215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
122effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch  // A filesystem that is mounted via the FileSystemProvider API.
123effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch  kFileSystemTypeProvided,
124effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch
1255c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu  // A media filesystem such as MTP or PTP, mounted as a file storage not
1265c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu  // limited to media files.
1275c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu  kFileSystemTypeDeviceMediaAsFileStorage,
1285c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu
129c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // --------------------------------------------------------------------
130c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // Marks the end of internal type enum. (This is not the actual fs type)
131c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  // New internal filesystem types must be added above this line.
132c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  kFileSystemInternalTypeEnumEnd,
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)};
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
13503b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles)}  // namespace storage
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1371320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#endif  // STORAGE_COMMON_FILEAPI_FILE_SYSTEM_TYPES_H_
138