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" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "webkit/fileapi/file_system_file_util.h" | 12 #include "webkit/fileapi/file_system_file_util.h" |
13 #include "webkit/fileapi/file_system_operation.h" | 13 #include "webkit/fileapi/file_system_operation.h" |
14 #include "webkit/fileapi/file_system_options.h" | 14 #include "webkit/fileapi/file_system_options.h" |
15 #include "webkit/fileapi/file_system_quota_client.h" | 15 #include "webkit/fileapi/file_system_quota_client.h" |
16 #include "webkit/fileapi/file_system_task_runners.h" | 16 #include "webkit/fileapi/file_system_task_runners.h" |
17 #include "webkit/fileapi/file_system_url.h" | 17 #include "webkit/fileapi/file_system_url.h" |
18 #include "webkit/fileapi/file_system_util.h" | 18 #include "webkit/fileapi/file_system_util.h" |
19 #include "webkit/fileapi/isolated_context.h" | 19 #include "webkit/fileapi/isolated_context.h" |
20 #include "webkit/fileapi/isolated_mount_point_provider.h" | 20 #include "webkit/fileapi/isolated_mount_point_provider.h" |
21 #include "webkit/fileapi/sandbox_mount_point_provider.h" | 21 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
22 #include "webkit/fileapi/syncable/local_file_change_tracker.h" | 22 #include "webkit/fileapi/syncable/local_file_change_tracker.h" |
| 23 #include "webkit/fileapi/syncable/local_file_sync_context.h" |
23 #include "webkit/fileapi/syncable/syncable_file_system_util.h" | 24 #include "webkit/fileapi/syncable/syncable_file_system_util.h" |
24 #include "webkit/fileapi/test_mount_point_provider.h" | 25 #include "webkit/fileapi/test_mount_point_provider.h" |
25 #include "webkit/quota/quota_manager.h" | 26 #include "webkit/quota/quota_manager.h" |
26 #include "webkit/quota/special_storage_policy.h" | 27 #include "webkit/quota/special_storage_policy.h" |
27 | 28 |
28 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
29 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" | 30 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" |
30 #endif | 31 #endif |
31 | 32 |
32 using quota::QuotaClient; | 33 using quota::QuotaClient; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 DCHECK(tracker.get()); | 283 DCHECK(tracker.get()); |
283 change_tracker_ = tracker.Pass(); | 284 change_tracker_ = tracker.Pass(); |
284 sandbox_provider_->AddSyncableFileUpdateObserver( | 285 sandbox_provider_->AddSyncableFileUpdateObserver( |
285 change_tracker_.get(), | 286 change_tracker_.get(), |
286 task_runners_->file_task_runner()); | 287 task_runners_->file_task_runner()); |
287 sandbox_provider_->AddSyncableFileChangeObserver( | 288 sandbox_provider_->AddSyncableFileChangeObserver( |
288 change_tracker_.get(), | 289 change_tracker_.get(), |
289 task_runners_->file_task_runner()); | 290 task_runners_->file_task_runner()); |
290 } | 291 } |
291 | 292 |
| 293 void FileSystemContext::set_sync_context( |
| 294 LocalFileSyncContext* sync_context) { |
| 295 sync_context_ = sync_context; |
| 296 } |
| 297 |
292 FileSystemContext::~FileSystemContext() {} | 298 FileSystemContext::~FileSystemContext() {} |
293 | 299 |
294 void FileSystemContext::DeleteOnCorrectThread() const { | 300 void FileSystemContext::DeleteOnCorrectThread() const { |
295 if (!task_runners_->io_task_runner()->RunsTasksOnCurrentThread() && | 301 if (!task_runners_->io_task_runner()->RunsTasksOnCurrentThread() && |
296 task_runners_->io_task_runner()->DeleteSoon(FROM_HERE, this)) { | 302 task_runners_->io_task_runner()->DeleteSoon(FROM_HERE, this)) { |
297 return; | 303 return; |
298 } | 304 } |
299 STLDeleteContainerPairSecondPointers(provider_map_.begin(), | 305 STLDeleteContainerPairSecondPointers(provider_map_.begin(), |
300 provider_map_.end()); | 306 provider_map_.end()); |
301 delete this; | 307 delete this; |
302 } | 308 } |
303 | 309 |
304 } // namespace fileapi | 310 } // namespace fileapi |
OLD | NEW |