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

Side by Side Diff: storage/browser/fileapi/file_system_url.h

Issue 442383002: Move storage-related files from webkit/ to new top-level directory storage/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months 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 (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 WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_ 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 #include "webkit/browser/webkit_storage_browser_export.h" 13 #include "storage/common/storage_export.h"
14 #include "webkit/common/fileapi/file_system_mount_option.h" 14 #include "storage/common/fileapi/file_system_mount_option.h"
15 #include "webkit/common/fileapi/file_system_types.h" 15 #include "storage/common/fileapi/file_system_types.h"
16 16
17 namespace fileapi { 17 namespace storage {
18 18
19 // A class representing a filesystem URL which consists of origin URL, 19 // A class representing a filesystem URL which consists of origin URL,
20 // type and an internal path used inside the filesystem. 20 // type and an internal path used inside the filesystem.
21 // 21 //
22 // When a FileSystemURL instance is created for a GURL (for filesystem: scheme), 22 // When a FileSystemURL instance is created for a GURL (for filesystem: scheme),
23 // each accessor method would return following values: 23 // each accessor method would return following values:
24 // 24 //
25 // Example: For a URL 'filesystem:http://foo.com/temporary/foo/bar': 25 // Example: For a URL 'filesystem:http://foo.com/temporary/foo/bar':
26 // origin() returns 'http://foo.com', 26 // origin() returns 'http://foo.com',
27 // mount_type() returns kFileSystemTypeTemporary, 27 // mount_type() returns kFileSystemTypeTemporary,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // <Friend>::CrackURL, <Friend>::CreateCrackedFileSystemURL, where <Friend> is 68 // <Friend>::CrackURL, <Friend>::CreateCrackedFileSystemURL, where <Friend> is
69 // one of the friended classes. 69 // one of the friended classes.
70 // 70 //
71 // TODO(ericu): Look into making virtual_path() [and all FileSystem API virtual 71 // TODO(ericu): Look into making virtual_path() [and all FileSystem API virtual
72 // paths] just an std::string, to prevent platform-specific base::FilePath 72 // paths] just an std::string, to prevent platform-specific base::FilePath
73 // behavior from getting invoked by accident. Currently the base::FilePath 73 // behavior from getting invoked by accident. Currently the base::FilePath
74 // returned here needs special treatment, as it may contain paths that are 74 // returned here needs special treatment, as it may contain paths that are
75 // illegal on the current platform. 75 // illegal on the current platform.
76 // To avoid problems, use VirtualPath::BaseName and 76 // To avoid problems, use VirtualPath::BaseName and
77 // VirtualPath::GetComponents instead of the base::FilePath methods. 77 // VirtualPath::GetComponents instead of the base::FilePath methods.
78 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemURL { 78 class STORAGE_EXPORT FileSystemURL {
79 public: 79 public:
80 FileSystemURL(); 80 FileSystemURL();
81 ~FileSystemURL(); 81 ~FileSystemURL();
82 82
83 // Methods for creating FileSystemURL without attempting to crack them. 83 // Methods for creating FileSystemURL without attempting to crack them.
84 // Should be used only in tests. 84 // Should be used only in tests.
85 static FileSystemURL CreateForTest(const GURL& url); 85 static FileSystemURL CreateForTest(const GURL& url);
86 static FileSystemURL CreateForTest(const GURL& origin, 86 static FileSystemURL CreateForTest(const GURL& origin,
87 FileSystemType mount_type, 87 FileSystemType mount_type,
88 const base::FilePath& virtual_path); 88 const base::FilePath& virtual_path);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 std::string DebugString() const; 121 std::string DebugString() const;
122 122
123 // Returns true if this URL is a strict parent of the |child|. 123 // Returns true if this URL is a strict parent of the |child|.
124 bool IsParent(const FileSystemURL& child) const; 124 bool IsParent(const FileSystemURL& child) const;
125 125
126 bool IsInSameFileSystem(const FileSystemURL& other) const; 126 bool IsInSameFileSystem(const FileSystemURL& other) const;
127 127
128 bool operator==(const FileSystemURL& that) const; 128 bool operator==(const FileSystemURL& that) const;
129 129
130 bool operator!=(const FileSystemURL& that) const { 130 bool operator!=(const FileSystemURL& that) const { return !(*this == that); }
131 return !(*this == that);
132 }
133 131
134 struct WEBKIT_STORAGE_BROWSER_EXPORT Comparator { 132 struct STORAGE_EXPORT Comparator {
135 bool operator() (const FileSystemURL& lhs, const FileSystemURL& rhs) const; 133 bool operator()(const FileSystemURL& lhs, const FileSystemURL& rhs) const;
136 }; 134 };
137 135
138 private: 136 private:
139 friend class FileSystemContext; 137 friend class FileSystemContext;
140 friend class ExternalMountPoints; 138 friend class ExternalMountPoints;
141 friend class IsolatedContext; 139 friend class IsolatedContext;
142 140
143 explicit FileSystemURL(const GURL& filesystem_url); 141 explicit FileSystemURL(const GURL& filesystem_url);
144 FileSystemURL(const GURL& origin, 142 FileSystemURL(const GURL& origin,
145 FileSystemType mount_type, 143 FileSystemType mount_type,
(...skipping 22 matching lines...) Expand all
168 // and the low-level file operation should be implemented with the latter. 166 // and the low-level file operation should be implemented with the latter.
169 std::string mount_filesystem_id_; 167 std::string mount_filesystem_id_;
170 FileSystemType type_; 168 FileSystemType type_;
171 base::FilePath path_; 169 base::FilePath path_;
172 std::string filesystem_id_; 170 std::string filesystem_id_;
173 FileSystemMountOption mount_option_; 171 FileSystemMountOption mount_option_;
174 }; 172 };
175 173
176 typedef std::set<FileSystemURL, FileSystemURL::Comparator> FileSystemURLSet; 174 typedef std::set<FileSystemURL, FileSystemURL::Comparator> FileSystemURLSet;
177 175
178 } // namespace fileapi 176 } // namespace storage
179 177
180 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_ 178 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_URL_H_
OLDNEW
« no previous file with comments | « storage/browser/fileapi/file_system_quota_util.h ('k') | storage/browser/fileapi/file_system_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698