Chromium Code Reviews| Index: chrome/browser/content_settings/storage_info_fetcher.h |
| diff --git a/chrome/browser/content_settings/storage_info_fetcher.h b/chrome/browser/content_settings/storage_info_fetcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..26ba5e439baf6893f61a50665e57a4973e0fe791 |
| --- /dev/null |
| +++ b/chrome/browser/content_settings/storage_info_fetcher.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
raymes
2016/01/20 02:51:42
Hmm not sure if this is the right place to put thi
Finnur
2016/01/22 15:07:35
It doesn't belong under Web UI because I plan on m
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CONTENT_SETTINGS_STORAGE_INFO_FETCHER_H_ |
| +#define CHROME_BROWSER_CONTENT_SETTINGS_STORAGE_INFO_FETCHER_H_ |
| + |
| +#include "content/public/browser/browser_thread.h" |
|
michaelpg
2016/01/19 20:47:54
is this used here?
Finnur
2016/01/22 15:07:35
Nope, moved.
|
| +#include "storage/browser/quota/quota_manager.h" |
| + |
| +class StorageInfoFetcher : |
|
Finnur
2016/01/19 17:08:57
This class is really a distillation of the one tha
michaelpg
2016/01/19 20:47:54
add comment for class
Finnur
2016/01/22 15:07:35
Done.
|
| + public base::RefCountedThreadSafe<StorageInfoFetcher> { |
|
michaelpg
2016/01/19 20:47:54
include ref_counted.h
Finnur
2016/01/22 15:07:35
Done.
|
| + public: |
| + explicit StorageInfoFetcher(storage::QuotaManager* quota_manager); |
| + |
| + // Asynchronously fetches the StorageInfo. |
| + void Run(); |
| + |
| + protected: |
| + virtual ~StorageInfoFetcher(); |
| + |
| + // The callback for when usage information is ready. |
| + virtual void OnGetUsageInfo(const storage::UsageInfoEntries& entries) = 0; |
| + |
| + private: |
| + friend class base::RefCountedThreadSafe<StorageInfoFetcher>; |
| + |
| + void GetUsageInfo(); |
| + void OnGetUsageInfoInternal(const storage::UsageInfoEntries& entries); |
| + void InvokeCallback(); |
| + |
| + storage::QuotaManager* quota_manager_; |
| + storage::UsageInfoEntries entries_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(StorageInfoFetcher); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_CONTENT_SETTINGS_STORAGE_INFO_FETCHER_H_ |