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/fileapi/test_mount_point_provider.h" | 5 #include "webkit/fileapi/test_mount_point_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 FileSystemOperation* TestMountPointProvider::CreateFileSystemOperation( | 133 FileSystemOperation* TestMountPointProvider::CreateFileSystemOperation( |
134 const FileSystemURL& url, | 134 const FileSystemURL& url, |
135 FileSystemContext* context, | 135 FileSystemContext* context, |
136 base::PlatformFileError* error_code) const { | 136 base::PlatformFileError* error_code) const { |
137 scoped_ptr<FileSystemOperationContext> operation_context( | 137 scoped_ptr<FileSystemOperationContext> operation_context( |
138 new FileSystemOperationContext(context)); | 138 new FileSystemOperationContext(context)); |
139 operation_context->set_update_observers(observers_); | 139 operation_context->set_update_observers(observers_); |
140 return new LocalFileSystemOperation(context, operation_context.Pass()); | 140 return new LocalFileSystemOperation(context, operation_context.Pass()); |
141 } | 141 } |
142 | 142 |
143 webkit_blob::FileStreamReader* TestMountPointProvider::CreateFileStreamReader( | 143 scoped_ptr<webkit_blob::FileStreamReader> |
| 144 TestMountPointProvider::CreateFileStreamReader( |
144 const FileSystemURL& url, | 145 const FileSystemURL& url, |
145 int64 offset, | 146 int64 offset, |
146 const base::Time& expected_modification_time, | 147 const base::Time& expected_modification_time, |
147 FileSystemContext* context) const { | 148 FileSystemContext* context) const { |
148 return new FileSystemFileStreamReader( | 149 return scoped_ptr<webkit_blob::FileStreamReader>( |
149 context, url, offset, expected_modification_time); | 150 new FileSystemFileStreamReader( |
| 151 context, url, offset, expected_modification_time)); |
150 } | 152 } |
151 | 153 |
152 fileapi::FileStreamWriter* TestMountPointProvider::CreateFileStreamWriter( | 154 scoped_ptr<fileapi::FileStreamWriter> |
| 155 TestMountPointProvider::CreateFileStreamWriter( |
153 const FileSystemURL& url, | 156 const FileSystemURL& url, |
154 int64 offset, | 157 int64 offset, |
155 FileSystemContext* context) const { | 158 FileSystemContext* context) const { |
156 return new SandboxFileStreamWriter(context, url, offset, observers_); | 159 return scoped_ptr<fileapi::FileStreamWriter>( |
| 160 new SandboxFileStreamWriter(context, url, offset, observers_)); |
157 } | 161 } |
158 | 162 |
159 FileSystemQuotaUtil* TestMountPointProvider::GetQuotaUtil() { | 163 FileSystemQuotaUtil* TestMountPointProvider::GetQuotaUtil() { |
160 return quota_util_.get(); | 164 return quota_util_.get(); |
161 } | 165 } |
162 | 166 |
163 void TestMountPointProvider::DeleteFileSystem( | 167 void TestMountPointProvider::DeleteFileSystem( |
164 const GURL& origin_url, | 168 const GURL& origin_url, |
165 FileSystemType type, | 169 FileSystemType type, |
166 FileSystemContext* context, | 170 FileSystemContext* context, |
167 const DeleteFileSystemCallback& callback) { | 171 const DeleteFileSystemCallback& callback) { |
168 // This won't be called unless we add test code that opens a test | 172 // This won't be called unless we add test code that opens a test |
169 // filesystem by OpenFileSystem. | 173 // filesystem by OpenFileSystem. |
170 NOTREACHED(); | 174 NOTREACHED(); |
171 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); | 175 callback.Run(base::PLATFORM_FILE_ERROR_INVALID_OPERATION); |
172 } | 176 } |
173 | 177 |
174 const UpdateObserverList* TestMountPointProvider::GetUpdateObservers( | 178 const UpdateObserverList* TestMountPointProvider::GetUpdateObservers( |
175 FileSystemType type) const { | 179 FileSystemType type) const { |
176 return &observers_; | 180 return &observers_; |
177 } | 181 } |
178 | 182 |
179 } // namespace fileapi | 183 } // namespace fileapi |
OLD | NEW |