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" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 86 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
87 file_task_runner()->PostTask( | 87 file_task_runner()->PostTask( |
88 FROM_HERE, | 88 FROM_HERE, |
89 base::BindOnce( | 89 base::BindOnce( |
90 &BrowsingDataFileSystemHelperImpl::DeleteFileSystemOriginInFileThread, | 90 &BrowsingDataFileSystemHelperImpl::DeleteFileSystemOriginInFileThread, |
91 this, origin)); | 91 this, origin)); |
92 } | 92 } |
93 | 93 |
94 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread( | 94 void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread( |
95 const FetchCallback& callback) { | 95 const FetchCallback& callback) { |
96 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); | 96 DCHECK(file_task_runner()->RunsTasksInCurrentSequence()); |
97 DCHECK(!callback.is_null()); | 97 DCHECK(!callback.is_null()); |
98 | 98 |
99 // We check usage for these filesystem types. | 99 // We check usage for these filesystem types. |
100 const storage::FileSystemType types[] = { | 100 const storage::FileSystemType types[] = { |
101 storage::kFileSystemTypeTemporary, | 101 storage::kFileSystemTypeTemporary, |
102 storage::kFileSystemTypePersistent, | 102 storage::kFileSystemTypePersistent, |
103 #if BUILDFLAG(ENABLE_EXTENSIONS) | 103 #if BUILDFLAG(ENABLE_EXTENSIONS) |
104 storage::kFileSystemTypeSyncable, | 104 storage::kFileSystemTypeSyncable, |
105 #endif | 105 #endif |
106 }; | 106 }; |
(...skipping 22 matching lines...) Expand all Loading... |
129 | 129 |
130 for (const auto& iter : file_system_info_map) | 130 for (const auto& iter : file_system_info_map) |
131 result.push_back(iter.second); | 131 result.push_back(iter.second); |
132 | 132 |
133 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 133 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
134 base::BindOnce(callback, result)); | 134 base::BindOnce(callback, result)); |
135 } | 135 } |
136 | 136 |
137 void BrowsingDataFileSystemHelperImpl::DeleteFileSystemOriginInFileThread( | 137 void BrowsingDataFileSystemHelperImpl::DeleteFileSystemOriginInFileThread( |
138 const GURL& origin) { | 138 const GURL& origin) { |
139 DCHECK(file_task_runner()->RunsTasksOnCurrentThread()); | 139 DCHECK(file_task_runner()->RunsTasksInCurrentSequence()); |
140 filesystem_context_->DeleteDataForOriginOnFileTaskRunner(origin); | 140 filesystem_context_->DeleteDataForOriginOnFileTaskRunner(origin); |
141 } | 141 } |
142 | 142 |
143 } // namespace | 143 } // namespace |
144 | 144 |
145 BrowsingDataFileSystemHelper::FileSystemInfo::FileSystemInfo( | 145 BrowsingDataFileSystemHelper::FileSystemInfo::FileSystemInfo( |
146 const GURL& origin) : origin(origin) {} | 146 const GURL& origin) : origin(origin) {} |
147 | 147 |
148 BrowsingDataFileSystemHelper::FileSystemInfo::FileSystemInfo( | 148 BrowsingDataFileSystemHelper::FileSystemInfo::FileSystemInfo( |
149 const FileSystemInfo& other) = default; | 149 const FileSystemInfo& other) = default; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 void CannedBrowsingDataFileSystemHelper::StartFetching( | 206 void CannedBrowsingDataFileSystemHelper::StartFetching( |
207 const FetchCallback& callback) { | 207 const FetchCallback& callback) { |
208 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 208 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
209 DCHECK(!callback.is_null()); | 209 DCHECK(!callback.is_null()); |
210 | 210 |
211 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 211 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
212 base::BindOnce(callback, file_system_info_)); | 212 base::BindOnce(callback, file_system_info_)); |
213 } | 213 } |
OLD | NEW |