OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ |
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 FileSystemPathManager::GetRootPathCallback* | 61 FileSystemPathManager::GetRootPathCallback* |
62 callback); | 62 callback); |
63 | 63 |
64 // Like GetFileSystemRootPath, but synchronous, and can be called only while | 64 // Like GetFileSystemRootPath, but synchronous, and can be called only while |
65 // running on the file thread. | 65 // running on the file thread. |
66 virtual FilePath GetFileSystemRootPathOnFileThread( | 66 virtual FilePath GetFileSystemRootPathOnFileThread( |
67 const GURL& origin_url, | 67 const GURL& origin_url, |
68 FileSystemType type, | 68 FileSystemType type, |
69 const FilePath& virtual_path, | 69 const FilePath& virtual_path, |
70 bool create); | 70 bool create); |
71 // Cracks the given |path|, retrieves the information embedded in the path | |
72 // and populates |origin_url|, |type| and |virtual_path|. The |virtual_path| | |
73 // is a sandboxed path in the file system, i.e. the relative path to the | |
74 // filesystem root for the given domain and type. | |
75 bool CrackFileSystemPath(const FilePath& path, | |
zel
2011/04/06 21:43:00
eric, my new CL relies heavily on this function -
ericu
2011/04/06 23:30:36
Right--now that we've only got URLs, not paths, th
| |
76 GURL* origin_url, | |
77 FileSystemType* type, | |
78 FilePath* virtual_path) const; | |
79 | 71 |
80 // Returns true if the given |url|'s scheme is allowed to access | 72 // Returns true if the given |url|'s scheme is allowed to access |
81 // filesystem. | 73 // filesystem. |
82 bool IsAllowedScheme(const GURL& url) const; | 74 bool IsAllowedScheme(const GURL& url) const; |
83 | 75 |
84 // Returns the string for the given |type|. | 76 // Returns the string for the given |type|. |
85 // Returns an empty string if the |type| is invalid. | 77 // Returns an empty string if the |type| is invalid. |
86 static std::string GetFileSystemTypeString(fileapi::FileSystemType type); | 78 static std::string GetFileSystemTypeString(fileapi::FileSystemType type); |
87 | 79 |
88 // Checks if a given |name| contains any restricted names/chars in it. | 80 // Checks if a given |name| contains any restricted names/chars in it. |
(...skipping 13 matching lines...) Expand all Loading... | |
102 const bool allow_file_access_from_files_; | 94 const bool allow_file_access_from_files_; |
103 scoped_ptr<SandboxMountPointProvider> sandbox_provider_; | 95 scoped_ptr<SandboxMountPointProvider> sandbox_provider_; |
104 scoped_ptr<FileSystemMountPointProvider> local_provider_; | 96 scoped_ptr<FileSystemMountPointProvider> local_provider_; |
105 | 97 |
106 DISALLOW_COPY_AND_ASSIGN(FileSystemPathManager); | 98 DISALLOW_COPY_AND_ASSIGN(FileSystemPathManager); |
107 }; | 99 }; |
108 | 100 |
109 } // namespace fileapi | 101 } // namespace fileapi |
110 | 102 |
111 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ | 103 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_PATH_MANAGER_H_ |
OLD | NEW |