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

Side by Side Diff: webkit/fileapi/file_system_path_manager.cc

Issue 7174002: Change {Obfuscated|Local}FileSystemFileUtil non-Singleton to take an underlying *FileUtil. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased. Created 9 years, 5 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) 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
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 if (external_provider_.get()) {
172 return external_provider_->GetFileSystemFileUtil();
173 } else {
174 NOTREACHED();
175 return NULL;
176 }
173 case kFileSystemTypeUnknown: 177 case kFileSystemTypeUnknown:
174 default: 178 default:
175 NOTREACHED(); 179 NOTREACHED();
176 return NULL; 180 return NULL;
177 } 181 }
178 } 182 }
179 183
180 } // namespace fileapi 184 } // namespace fileapi
181 185
182 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \ 186 COMPILE_ASSERT(int(WebFileSystem::TypeTemporary) == \
183 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); 187 int(fileapi::kFileSystemTypeTemporary), mismatching_enums);
184 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \ 188 COMPILE_ASSERT(int(WebFileSystem::TypePersistent) == \
185 int(fileapi::kFileSystemTypePersistent), mismatching_enums); 189 int(fileapi::kFileSystemTypePersistent), mismatching_enums);
186 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \ 190 COMPILE_ASSERT(int(WebFileSystem::TypeExternal) == \
187 int(fileapi::kFileSystemTypeExternal), mismatching_enums); 191 int(fileapi::kFileSystemTypeExternal), mismatching_enums);
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_operation_write_unittest.cc ('k') | webkit/fileapi/file_system_quota_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698