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 "chrome/browser/chromeos/drive/file_system.h" | 5 #include "components/drive/file_system.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/chromeos/drive/directory_loader.h" | |
11 #include "chrome/browser/chromeos/drive/file_system_observer.h" | |
12 #include "chrome/browser/chromeos/drive/remove_stale_cache_files.h" | |
13 #include "chrome/browser/chromeos/drive/search_metadata.h" | |
14 #include "chrome/browser/chromeos/drive/sync_client.h" | |
15 #include "components/drive/change_list_loader.h" | 10 #include "components/drive/change_list_loader.h" |
| 11 #include "components/drive/directory_loader.h" |
16 #include "components/drive/drive.pb.h" | 12 #include "components/drive/drive.pb.h" |
17 #include "components/drive/drive_pref_names.h" | 13 #include "components/drive/drive_pref_names.h" |
18 #include "components/drive/file_cache.h" | 14 #include "components/drive/file_cache.h" |
19 #include "components/drive/file_change.h" | 15 #include "components/drive/file_change.h" |
20 #include "components/drive/file_system/copy_operation.h" | 16 #include "components/drive/file_system/copy_operation.h" |
21 #include "components/drive/file_system/create_directory_operation.h" | 17 #include "components/drive/file_system/create_directory_operation.h" |
22 #include "components/drive/file_system/create_file_operation.h" | 18 #include "components/drive/file_system/create_file_operation.h" |
23 #include "components/drive/file_system/download_operation.h" | 19 #include "components/drive/file_system/download_operation.h" |
24 #include "components/drive/file_system/get_file_for_saving_operation.h" | 20 #include "components/drive/file_system/get_file_for_saving_operation.h" |
25 #include "components/drive/file_system/move_operation.h" | 21 #include "components/drive/file_system/move_operation.h" |
26 #include "components/drive/file_system/open_file_operation.h" | 22 #include "components/drive/file_system/open_file_operation.h" |
27 #include "components/drive/file_system/remove_operation.h" | 23 #include "components/drive/file_system/remove_operation.h" |
28 #include "components/drive/file_system/search_operation.h" | 24 #include "components/drive/file_system/search_operation.h" |
29 #include "components/drive/file_system/set_property_operation.h" | 25 #include "components/drive/file_system/set_property_operation.h" |
30 #include "components/drive/file_system/touch_operation.h" | 26 #include "components/drive/file_system/touch_operation.h" |
31 #include "components/drive/file_system/truncate_operation.h" | 27 #include "components/drive/file_system/truncate_operation.h" |
32 #include "components/drive/file_system_core_util.h" | 28 #include "components/drive/file_system_core_util.h" |
| 29 #include "components/drive/file_system_observer.h" |
33 #include "components/drive/job_scheduler.h" | 30 #include "components/drive/job_scheduler.h" |
| 31 #include "components/drive/remove_stale_cache_files.h" |
34 #include "components/drive/resource_entry_conversion.h" | 32 #include "components/drive/resource_entry_conversion.h" |
| 33 #include "components/drive/search_metadata.h" |
| 34 #include "components/drive/sync_client.h" |
35 #include "google_apis/drive/drive_api_parser.h" | 35 #include "google_apis/drive/drive_api_parser.h" |
36 | 36 |
37 namespace drive { | 37 namespace drive { |
38 namespace { | 38 namespace { |
39 | 39 |
40 // Gets a ResourceEntry from the metadata, and overwrites its file info when the | 40 // Gets a ResourceEntry from the metadata, and overwrites its file info when the |
41 // cached file is dirty. | 41 // cached file is dirty. |
42 FileError GetLocallyStoredResourceEntry( | 42 FileError GetLocallyStoredResourceEntry( |
43 internal::ResourceMetadata* resource_metadata, | 43 internal::ResourceMetadata* resource_metadata, |
44 internal::FileCache* cache, | 44 internal::FileCache* cache, |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 | 1051 |
1052 void FileSystem::CalculateEvictableCacheSize( | 1052 void FileSystem::CalculateEvictableCacheSize( |
1053 const EvictableCacheSizeCallback& callback) { | 1053 const EvictableCacheSizeCallback& callback) { |
1054 DCHECK(thread_checker_.CalledOnValidThread()); | 1054 DCHECK(thread_checker_.CalledOnValidThread()); |
1055 DCHECK(!callback.is_null()); | 1055 DCHECK(!callback.is_null()); |
1056 base::PostTaskAndReplyWithResult( | 1056 base::PostTaskAndReplyWithResult( |
1057 blocking_task_runner_.get(), FROM_HERE, | 1057 blocking_task_runner_.get(), FROM_HERE, |
1058 base::Bind(&CalculateEvictableCacheSizeOnBlockingPool, cache_), callback); | 1058 base::Bind(&CalculateEvictableCacheSizeOnBlockingPool, cache_), callback); |
1059 } | 1059 } |
1060 } // namespace drive | 1060 } // namespace drive |
OLD | NEW |