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/file_system_context.h" | 5 #include "webkit/fileapi/file_system_context.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 FileSystemOperation* operation = | 252 FileSystemOperation* operation = |
253 mount_point_provider->CreateFileSystemOperation(url, this, &fs_error); | 253 mount_point_provider->CreateFileSystemOperation(url, this, &fs_error); |
254 | 254 |
255 if (error_code) | 255 if (error_code) |
256 *error_code = fs_error; | 256 *error_code = fs_error; |
257 return operation; | 257 return operation; |
258 } | 258 } |
259 | 259 |
260 webkit_blob::FileStreamReader* FileSystemContext::CreateFileStreamReader( | 260 webkit_blob::FileStreamReader* FileSystemContext::CreateFileStreamReader( |
261 const FileSystemURL& url, | 261 const FileSystemURL& url, |
262 int64 offset) { | 262 int64 offset, |
| 263 const base::Time& expected_modification_time) { |
263 if (!url.is_valid()) | 264 if (!url.is_valid()) |
264 return NULL; | 265 return NULL; |
265 FileSystemMountPointProvider* mount_point_provider = | 266 FileSystemMountPointProvider* mount_point_provider = |
266 GetMountPointProvider(url.type()); | 267 GetMountPointProvider(url.type()); |
267 if (!mount_point_provider) | 268 if (!mount_point_provider) |
268 return NULL; | 269 return NULL; |
269 return mount_point_provider->CreateFileStreamReader(url, offset, this); | 270 return mount_point_provider->CreateFileStreamReader( |
| 271 url, offset, expected_modification_time, this); |
270 } | 272 } |
271 | 273 |
272 void FileSystemContext::RegisterMountPointProvider( | 274 void FileSystemContext::RegisterMountPointProvider( |
273 FileSystemType type, | 275 FileSystemType type, |
274 FileSystemMountPointProvider* provider) { | 276 FileSystemMountPointProvider* provider) { |
275 DCHECK(provider); | 277 DCHECK(provider); |
276 DCHECK(provider_map_.find(type) == provider_map_.end()); | 278 DCHECK(provider_map_.find(type) == provider_map_.end()); |
277 provider_map_[type] = provider; | 279 provider_map_[type] = provider; |
278 } | 280 } |
279 | 281 |
(...skipping 21 matching lines...) Expand all Loading... |
301 if (!task_runners_->io_task_runner()->RunsTasksOnCurrentThread() && | 303 if (!task_runners_->io_task_runner()->RunsTasksOnCurrentThread() && |
302 task_runners_->io_task_runner()->DeleteSoon(FROM_HERE, this)) { | 304 task_runners_->io_task_runner()->DeleteSoon(FROM_HERE, this)) { |
303 return; | 305 return; |
304 } | 306 } |
305 STLDeleteContainerPairSecondPointers(provider_map_.begin(), | 307 STLDeleteContainerPairSecondPointers(provider_map_.begin(), |
306 provider_map_.end()); | 308 provider_map_.end()); |
307 delete this; | 309 delete this; |
308 } | 310 } |
309 | 311 |
310 } // namespace fileapi | 312 } // namespace fileapi |
OLD | NEW |