Chromium Code Reviews| 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/file_system_path_manager.h" | 5 #include "webkit/fileapi/file_system_path_manager.h" |
| 6 | 6 |
| 7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_callback_factory.h" | 9 #include "base/memory/scoped_callback_factory.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" |
| 18 #include "webkit/fileapi/file_system_util.h" | 18 #include "webkit/fileapi/file_system_util.h" |
| 19 #include "webkit/fileapi/local_file_system_file_util.h" | |
| 20 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 19 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
| 21 #include "webkit/glue/webkit_glue.h" | 20 #include "webkit/glue/webkit_glue.h" |
| 22 | 21 |
| 23 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 24 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" | 23 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
| 25 #endif | 24 #endif |
| 26 | 25 |
| 27 // We use some of WebKit types for conversions between origin identifiers | 26 // We use some of WebKit types for conversions between origin identifiers |
| 28 // and origin URLs. | 27 // and origin URLs. |
| 29 using WebKit::WebFileSystem; | 28 using WebKit::WebFileSystem; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 return true; | 161 return true; |
| 163 } | 162 } |
| 164 | 163 |
| 165 FileSystemFileUtil* FileSystemPathManager::GetFileSystemFileUtil( | 164 FileSystemFileUtil* FileSystemPathManager::GetFileSystemFileUtil( |
| 166 FileSystemType type) const { | 165 FileSystemType type) const { |
| 167 switch (type) { | 166 switch (type) { |
| 168 case kFileSystemTypeTemporary: | 167 case kFileSystemTypeTemporary: |
| 169 case kFileSystemTypePersistent: | 168 case kFileSystemTypePersistent: |
| 170 return sandbox_provider_->GetFileSystemFileUtil(); | 169 return sandbox_provider_->GetFileSystemFileUtil(); |
| 171 case kFileSystemTypeExternal: | 170 case kFileSystemTypeExternal: |
| 172 return LocalFileSystemFileUtil::GetInstance(); | 171 return external_provider_->GetFileSystemFileUtil(); |
|
kinuko
2011/07/01 07:48:02
probably we should check external_provider_.get()
Dai Mikurube (NOT FULLTIME)
2011/07/04 06:14:53
Done.
| |
| 173 case kFileSystemTypeUnknown: | 172 case kFileSystemTypeUnknown: |
| 174 default: | 173 default: |
| 175 NOTREACHED(); | 174 NOTREACHED(); |
| 176 return NULL; | 175 return NULL; |
| 177 } | 176 } |
| 178 } | 177 } |
| 179 | 178 |
| 180 } // namespace fileapi | 179 } // namespace fileapi |
| 181 | 180 |
| 182 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ | 181 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ |
| 183 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); | 182 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); |
| 184 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ | 183 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ |
| 185 int(fileapi::kFileSystemTypePersistent), mismatching_enums); | 184 int(fileapi::kFileSystemTypePersistent), mismatching_enums); |
| 186 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \ | 185 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \ |
| 187 int(fileapi::kFileSystemTypeExternal), mismatching_enums); | 186 int(fileapi::kFileSystemTypeExternal), mismatching_enums); |
| OLD | NEW |