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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const OpenFileSystemCallback& callback) { | 65 const OpenFileSystemCallback& callback) { |
66 // We never allow opening a new isolated FileSystem via usual OpenFileSystem. | 66 // We never allow opening a new isolated FileSystem via usual OpenFileSystem. |
67 base::MessageLoopProxy::current()->PostTask( | 67 base::MessageLoopProxy::current()->PostTask( |
68 FROM_HERE, | 68 FROM_HERE, |
69 base::Bind(callback, | 69 base::Bind(callback, |
70 GetFileSystemRootURI(origin_url, type), | 70 GetFileSystemRootURI(origin_url, type), |
71 GetFileSystemName(origin_url, type), | 71 GetFileSystemName(origin_url, type), |
72 base::PLATFORM_FILE_ERROR_SECURITY)); | 72 base::PLATFORM_FILE_ERROR_SECURITY)); |
73 } | 73 } |
74 | 74 |
75 FileSystemFileUtil* IsolatedFileSystemBackend::GetFileUtil( | |
76 FileSystemType type) { | |
77 switch (type) { | |
78 case kFileSystemTypeNativeLocal: | |
79 return isolated_file_util_->sync_file_util(); | |
80 case kFileSystemTypeDragged: | |
81 return dragged_file_util_->sync_file_util(); | |
82 case kFileSystemTypeForTransientFile: | |
83 return transient_file_util_->sync_file_util(); | |
84 default: | |
85 NOTREACHED(); | |
86 } | |
87 return NULL; | |
88 } | |
89 | |
90 AsyncFileUtil* IsolatedFileSystemBackend::GetAsyncFileUtil( | 75 AsyncFileUtil* IsolatedFileSystemBackend::GetAsyncFileUtil( |
91 FileSystemType type) { | 76 FileSystemType type) { |
92 switch (type) { | 77 switch (type) { |
93 case kFileSystemTypeNativeLocal: | 78 case kFileSystemTypeNativeLocal: |
94 return isolated_file_util_.get(); | 79 return isolated_file_util_.get(); |
95 case kFileSystemTypeDragged: | 80 case kFileSystemTypeDragged: |
96 return dragged_file_util_.get(); | 81 return dragged_file_util_.get(); |
97 case kFileSystemTypeForTransientFile: | 82 case kFileSystemTypeForTransientFile: |
98 return transient_file_util_.get(); | 83 return transient_file_util_.get(); |
99 default: | 84 default: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( | 122 return scoped_ptr<FileStreamWriter>(new LocalFileStreamWriter( |
138 context->default_file_task_runner(), url.path(), offset)); | 123 context->default_file_task_runner(), url.path(), offset)); |
139 } | 124 } |
140 | 125 |
141 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { | 126 FileSystemQuotaUtil* IsolatedFileSystemBackend::GetQuotaUtil() { |
142 // No quota support. | 127 // No quota support. |
143 return NULL; | 128 return NULL; |
144 } | 129 } |
145 | 130 |
146 } // namespace fileapi | 131 } // namespace fileapi |
OLD | NEW |