| 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/browsing_data/browsing_data_file_system_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
| 14 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 14 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "extensions/features/features.h" |
| 16 #include "storage/browser/fileapi/file_system_context.h" | 17 #include "storage/browser/fileapi/file_system_context.h" |
| 17 #include "storage/browser/fileapi/file_system_quota_util.h" | 18 #include "storage/browser/fileapi/file_system_quota_util.h" |
| 18 #include "storage/common/fileapi/file_system_types.h" | 19 #include "storage/common/fileapi/file_system_types.h" |
| 19 | 20 |
| 20 using content::BrowserThread; | 21 using content::BrowserThread; |
| 21 | 22 |
| 22 namespace storage { | 23 namespace storage { |
| 23 class FileSystemContext; | 24 class FileSystemContext; |
| 24 } | 25 } |
| 25 | 26 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 93 |
| 93 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread( | 94 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread( |
| 94 const FetchCallback& callback) { | 95 const FetchCallback& callback) { |
| 95 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); | 96 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); |
| 96 DCHECK(!callback.is_null()); | 97 DCHECK(!callback.is_null()); |
| 97 | 98 |
| 98 // We check usage for these filesystem types. | 99 // We check usage for these filesystem types. |
| 99 const storage::FileSystemType types[] = { | 100 const storage::FileSystemType types[] = { |
| 100 storage::kFileSystemTypeTemporary, | 101 storage::kFileSystemTypeTemporary, |
| 101 storage::kFileSystemTypePersistent, | 102 storage::kFileSystemTypePersistent, |
| 102 #if defined(ENABLE_EXTENSIONS) | 103 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 103 storage::kFileSystemTypeSyncable, | 104 storage::kFileSystemTypeSyncable, |
| 104 #endif | 105 #endif |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 std::list<FileSystemInfo> result; | 108 std::list<FileSystemInfo> result; |
| 108 typedef std::map<GURL, FileSystemInfo> OriginInfoMap; | 109 typedef std::map<GURL, FileSystemInfo> OriginInfoMap; |
| 109 OriginInfoMap file_system_info_map; | 110 OriginInfoMap file_system_info_map; |
| 110 for (size_t i = 0; i < arraysize(types); ++i) { | 111 for (size_t i = 0; i < arraysize(types); ++i) { |
| 111 storage::FileSystemType type = types[i]; | 112 storage::FileSystemType type = types[i]; |
| 112 storage::FileSystemQuotaUtil* quota_util = | 113 storage::FileSystemQuotaUtil* quota_util = |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 204 } |
| 204 | 205 |
| 205 void CannedBrowsingDataFileSystemHelper::StartFetching( | 206 void CannedBrowsingDataFileSystemHelper::StartFetching( |
| 206 const FetchCallback& callback) { | 207 const FetchCallback& callback) { |
| 207 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 208 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 208 DCHECK(!callback.is_null()); | 209 DCHECK(!callback.is_null()); |
| 209 | 210 |
| 210 BrowserThread::PostTask( | 211 BrowserThread::PostTask( |
| 211 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); | 212 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); |
| 212 } | 213 } |
| OLD | NEW |