OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "webkit/fileapi/local_file_system_file_util.h" | 5 #include "webkit/fileapi/local_file_util.h" |
6 | 6 |
7 #include "base/file_util_proxy.h" | 7 #include "base/file_util_proxy.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "webkit/fileapi/file_system_context.h" | 9 #include "webkit/fileapi/file_system_context.h" |
10 #include "webkit/fileapi/file_system_operation_context.h" | 10 #include "webkit/fileapi/file_system_operation_context.h" |
11 #include "webkit/fileapi/file_system_path_manager.h" | 11 #include "webkit/fileapi/file_system_path_manager.h" |
12 #include "webkit/fileapi/file_system_types.h" | 12 #include "webkit/fileapi/file_system_types.h" |
13 #include "webkit/fileapi/file_system_util.h" | 13 #include "webkit/fileapi/file_system_util.h" |
14 | 14 |
15 namespace fileapi { | 15 namespace fileapi { |
16 | 16 |
17 LocalFileSystemFileUtil::LocalFileSystemFileUtil( | 17 class LocalFileEnumerator : public FileSystemFileUtil::AbstractFileEnumerator { |
18 FileSystemFileUtil* underlying_file_util) | 18 public: |
19 : underlying_file_util_(underlying_file_util) { | 19 LocalFileEnumerator(const FilePath& platform_root_path, |
| 20 const FilePath& virtual_root_path, |
| 21 bool recursive, |
| 22 file_util::FileEnumerator::FileType file_type) |
| 23 : file_enum_(platform_root_path, recursive, file_type), |
| 24 platform_root_path_(platform_root_path), |
| 25 virtual_root_path_(virtual_root_path) { |
| 26 } |
| 27 |
| 28 ~LocalFileEnumerator() {} |
| 29 |
| 30 virtual FilePath Next() OVERRIDE; |
| 31 virtual int64 Size() OVERRIDE; |
| 32 virtual bool IsDirectory() OVERRIDE; |
| 33 |
| 34 private: |
| 35 file_util::FileEnumerator file_enum_; |
| 36 file_util::FileEnumerator::FindInfo file_util_info_; |
| 37 FilePath platform_root_path_; |
| 38 FilePath virtual_root_path_; |
| 39 }; |
| 40 |
| 41 FilePath LocalFileEnumerator::Next() { |
| 42 FilePath next = file_enum_.Next(); |
| 43 if (next.empty()) |
| 44 return next; |
| 45 file_enum_.GetFindInfo(&file_util_info_); |
| 46 |
| 47 FilePath path; |
| 48 platform_root_path_.AppendRelativePath(next, &path); |
| 49 return virtual_root_path_.Append(path); |
20 } | 50 } |
21 | 51 |
22 LocalFileSystemFileUtil::~LocalFileSystemFileUtil() { | 52 int64 LocalFileEnumerator::Size() { |
| 53 return file_util::FileEnumerator::GetFilesize(file_util_info_); |
23 } | 54 } |
24 | 55 |
25 PlatformFileError LocalFileSystemFileUtil::CreateOrOpen( | 56 bool LocalFileEnumerator::IsDirectory() { |
| 57 return file_util::FileEnumerator::IsDirectory(file_util_info_); |
| 58 } |
| 59 |
| 60 LocalFileUtil::LocalFileUtil(FileSystemFileUtil* underlying_file_util) |
| 61 : FileSystemFileUtil(underlying_file_util) { |
| 62 } |
| 63 |
| 64 LocalFileUtil::~LocalFileUtil() { |
| 65 } |
| 66 |
| 67 PlatformFileError LocalFileUtil::CreateOrOpen( |
26 FileSystemOperationContext* context, | 68 FileSystemOperationContext* context, |
27 const FilePath& file_path, int file_flags, | 69 const FilePath& file_path, int file_flags, |
28 PlatformFile* file_handle, bool* created) { | 70 PlatformFile* file_handle, bool* created) { |
29 FilePath local_path = | 71 FilePath local_path = |
30 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 72 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
31 file_path); | 73 file_path); |
32 if (local_path.empty()) | 74 if (local_path.empty()) |
33 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 75 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
34 return underlying_file_util_->CreateOrOpen( | 76 return underlying_file_util()->CreateOrOpen( |
35 context, local_path, file_flags, file_handle, created); | 77 context, local_path, file_flags, file_handle, created); |
36 } | 78 } |
37 | 79 |
38 PlatformFileError LocalFileSystemFileUtil::EnsureFileExists( | 80 PlatformFileError LocalFileUtil::EnsureFileExists( |
39 FileSystemOperationContext* context, | 81 FileSystemOperationContext* context, |
40 const FilePath& file_path, | 82 const FilePath& file_path, |
41 bool* created) { | 83 bool* created) { |
42 FilePath local_path = | 84 FilePath local_path = |
43 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 85 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
44 file_path); | 86 file_path); |
45 if (local_path.empty()) | 87 if (local_path.empty()) |
46 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 88 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
47 return underlying_file_util_->EnsureFileExists( | 89 return underlying_file_util()->EnsureFileExists( |
48 context, local_path, created); | 90 context, local_path, created); |
49 } | 91 } |
50 | 92 |
51 PlatformFileError LocalFileSystemFileUtil::GetLocalFilePath( | 93 PlatformFileError LocalFileUtil::CreateDirectory( |
52 FileSystemOperationContext* context, | 94 FileSystemOperationContext* context, |
53 const FilePath& virtual_path, | 95 const FilePath& file_path, |
54 FilePath* local_path) { | 96 bool exclusive, |
55 FilePath path = | 97 bool recursive) { |
| 98 FilePath local_path = |
56 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 99 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
57 virtual_path); | 100 file_path); |
58 if (path.empty()) | 101 if (local_path.empty()) |
59 return base::PLATFORM_FILE_ERROR_NOT_FOUND; | 102 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
60 | 103 return underlying_file_util()->CreateDirectory( |
61 *local_path = path; | 104 context, local_path, exclusive, recursive); |
62 return base::PLATFORM_FILE_OK; | |
63 } | 105 } |
64 | 106 |
65 PlatformFileError LocalFileSystemFileUtil::GetFileInfo( | 107 PlatformFileError LocalFileUtil::GetFileInfo( |
66 FileSystemOperationContext* context, | 108 FileSystemOperationContext* context, |
67 const FilePath& file_path, | 109 const FilePath& file_path, |
68 base::PlatformFileInfo* file_info, | 110 base::PlatformFileInfo* file_info, |
69 FilePath* platform_file_path) { | 111 FilePath* platform_file_path) { |
70 FilePath local_path = | 112 FilePath local_path = |
71 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 113 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
72 file_path); | 114 file_path); |
73 if (local_path.empty()) | 115 if (local_path.empty()) |
74 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 116 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
75 return underlying_file_util_->GetFileInfo( | 117 return underlying_file_util()->GetFileInfo( |
76 context, local_path, file_info, platform_file_path); | 118 context, local_path, file_info, platform_file_path); |
77 } | 119 } |
78 | 120 |
79 PlatformFileError LocalFileSystemFileUtil::ReadDirectory( | 121 PlatformFileError LocalFileUtil::ReadDirectory( |
80 FileSystemOperationContext* context, | 122 FileSystemOperationContext* context, |
81 const FilePath& file_path, | 123 const FilePath& file_path, |
82 std::vector<base::FileUtilProxy::Entry>* entries) { | 124 std::vector<base::FileUtilProxy::Entry>* entries) { |
83 // TODO(kkanetkar): Implement directory read in multiple chunks. | 125 // TODO(kkanetkar): Implement directory read in multiple chunks. |
84 FilePath local_path = | 126 FilePath local_path = |
85 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 127 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
86 file_path); | 128 file_path); |
87 if (local_path.empty()) | 129 if (local_path.empty()) |
88 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 130 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
89 return underlying_file_util_->ReadDirectory( | 131 return underlying_file_util()->ReadDirectory( |
90 context, local_path, entries); | 132 context, local_path, entries); |
91 } | 133 } |
92 | 134 |
93 PlatformFileError LocalFileSystemFileUtil::CreateDirectory( | 135 FileSystemFileUtil::AbstractFileEnumerator* LocalFileUtil::CreateFileEnumerator( |
94 FileSystemOperationContext* context, | 136 FileSystemOperationContext* context, |
95 const FilePath& file_path, | 137 const FilePath& root_path) { |
96 bool exclusive, | |
97 bool recursive) { | |
98 FilePath local_path = | 138 FilePath local_path = |
99 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 139 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
100 file_path); | 140 root_path); |
101 if (local_path.empty()) | 141 if (local_path.empty()) |
102 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 142 return new EmptyFileEnumerator(); |
103 return underlying_file_util_->CreateDirectory( | 143 return new LocalFileEnumerator( |
104 context, local_path, exclusive, recursive); | 144 local_path, root_path, true, |
| 145 static_cast<file_util::FileEnumerator::FileType>( |
| 146 file_util::FileEnumerator::FILES | |
| 147 file_util::FileEnumerator::DIRECTORIES)); |
105 } | 148 } |
106 | 149 |
107 PlatformFileError LocalFileSystemFileUtil::CopyOrMoveFile( | 150 PlatformFileError LocalFileUtil::GetLocalFilePath( |
108 FileSystemOperationContext* context, | 151 FileSystemOperationContext* context, |
109 const FilePath& src_file_path, | 152 const FilePath& virtual_path, |
110 const FilePath& dest_file_path, | 153 FilePath* local_path) { |
111 bool copy) { | 154 FilePath path = |
112 // TODO(ericu): If they share a root URL, this could be optimized. | |
113 FilePath local_src_path = | |
114 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 155 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
115 src_file_path); | 156 virtual_path); |
116 if (local_src_path.empty()) | 157 if (path.empty()) |
117 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 158 return base::PLATFORM_FILE_ERROR_NOT_FOUND; |
118 FilePath local_dest_path = | 159 |
119 GetLocalPath(context, context->dest_origin_url(), context->dest_type(), | 160 *local_path = path; |
120 dest_file_path); | 161 return base::PLATFORM_FILE_OK; |
121 if (local_dest_path.empty()) | |
122 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | |
123 return underlying_file_util_->CopyOrMoveFile( | |
124 context, local_src_path, local_dest_path, copy); | |
125 } | 162 } |
126 | 163 |
127 // TODO(dmikurube): Make it independent from CopyOrMoveFile. | 164 PlatformFileError LocalFileUtil::Touch( |
128 PlatformFileError LocalFileSystemFileUtil::CopyInForeignFile( | |
129 FileSystemOperationContext* context, | |
130 const FilePath& src_file_path, | |
131 const FilePath& dest_file_path) { | |
132 if (src_file_path.empty()) | |
133 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | |
134 FilePath local_dest_path = | |
135 GetLocalPath(context, context->dest_origin_url(), context->dest_type(), | |
136 dest_file_path); | |
137 if (local_dest_path.empty()) | |
138 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | |
139 return underlying_file_util_->CopyOrMoveFile( | |
140 context, src_file_path, local_dest_path, true); | |
141 } | |
142 | |
143 PlatformFileError LocalFileSystemFileUtil::DeleteFile( | |
144 FileSystemOperationContext* context, | |
145 const FilePath& file_path) { | |
146 FilePath local_path = | |
147 GetLocalPath(context, context->src_origin_url(), context->src_type(), | |
148 file_path); | |
149 if (local_path.empty()) | |
150 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | |
151 return underlying_file_util_->DeleteFile( | |
152 context, local_path); | |
153 } | |
154 | |
155 PlatformFileError LocalFileSystemFileUtil::DeleteSingleDirectory( | |
156 FileSystemOperationContext* context, | |
157 const FilePath& file_path) { | |
158 FilePath local_path = | |
159 GetLocalPath(context, context->src_origin_url(), context->src_type(), | |
160 file_path); | |
161 if (local_path.empty()) | |
162 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | |
163 return underlying_file_util_->DeleteSingleDirectory( | |
164 context, local_path); | |
165 } | |
166 | |
167 PlatformFileError LocalFileSystemFileUtil::Touch( | |
168 FileSystemOperationContext* context, | 165 FileSystemOperationContext* context, |
169 const FilePath& file_path, | 166 const FilePath& file_path, |
170 const base::Time& last_access_time, | 167 const base::Time& last_access_time, |
171 const base::Time& last_modified_time) { | 168 const base::Time& last_modified_time) { |
172 FilePath local_path = | 169 FilePath local_path = |
173 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 170 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
174 file_path); | 171 file_path); |
175 if (local_path.empty()) | 172 if (local_path.empty()) |
176 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 173 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
177 return underlying_file_util_->Touch( | 174 return underlying_file_util()->Touch( |
178 context, local_path, last_access_time, last_modified_time); | 175 context, local_path, last_access_time, last_modified_time); |
179 } | 176 } |
180 | 177 |
181 PlatformFileError LocalFileSystemFileUtil::Truncate( | 178 PlatformFileError LocalFileUtil::Truncate( |
182 FileSystemOperationContext* context, | 179 FileSystemOperationContext* context, |
183 const FilePath& file_path, | 180 const FilePath& file_path, |
184 int64 length) { | 181 int64 length) { |
185 FilePath local_path = | 182 FilePath local_path = |
186 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 183 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
187 file_path); | 184 file_path); |
188 if (local_path.empty()) | 185 if (local_path.empty()) |
189 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; | 186 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
190 return underlying_file_util_->Truncate( | 187 return underlying_file_util()->Truncate( |
191 context, local_path, length); | 188 context, local_path, length); |
192 } | 189 } |
193 | 190 |
194 bool LocalFileSystemFileUtil::PathExists( | 191 bool LocalFileUtil::PathExists( |
195 FileSystemOperationContext* context, | 192 FileSystemOperationContext* context, |
196 const FilePath& file_path) { | 193 const FilePath& file_path) { |
197 FilePath local_path = | 194 FilePath local_path = |
198 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 195 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
199 file_path); | 196 file_path); |
200 if (local_path.empty()) | 197 if (local_path.empty()) |
201 return false; | 198 return false; |
202 return underlying_file_util_->PathExists( | 199 return underlying_file_util()->PathExists( |
203 context, local_path); | 200 context, local_path); |
204 } | 201 } |
205 | 202 |
206 bool LocalFileSystemFileUtil::DirectoryExists( | 203 bool LocalFileUtil::DirectoryExists( |
207 FileSystemOperationContext* context, | 204 FileSystemOperationContext* context, |
208 const FilePath& file_path) { | 205 const FilePath& file_path) { |
209 FilePath local_path = | 206 FilePath local_path = |
210 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 207 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
211 file_path); | 208 file_path); |
212 if (local_path.empty()) | 209 if (local_path.empty()) |
213 return false; | 210 return false; |
214 return underlying_file_util_->DirectoryExists( | 211 return underlying_file_util()->DirectoryExists( |
215 context, local_path); | 212 context, local_path); |
216 } | 213 } |
217 | 214 |
218 bool LocalFileSystemFileUtil::IsDirectoryEmpty( | 215 bool LocalFileUtil::IsDirectoryEmpty( |
219 FileSystemOperationContext* context, | 216 FileSystemOperationContext* context, |
220 const FilePath& file_path) { | 217 const FilePath& file_path) { |
221 FilePath local_path = | 218 FilePath local_path = |
222 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 219 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
223 file_path); | 220 file_path); |
224 if (local_path.empty()) | 221 if (local_path.empty()) |
225 return true; | 222 return true; |
226 return underlying_file_util_->IsDirectoryEmpty( | 223 return underlying_file_util()->IsDirectoryEmpty( |
227 context, local_path); | 224 context, local_path); |
228 } | 225 } |
229 | 226 |
230 class LocalFileSystemFileEnumerator | 227 PlatformFileError LocalFileUtil::CopyOrMoveFile( |
231 : public FileSystemFileUtil::AbstractFileEnumerator { | 228 FileSystemOperationContext* context, |
232 public: | 229 const FilePath& src_file_path, |
233 LocalFileSystemFileEnumerator(const FilePath& platform_root_path, | 230 const FilePath& dest_file_path, |
234 const FilePath& virtual_root_path, | 231 bool copy) { |
235 bool recursive, | 232 // TODO(ericu): If they share a root URL, this could be optimized. |
236 file_util::FileEnumerator::FileType file_type) | 233 FilePath local_src_path = |
237 : file_enum_(platform_root_path, recursive, file_type), | 234 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
238 platform_root_path_(platform_root_path), | 235 src_file_path); |
239 virtual_root_path_(virtual_root_path) { | 236 if (local_src_path.empty()) |
240 } | 237 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
241 | 238 FilePath local_dest_path = |
242 ~LocalFileSystemFileEnumerator() {} | 239 GetLocalPath(context, context->dest_origin_url(), context->dest_type(), |
243 | 240 dest_file_path); |
244 virtual FilePath Next() OVERRIDE; | 241 if (local_dest_path.empty()) |
245 virtual int64 Size() OVERRIDE; | 242 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
246 virtual bool IsDirectory() OVERRIDE; | 243 return underlying_file_util()->CopyOrMoveFile( |
247 | 244 context, local_src_path, local_dest_path, copy); |
248 private: | |
249 file_util::FileEnumerator file_enum_; | |
250 file_util::FileEnumerator::FindInfo file_util_info_; | |
251 FilePath platform_root_path_; | |
252 FilePath virtual_root_path_; | |
253 }; | |
254 | |
255 FilePath LocalFileSystemFileEnumerator::Next() { | |
256 FilePath next = file_enum_.Next(); | |
257 if (next.empty()) | |
258 return next; | |
259 file_enum_.GetFindInfo(&file_util_info_); | |
260 | |
261 FilePath path; | |
262 platform_root_path_.AppendRelativePath(next, &path); | |
263 return virtual_root_path_.Append(path); | |
264 } | 245 } |
265 | 246 |
266 int64 LocalFileSystemFileEnumerator::Size() { | 247 // TODO(dmikurube): Make it independent from CopyOrMoveFile. |
267 return file_util::FileEnumerator::GetFilesize(file_util_info_); | 248 PlatformFileError LocalFileUtil::CopyInForeignFile( |
| 249 FileSystemOperationContext* context, |
| 250 const FilePath& src_file_path, |
| 251 const FilePath& dest_file_path) { |
| 252 if (src_file_path.empty()) |
| 253 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
| 254 FilePath local_dest_path = |
| 255 GetLocalPath(context, context->dest_origin_url(), context->dest_type(), |
| 256 dest_file_path); |
| 257 if (local_dest_path.empty()) |
| 258 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
| 259 return underlying_file_util()->CopyOrMoveFile( |
| 260 context, src_file_path, local_dest_path, true); |
268 } | 261 } |
269 | 262 |
270 bool LocalFileSystemFileEnumerator::IsDirectory() { | 263 PlatformFileError LocalFileUtil::DeleteFile( |
271 return file_util::FileEnumerator::IsDirectory(file_util_info_); | 264 FileSystemOperationContext* context, |
| 265 const FilePath& file_path) { |
| 266 FilePath local_path = |
| 267 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
| 268 file_path); |
| 269 if (local_path.empty()) |
| 270 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
| 271 return underlying_file_util()->DeleteFile( |
| 272 context, local_path); |
272 } | 273 } |
273 | 274 |
274 FileSystemFileUtil::AbstractFileEnumerator* | 275 PlatformFileError LocalFileUtil::DeleteSingleDirectory( |
275 LocalFileSystemFileUtil::CreateFileEnumerator( | |
276 FileSystemOperationContext* context, | 276 FileSystemOperationContext* context, |
277 const FilePath& root_path) { | 277 const FilePath& file_path) { |
278 FilePath local_path = | 278 FilePath local_path = |
279 GetLocalPath(context, context->src_origin_url(), context->src_type(), | 279 GetLocalPath(context, context->src_origin_url(), context->src_type(), |
280 root_path); | 280 file_path); |
281 if (local_path.empty()) | 281 if (local_path.empty()) |
282 return new EmptyFileEnumerator(); | 282 return base::PLATFORM_FILE_ERROR_INVALID_OPERATION; |
283 return new LocalFileSystemFileEnumerator( | 283 return underlying_file_util()->DeleteSingleDirectory( |
284 local_path, root_path, true, | 284 context, local_path); |
285 static_cast<file_util::FileEnumerator::FileType>( | |
286 file_util::FileEnumerator::FILES | | |
287 file_util::FileEnumerator::DIRECTORIES)); | |
288 } | 285 } |
289 | 286 |
290 FilePath LocalFileSystemFileUtil::GetLocalPath( | 287 FilePath LocalFileUtil::GetLocalPath( |
291 FileSystemOperationContext* context, | 288 FileSystemOperationContext* context, |
292 const GURL& origin_url, | 289 const GURL& origin_url, |
293 FileSystemType type, | 290 FileSystemType type, |
294 const FilePath& virtual_path) { | 291 const FilePath& virtual_path) { |
295 FilePath root = context->file_system_context()->path_manager()-> | 292 FilePath root = context->file_system_context()->path_manager()-> |
296 ValidateFileSystemRootAndGetPathOnFileThread(origin_url, type, | 293 ValidateFileSystemRootAndGetPathOnFileThread(origin_url, type, |
297 virtual_path, false); | 294 virtual_path, false); |
298 if (root.empty()) | 295 if (root.empty()) |
299 return FilePath(); | 296 return FilePath(); |
300 return root.Append(virtual_path); | 297 return root.Append(virtual_path); |
301 } | 298 } |
302 | 299 |
303 } // namespace fileapi | 300 } // namespace fileapi |
OLD | NEW |