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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 namespace { | 27 namespace { |
28 | 28 |
29 // An implementation of the BrowsingDataFileSystemHelper interface that pulls | 29 // An implementation of the BrowsingDataFileSystemHelper interface that pulls |
30 // data from a given |filesystem_context| and returns a list of FileSystemInfo | 30 // data from a given |filesystem_context| and returns a list of FileSystemInfo |
31 // items to a client. | 31 // items to a client. |
32 class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper { | 32 class BrowsingDataFileSystemHelperImpl : public BrowsingDataFileSystemHelper { |
33 public: | 33 public: |
34 // BrowsingDataFileSystemHelper implementation | 34 // BrowsingDataFileSystemHelper implementation |
35 explicit BrowsingDataFileSystemHelperImpl( | 35 explicit BrowsingDataFileSystemHelperImpl( |
36 storage::FileSystemContext* filesystem_context); | 36 storage::FileSystemContext* filesystem_context); |
37 virtual void StartFetching(const base::Callback< | 37 void StartFetching( |
38 void(const std::list<FileSystemInfo>&)>& callback) override; | 38 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) |
39 virtual void DeleteFileSystemOrigin(const GURL& origin) override; | 39 override; |
| 40 void DeleteFileSystemOrigin(const GURL& origin) override; |
40 | 41 |
41 private: | 42 private: |
42 virtual ~BrowsingDataFileSystemHelperImpl(); | 43 ~BrowsingDataFileSystemHelperImpl() override; |
43 | 44 |
44 // Enumerates all filesystem files, storing the resulting list into | 45 // Enumerates all filesystem files, storing the resulting list into |
45 // file_system_file_ for later use. This must be called on the file | 46 // file_system_file_ for later use. This must be called on the file |
46 // task runner. | 47 // task runner. |
47 void FetchFileSystemInfoInFileThread(); | 48 void FetchFileSystemInfoInFileThread(); |
48 | 49 |
49 // Triggers the success callback as the end of a StartFetching workflow. This | 50 // Triggers the success callback as the end of a StartFetching workflow. This |
50 // must be called on the UI thread. | 51 // must be called on the UI thread. |
51 void NotifyOnUIThread(); | 52 void NotifyOnUIThread(); |
52 | 53 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 242 } |
242 | 243 |
243 void CannedBrowsingDataFileSystemHelper::StartFetching( | 244 void CannedBrowsingDataFileSystemHelper::StartFetching( |
244 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { | 245 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { |
245 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 246 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
246 DCHECK(!callback.is_null()); | 247 DCHECK(!callback.is_null()); |
247 | 248 |
248 BrowserThread::PostTask( | 249 BrowserThread::PostTask( |
249 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); | 250 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); |
250 } | 251 } |
OLD | NEW |