OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" |
15 #include "content/browser/browser_thread.h" | 16 #include "content/browser/browser_thread.h" |
16 #include "webkit/quota/quota_manager.h" | 17 #include "webkit/quota/quota_manager.h" |
17 #include "webkit/quota/quota_types.h" | 18 #include "webkit/quota/quota_types.h" |
18 | 19 |
19 namespace quota_internals { | 20 namespace quota_internals { |
20 | 21 |
21 class QuotaInternalsHandler; | 22 class QuotaInternalsHandler; |
22 class GlobalStorageInfo; | 23 class GlobalStorageInfo; |
23 class PerHostStorageInfo; | 24 class PerHostStorageInfo; |
24 class PerOriginStorageInfo; | 25 class PerOriginStorageInfo; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 // Helper. Called on IO Thread. | 64 // Helper. Called on IO Thread. |
64 void RequestPerOriginInfo(quota::StorageType type); | 65 void RequestPerOriginInfo(quota::StorageType type); |
65 void VisitHost(const std::string& host, quota::StorageType type); | 66 void VisitHost(const std::string& host, quota::StorageType type); |
66 void GetHostUsage(const std::string& host, quota::StorageType type); | 67 void GetHostUsage(const std::string& host, quota::StorageType type); |
67 | 68 |
68 // Used on UI Thread. | 69 // Used on UI Thread. |
69 QuotaInternalsHandler* handler_; | 70 QuotaInternalsHandler* handler_; |
70 | 71 |
71 // Used on IO Thread. | 72 // Used on IO Thread. |
72 base::ScopedCallbackFactory<QuotaInternalsProxy> callback_factory_; | 73 base::WeakPtrFactory<QuotaInternalsProxy> weak_factory_; |
73 scoped_refptr<quota::QuotaManager> quota_manager_; | 74 scoped_refptr<quota::QuotaManager> quota_manager_; |
74 std::set<std::pair<std::string, quota::StorageType> > | 75 std::set<std::pair<std::string, quota::StorageType> > |
75 hosts_visited_, hosts_pending_; | 76 hosts_visited_, hosts_pending_; |
76 std::vector<PerHostStorageInfo> report_pending_; | 77 std::vector<PerHostStorageInfo> report_pending_; |
77 | 78 |
78 friend class QuotaInternalsHandler; | 79 friend class QuotaInternalsHandler; |
79 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 80 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
80 friend class DeleteTask<QuotaInternalsProxy>; | 81 friend class DeleteTask<QuotaInternalsProxy>; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(QuotaInternalsProxy); | 83 DISALLOW_COPY_AND_ASSIGN(QuotaInternalsProxy); |
83 }; | 84 }; |
84 } // quota_internals | 85 } // quota_internals |
85 | 86 |
86 #endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ | 87 #endif // CHROME_BROWSER_UI_WEBUI_QUOTA_INTERNALS_PROXY_H_ |
OLD | NEW |