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