| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 if (!IsAccessAllowed(url)) { | 277 if (!IsAccessAllowed(url)) { |
| 278 *error_code = base::File::FILE_ERROR_SECURITY; | 278 *error_code = base::File::FILE_ERROR_SECURITY; |
| 279 return NULL; | 279 return NULL; |
| 280 } | 280 } |
| 281 | 281 |
| 282 if (url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage) { | 282 if (url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage) { |
| 283 // MTP file operations run on MediaTaskRunner. | 283 // MTP file operations run on MediaTaskRunner. |
| 284 return storage::FileSystemOperation::Create( | 284 return storage::FileSystemOperation::Create( |
| 285 url, context, | 285 url, context, |
| 286 base::WrapUnique(new storage::FileSystemOperationContext( | 286 base::MakeUnique<storage::FileSystemOperationContext>( |
| 287 context, MediaFileSystemBackend::MediaTaskRunner().get()))); | 287 context, MediaFileSystemBackend::MediaTaskRunner().get())); |
| 288 } | 288 } |
| 289 | 289 |
| 290 DCHECK(url.type() == storage::kFileSystemTypeNativeLocal || | 290 DCHECK(url.type() == storage::kFileSystemTypeNativeLocal || |
| 291 url.type() == storage::kFileSystemTypeRestrictedNativeLocal || | 291 url.type() == storage::kFileSystemTypeRestrictedNativeLocal || |
| 292 url.type() == storage::kFileSystemTypeDrive || | 292 url.type() == storage::kFileSystemTypeDrive || |
| 293 url.type() == storage::kFileSystemTypeProvided); | 293 url.type() == storage::kFileSystemTypeProvided); |
| 294 return storage::FileSystemOperation::Create( | 294 return storage::FileSystemOperation::Create( |
| 295 url, context, | 295 url, context, |
| 296 base::WrapUnique(new storage::FileSystemOperationContext(context))); | 296 base::MakeUnique<storage::FileSystemOperationContext>(context)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 bool FileSystemBackend::SupportsStreaming( | 299 bool FileSystemBackend::SupportsStreaming( |
| 300 const storage::FileSystemURL& url) const { | 300 const storage::FileSystemURL& url) const { |
| 301 return url.type() == storage::kFileSystemTypeDrive || | 301 return url.type() == storage::kFileSystemTypeDrive || |
| 302 url.type() == storage::kFileSystemTypeProvided || | 302 url.type() == storage::kFileSystemTypeProvided || |
| 303 url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage; | 303 url.type() == storage::kFileSystemTypeDeviceMediaAsFileStorage; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool FileSystemBackend::HasInplaceCopyImplementation( | 306 bool FileSystemBackend::HasInplaceCopyImplementation( |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 const base::FilePath& entry_path) const { | 424 const base::FilePath& entry_path) const { |
| 425 base::FilePath virtual_path; | 425 base::FilePath virtual_path; |
| 426 if (!GetVirtualPath(entry_path, &virtual_path)) | 426 if (!GetVirtualPath(entry_path, &virtual_path)) |
| 427 return storage::FileSystemURL(); | 427 return storage::FileSystemURL(); |
| 428 | 428 |
| 429 return context->CreateCrackedFileSystemURL( | 429 return context->CreateCrackedFileSystemURL( |
| 430 GURL() /* origin */, storage::kFileSystemTypeExternal, virtual_path); | 430 GURL() /* origin */, storage::kFileSystemTypeExternal, virtual_path); |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace chromeos | 433 } // namespace chromeos |
| OLD | NEW |