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

Side by Side Diff: chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 145303002: Convert Media Galleries to use base::File (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/fileapi/file_system_backend.h" 5 #include "chrome/browser/chromeos/fileapi/file_system_backend.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 void FileSystemBackend::OpenFileSystem( 96 void FileSystemBackend::OpenFileSystem(
97 const GURL& origin_url, 97 const GURL& origin_url,
98 fileapi::FileSystemType type, 98 fileapi::FileSystemType type,
99 fileapi::OpenFileSystemMode mode, 99 fileapi::OpenFileSystemMode mode,
100 const OpenFileSystemCallback& callback) { 100 const OpenFileSystemCallback& callback) {
101 // TODO(nhiroki): Deprecate OpenFileSystem for non-sandboxed filesystem. 101 // TODO(nhiroki): Deprecate OpenFileSystem for non-sandboxed filesystem.
102 // (http://crbug.com/297412) 102 // (http://crbug.com/297412)
103 NOTREACHED(); 103 NOTREACHED();
104 callback.Run(GURL(), std::string(), base::PLATFORM_FILE_ERROR_SECURITY); 104 callback.Run(GURL(), std::string(), base::File::FILE_ERROR_SECURITY);
105 } 105 }
106 106
107 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() { 107 fileapi::FileSystemQuotaUtil* FileSystemBackend::GetQuotaUtil() {
108 // No quota support. 108 // No quota support.
109 return NULL; 109 return NULL;
110 } 110 }
111 111
112 bool FileSystemBackend::IsAccessAllowed( 112 bool FileSystemBackend::IsAccessAllowed(
113 const fileapi::FileSystemURL& url) const { 113 const fileapi::FileSystemURL& url) const {
114 if (!url.is_valid()) 114 if (!url.is_valid())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (type == fileapi::kFileSystemTypeDrive) 206 if (type == fileapi::kFileSystemTypeDrive)
207 return drive_delegate_->GetAsyncFileUtil(type); 207 return drive_delegate_->GetAsyncFileUtil(type);
208 208
209 DCHECK(type == fileapi::kFileSystemTypeNativeLocal || 209 DCHECK(type == fileapi::kFileSystemTypeNativeLocal ||
210 type == fileapi::kFileSystemTypeRestrictedNativeLocal); 210 type == fileapi::kFileSystemTypeRestrictedNativeLocal);
211 return local_file_util_.get(); 211 return local_file_util_.get();
212 } 212 }
213 213
214 fileapi::CopyOrMoveFileValidatorFactory* 214 fileapi::CopyOrMoveFileValidatorFactory*
215 FileSystemBackend::GetCopyOrMoveFileValidatorFactory( 215 FileSystemBackend::GetCopyOrMoveFileValidatorFactory(
216 fileapi::FileSystemType type, base::PlatformFileError* error_code) { 216 fileapi::FileSystemType type, base::File::Error* error_code) {
217 DCHECK(error_code); 217 DCHECK(error_code);
218 *error_code = base::PLATFORM_FILE_OK; 218 *error_code = base::File::FILE_OK;
219 return NULL; 219 return NULL;
220 } 220 }
221 221
222 fileapi::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation( 222 fileapi::FileSystemOperation* FileSystemBackend::CreateFileSystemOperation(
223 const fileapi::FileSystemURL& url, 223 const fileapi::FileSystemURL& url,
224 fileapi::FileSystemContext* context, 224 fileapi::FileSystemContext* context,
225 base::PlatformFileError* error_code) const { 225 base::File::Error* error_code) const {
226 DCHECK(url.is_valid()); 226 DCHECK(url.is_valid());
227 227
228 if (!IsAccessAllowed(url)) { 228 if (!IsAccessAllowed(url)) {
229 *error_code = base::PLATFORM_FILE_ERROR_SECURITY; 229 *error_code = base::File::FILE_ERROR_SECURITY;
230 return NULL; 230 return NULL;
231 } 231 }
232 232
233 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal || 233 DCHECK(url.type() == fileapi::kFileSystemTypeNativeLocal ||
234 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal || 234 url.type() == fileapi::kFileSystemTypeRestrictedNativeLocal ||
235 url.type() == fileapi::kFileSystemTypeDrive); 235 url.type() == fileapi::kFileSystemTypeDrive);
236 return fileapi::FileSystemOperation::Create( 236 return fileapi::FileSystemOperation::Create(
237 url, context, 237 url, context,
238 make_scoped_ptr(new fileapi::FileSystemOperationContext(context))); 238 make_scoped_ptr(new fileapi::FileSystemOperationContext(context)));
239 } 239 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 282 }
283 283
284 bool FileSystemBackend::GetVirtualPath( 284 bool FileSystemBackend::GetVirtualPath(
285 const base::FilePath& filesystem_path, 285 const base::FilePath& filesystem_path,
286 base::FilePath* virtual_path) { 286 base::FilePath* virtual_path) {
287 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) || 287 return mount_points_->GetVirtualPath(filesystem_path, virtual_path) ||
288 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path); 288 system_mount_points_->GetVirtualPath(filesystem_path, virtual_path);
289 } 289 }
290 290
291 } // namespace chromeos 291 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/fileapi/file_system_backend.h ('k') | chrome/browser/devtools/devtools_file_system_indexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698