| 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 17 matching lines...) Expand all Loading... |
| 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 virtual void StartFetching(const base::Callback< |
| 38 void(const std::list<FileSystemInfo>&)>& callback) OVERRIDE; | 38 void(const std::list<FileSystemInfo>&)>& callback) override; |
| 39 virtual void DeleteFileSystemOrigin(const GURL& origin) OVERRIDE; | 39 virtual void DeleteFileSystemOrigin(const GURL& origin) override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 virtual ~BrowsingDataFileSystemHelperImpl(); | 42 virtual ~BrowsingDataFileSystemHelperImpl(); |
| 43 | 43 |
| 44 // Enumerates all filesystem files, storing the resulting list into | 44 // Enumerates all filesystem files, storing the resulting list into |
| 45 // file_system_file_ for later use. This must be called on the file | 45 // file_system_file_ for later use. This must be called on the file |
| 46 // task runner. | 46 // task runner. |
| 47 void FetchFileSystemInfoInFileThread(); | 47 void FetchFileSystemInfoInFileThread(); |
| 48 | 48 |
| 49 // Triggers the success callback as the end of a StartFetching workflow. This | 49 // Triggers the success callback as the end of a StartFetching workflow. This |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 void CannedBrowsingDataFileSystemHelper::StartFetching( | 243 void CannedBrowsingDataFileSystemHelper::StartFetching( |
| 244 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { | 244 const base::Callback<void(const std::list<FileSystemInfo>&)>& callback) { |
| 245 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 245 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 246 DCHECK(!callback.is_null()); | 246 DCHECK(!callback.is_null()); |
| 247 | 247 |
| 248 BrowserThread::PostTask( | 248 BrowserThread::PostTask( |
| 249 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); | 249 BrowserThread::UI, FROM_HERE, base::Bind(callback, file_system_info_)); |
| 250 } | 250 } |
| OLD | NEW |