OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ |
6 #define CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ | 6 #define CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "webkit/fileapi/file_system_context.h" | 10 #include "webkit/fileapi/file_system_context.h" |
11 | 11 |
12 namespace fileapi { | 12 namespace fileapi { |
13 class ExternalMountPoints; | 13 class ExternalMountPoints; |
14 class FileSystemContext; | 14 class FileSystemContext; |
15 class FileSystemURL; | 15 class FileSystemURL; |
16 } | 16 } |
17 | 17 |
18 namespace quota { | 18 namespace quota { |
19 class SpecialStoragePolicy; | 19 class SpecialStoragePolicy; |
20 } | 20 } |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 // Helper method that returns FileSystemContext constructed for | 24 // Helper method that returns FileSystemContext constructed for |
25 // the browser process. | 25 // the browser process. |
| 26 // |
| 27 // |external_mount_points| contains non-system external mount points available |
| 28 // in the context. If not NULL, it will be used during URL cracking. On |
| 29 // ChromeOS, it will be passed to external_mount_point_provider. |
| 30 // |external_mount_points| may be NULL only on platforms different from |
| 31 // ChromeOS (i.e. platforms that don't use external_mount_point_provider). |
26 CONTENT_EXPORT scoped_refptr<fileapi::FileSystemContext> | 32 CONTENT_EXPORT scoped_refptr<fileapi::FileSystemContext> |
27 CreateFileSystemContext( | 33 CreateFileSystemContext( |
28 const base::FilePath& profile_path, | 34 const base::FilePath& partition_path, |
29 bool is_incognito, | 35 bool is_incognito, |
30 fileapi::ExternalMountPoints* external_mount_points, | 36 fileapi::ExternalMountPoints* external_mount_points, |
31 quota::SpecialStoragePolicy* special_storage_policy, | 37 quota::SpecialStoragePolicy* special_storage_policy, |
32 quota::QuotaManagerProxy* quota_manager_proxy); | 38 quota::QuotaManagerProxy* quota_manager_proxy); |
33 | 39 |
34 // Check whether a process has permission to access the file system URL. | 40 // Check whether a process has permission to access the file system URL. |
35 CONTENT_EXPORT bool CheckFileSystemPermissionsForProcess( | 41 CONTENT_EXPORT bool CheckFileSystemPermissionsForProcess( |
36 fileapi::FileSystemContext* context, | 42 fileapi::FileSystemContext* context, |
37 int process_id, | 43 int process_id, |
38 const fileapi::FileSystemURL& url, | 44 const fileapi::FileSystemURL& url, |
39 int permissions, | 45 int permissions, |
40 base::PlatformFileError* error); | 46 base::PlatformFileError* error); |
41 | 47 |
42 // Get the platform path from a file system URL. This needs to be called | 48 // Get the platform path from a file system URL. This needs to be called |
43 // on the FILE thread. | 49 // on the FILE thread. |
44 CONTENT_EXPORT void SyncGetPlatformPath(fileapi::FileSystemContext* context, | 50 CONTENT_EXPORT void SyncGetPlatformPath(fileapi::FileSystemContext* context, |
45 int process_id, | 51 int process_id, |
46 const GURL& path, | 52 const GURL& path, |
47 base::FilePath* platform_path); | 53 base::FilePath* platform_path); |
48 } // namespace content | 54 } // namespace content |
49 | 55 |
50 #endif // CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ | 56 #endif // CONTENT_BROWSER_FILEAPI_BROWSER_FILE_SYSTEM_HELPER_H_ |
OLD | NEW |