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

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

Issue 14096022: Make MountPointProvider pluggable from outside webkit/fileapi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix etc Created 7 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/isolated_mount_point_provider.h" 5 #include "webkit/fileapi/isolated_mount_point_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // TODO(kmadhusu): Initialize |device_media_file_util_| in 48 // TODO(kmadhusu): Initialize |device_media_file_util_| in
49 // initialization list. 49 // initialization list.
50 device_media_async_file_util_.reset( 50 device_media_async_file_util_.reset(
51 DeviceMediaAsyncFileUtil::Create(profile_path_)); 51 DeviceMediaAsyncFileUtil::Create(profile_path_));
52 #endif 52 #endif
53 } 53 }
54 54
55 IsolatedMountPointProvider::~IsolatedMountPointProvider() { 55 IsolatedMountPointProvider::~IsolatedMountPointProvider() {
56 } 56 }
57 57
58 bool IsolatedMountPointProvider::CanHandleType(FileSystemType type) const {
59 switch (type) {
60 case kFileSystemTypeIsolated:
61 case kFileSystemTypeDragged:
62 case kFileSystemTypeNativeMedia:
63 case kFileSystemTypeDeviceMedia:
64 return true;
65 #if !defined(OS_CHROMEOS)
66 case kFileSystemTypeNativeLocal:
67 case kFileSystemTypeNativeForPlatformApp:
68 return true;
69 #endif
70 default:
71 return false;
72 }
73 }
74
58 void IsolatedMountPointProvider::ValidateFileSystemRoot( 75 void IsolatedMountPointProvider::ValidateFileSystemRoot(
59 const GURL& origin_url, 76 const GURL& origin_url,
60 FileSystemType type, 77 FileSystemType type,
61 bool create, 78 bool create,
62 const ValidateFileSystemCallback& callback) { 79 const ValidateFileSystemCallback& callback) {
63 // We never allow opening a new isolated FileSystem via usual OpenFileSystem. 80 // We never allow opening a new isolated FileSystem via usual OpenFileSystem.
64 base::MessageLoopProxy::current()->PostTask( 81 base::MessageLoopProxy::current()->PostTask(
65 FROM_HERE, 82 FROM_HERE,
66 base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY)); 83 base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY));
67 } 84 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void IsolatedMountPointProvider::DeleteFileSystem( 226 void IsolatedMountPointProvider::DeleteFileSystem(
210 const GURL& origin_url, 227 const GURL& origin_url,
211 FileSystemType type, 228 FileSystemType type,
212 FileSystemContext* context, 229 FileSystemContext* context,
213 const DeleteFileSystemCallback& callback) { 230 const DeleteFileSystemCallback& callback) {
214 NOTREACHED(); 231 NOTREACHED();
215 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); 232 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION);
216 } 233 }
217 234
218 } // namespace fileapi 235 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/isolated_mount_point_provider.h ('k') | webkit/fileapi/local_file_system_cross_operation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698