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 #include "webkit/fileapi/file_system_path_manager.h" | 5 #include "webkit/fileapi/file_system_path_manager.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if (type == fileapi::kFileSystemTypeTemporary) | 209 if (type == fileapi::kFileSystemTypeTemporary) |
210 type_string = kTemporaryName; | 210 type_string = kTemporaryName; |
211 else if (type == fileapi::kFileSystemTypePersistent) | 211 else if (type == fileapi::kFileSystemTypePersistent) |
212 type_string = kPersistentName; | 212 type_string = kPersistentName; |
213 DCHECK(!type_string.empty()); | 213 DCHECK(!type_string.empty()); |
214 | 214 |
215 FilePath origin_base_path = base_path_.AppendASCII(storage_identifier) | 215 FilePath origin_base_path = base_path_.AppendASCII(storage_identifier) |
216 .AppendASCII(type_string); | 216 .AppendASCII(type_string); |
217 std::string name = storage_identifier + ":" + type_string; | 217 std::string name = storage_identifier + ":" + type_string; |
218 | 218 |
219 scoped_refptr<GetFileSystemRootPathTask> task = | 219 scoped_refptr<GetFileSystemRootPathTask> task( |
220 new GetFileSystemRootPathTask(file_message_loop_, | 220 new GetFileSystemRootPathTask(file_message_loop_, |
221 name, callback.release()); | 221 name, callback.release())); |
222 task->Start(origin_url, origin_base_path, create); | 222 task->Start(origin_url, origin_base_path, create); |
223 } | 223 } |
224 | 224 |
225 bool FileSystemPathManager::CrackFileSystemPath( | 225 bool FileSystemPathManager::CrackFileSystemPath( |
226 const FilePath& path, GURL* origin_url, FileSystemType* type, | 226 const FilePath& path, GURL* origin_url, FileSystemType* type, |
227 FilePath* virtual_path) const { | 227 FilePath* virtual_path) const { |
228 // Any paths that includes parent references are considered invalid. | 228 // Any paths that includes parent references are considered invalid. |
229 if (path.ReferencesParent()) | 229 if (path.ReferencesParent()) |
230 return false; | 230 return false; |
231 | 231 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 WebKit::WebSecurityOrigin::createFromString(UTF8ToUTF16(url.spec())); | 329 WebKit::WebSecurityOrigin::createFromString(UTF8ToUTF16(url.spec())); |
330 return web_security_origin.databaseIdentifier().utf8(); | 330 return web_security_origin.databaseIdentifier().utf8(); |
331 } | 331 } |
332 | 332 |
333 } // namespace fileapi | 333 } // namespace fileapi |
334 | 334 |
335 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ | 335 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ |
336 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); | 336 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); |
337 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ | 337 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ |
338 int(fileapi::kFileSystemTypePersistent), mismatching_enums); | 338 int(fileapi::kFileSystemTypePersistent), mismatching_enums); |
OLD | NEW |