| OLD | NEW |
| 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/browser/fileapi/isolated_file_system_backend.h" | 5 #include "webkit/browser/fileapi/isolated_file_system_backend.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 void IsolatedFileSystemBackend::OpenFileSystem( | 59 void IsolatedFileSystemBackend::OpenFileSystem( |
| 60 const GURL& origin_url, | 60 const GURL& origin_url, |
| 61 FileSystemType type, | 61 FileSystemType type, |
| 62 OpenFileSystemMode mode, | 62 OpenFileSystemMode mode, |
| 63 const OpenFileSystemCallback& callback) { | 63 const OpenFileSystemCallback& callback) { |
| 64 // We never allow opening a new isolated FileSystem via usual OpenFileSystem. | 64 // We never allow opening a new isolated FileSystem via usual OpenFileSystem. |
| 65 base::MessageLoopProxy::current()->PostTask( | 65 base::MessageLoopProxy::current()->PostTask( |
| 66 FROM_HERE, | 66 FROM_HERE, |
| 67 base::Bind(callback, base::PLATFORM_FILE_ERROR_SECURITY)); | 67 base::Bind(callback, |
| 68 GetFileSystemRootURI(origin_url, type), |
| 69 GetFileSystemName(origin_url, type), |
| 70 base::PLATFORM_FILE_ERROR_SECURITY)); |
| 68 } | 71 } |
| 69 | 72 |
| 70 FileSystemFileUtil* IsolatedFileSystemBackend::GetFileUtil( | 73 FileSystemFileUtil* IsolatedFileSystemBackend::GetFileUtil( |
| 71 FileSystemType type) { | 74 FileSystemType type) { |
| 72 switch (type) { | 75 switch (type) { |
| 73 case kFileSystemTypeNativeLocal: | 76 case kFileSystemTypeNativeLocal: |
| 74 return isolated_file_util_->sync_file_util(); | 77 return isolated_file_util_->sync_file_util(); |
| 75 case kFileSystemTypeDragged: | 78 case kFileSystemTypeDragged: |
| 76 return dragged_file_util_->sync_file_util(); | 79 return dragged_file_util_->sync_file_util(); |
| 77 case kFileSystemTypeForTransientFile: | 80 case kFileSystemTypeForTransientFile: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( | 135 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( |
| 133 context->task_runners()->file_task_runner(), url.path(), offset)); | 136 context->task_runners()->file_task_runner(), url.path(), offset)); |
| 134 } | 137 } |
| 135 | 138 |
| 136 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { | 139 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { |
| 137 // No quota support. | 140 // No quota support. |
| 138 return NULL; | 141 return NULL; |
| 139 } | 142 } |
| 140 | 143 |
| 141 } // namespace fileapi | 144 } // namespace fileapi |
| OLD | NEW |