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

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

Issue 8999017: Add CreateFileSystemOperation() method to FileSystemContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased from patch 9016020 Created 9 years 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_context.h" 5 #include "webkit/fileapi/file_system_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFileSyste m.h"
12 #include "webkit/fileapi/file_system_callback_dispatcher.h" 12 #include "webkit/fileapi/file_system_callback_dispatcher.h"
13 #include "webkit/fileapi/file_system_file_util.h" 13 #include "webkit/fileapi/file_system_file_util.h"
14 #include "webkit/fileapi/file_system_operation_interface.h"
14 #include "webkit/fileapi/file_system_options.h" 15 #include "webkit/fileapi/file_system_options.h"
15 #include "webkit/fileapi/file_system_quota_client.h" 16 #include "webkit/fileapi/file_system_quota_client.h"
16 #include "webkit/fileapi/file_system_util.h" 17 #include "webkit/fileapi/file_system_util.h"
17 #include "webkit/fileapi/sandbox_mount_point_provider.h" 18 #include "webkit/fileapi/sandbox_mount_point_provider.h"
18 #include "webkit/quota/quota_manager.h" 19 #include "webkit/quota/quota_manager.h"
19 #include "webkit/quota/special_storage_policy.h" 20 #include "webkit/quota/special_storage_policy.h"
20 21
21 #if defined(OS_CHROMEOS) 22 #if defined(OS_CHROMEOS)
22 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" 23 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h"
23 #endif 24 #endif
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 166
166 FileSystemMountPointProvider* mount_point_provider = 167 FileSystemMountPointProvider* mount_point_provider =
167 GetMountPointProvider(type); 168 GetMountPointProvider(type);
168 DCHECK(mount_point_provider); 169 DCHECK(mount_point_provider);
169 mount_point_provider->ValidateFileSystemRoot( 170 mount_point_provider->ValidateFileSystemRoot(
170 origin_url, type, create, 171 origin_url, type, create,
171 base::Bind(&DidOpenFileSystem, 172 base::Bind(&DidOpenFileSystem,
172 base::Owned(dispatcher), root_url, name)); 173 base::Owned(dispatcher), root_url, name));
173 } 174 }
174 175
176 FileSystemOperationInterface* FileSystemContext::CreateFileSystemOperation(
177 const GURL& url,
178 FileSystemCallbackDispatcher* dispatcher,
179 base::MessageLoopProxy* file_proxy) {
180 GURL origin_url;
181 FileSystemType file_system_type = kFileSystemTypeUnknown;
182 FilePath file_path;
183 if (!CrackFileSystemURL(url, &origin_url, &file_system_type, &file_path))
184 return NULL;
185 FileSystemMountPointProvider* mount_point_provider =
186 GetMountPointProvider(file_system_type);
187 if (!mount_point_provider)
188 return NULL;
189 return mount_point_provider->CreateFileSystemOperation(
190 url, dispatcher, file_proxy, this);
191 }
192
175 } // namespace fileapi 193 } // namespace fileapi
176 194
177 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeTemporary) == \ 195 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeTemporary) == \
178 int(fileapi::kFileSystemTypeTemporary), mismatching_enums); 196 int(fileapi::kFileSystemTypeTemporary), mismatching_enums);
179 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypePersistent) == \ 197 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypePersistent) == \
180 int(fileapi::kFileSystemTypePersistent), mismatching_enums); 198 int(fileapi::kFileSystemTypePersistent), mismatching_enums);
181 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeExternal) == \ 199 COMPILE_ASSERT(int(WebKit::WebFileSystem::TypeExternal) == \
182 int(fileapi::kFileSystemTypeExternal), mismatching_enums); 200 int(fileapi::kFileSystemTypeExternal), mismatching_enums);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698