Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: chrome/browser/ui/webui/quota_internals_proxy.cc

Issue 10067033: RefCounted types should not have public destructors, chrome/browser/ui (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fix Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/quota_internals_proxy.h ('k') | chrome/browser/ui/webui/tracing_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/quota_internals_proxy.cc
diff --git a/chrome/browser/ui/webui/quota_internals_proxy.cc b/chrome/browser/ui/webui/quota_internals_proxy.cc
index 100f6d51aaa4a19319c61db7c3541e6911650995..2fa16844f1e73113b5ea5245152f769e6f0fc2a2 100644
--- a/chrome/browser/ui/webui/quota_internals_proxy.cc
+++ b/chrome/browser/ui/webui/quota_internals_proxy.cc
@@ -21,30 +21,6 @@ QuotaInternalsProxy::QuotaInternalsProxy(QuotaInternalsHandler* handler)
weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
}
-QuotaInternalsProxy::~QuotaInternalsProxy() {}
-
-#define RELAY_TO_HANDLER(func, arg_t) \
- void QuotaInternalsProxy::func(arg_t arg) { \
- if (!handler_) \
- return; \
- if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { \
- BrowserThread::PostTask( \
- BrowserThread::UI, FROM_HERE, \
- base::Bind(&QuotaInternalsProxy::func, this, arg)); \
- return; \
- } \
- \
- handler_->func(arg); \
- }
-
-RELAY_TO_HANDLER(ReportAvailableSpace, int64)
-RELAY_TO_HANDLER(ReportGlobalInfo, const GlobalStorageInfo&)
-RELAY_TO_HANDLER(ReportPerHostInfo, const std::vector<PerHostStorageInfo>&)
-RELAY_TO_HANDLER(ReportPerOriginInfo, const std::vector<PerOriginStorageInfo>&)
-RELAY_TO_HANDLER(ReportStatistics, const Statistics&)
-
-#undef RELAY_TO_HANDLER
-
void QuotaInternalsProxy::RequestInfo(
scoped_refptr<quota::QuotaManager> quota_manager) {
DCHECK(quota_manager);
@@ -87,6 +63,30 @@ void QuotaInternalsProxy::RequestInfo(
ReportStatistics(stats);
}
+QuotaInternalsProxy::~QuotaInternalsProxy() {}
+
+#define RELAY_TO_HANDLER(func, arg_t) \
+ void QuotaInternalsProxy::func(arg_t arg) { \
+ if (!handler_) \
+ return; \
+ if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { \
+ BrowserThread::PostTask( \
+ BrowserThread::UI, FROM_HERE, \
+ base::Bind(&QuotaInternalsProxy::func, this, arg)); \
+ return; \
+ } \
+ \
+ handler_->func(arg); \
+ }
+
+RELAY_TO_HANDLER(ReportAvailableSpace, int64)
+RELAY_TO_HANDLER(ReportGlobalInfo, const GlobalStorageInfo&)
+RELAY_TO_HANDLER(ReportPerHostInfo, const std::vector<PerHostStorageInfo>&)
+RELAY_TO_HANDLER(ReportPerOriginInfo, const std::vector<PerOriginStorageInfo>&)
+RELAY_TO_HANDLER(ReportStatistics, const Statistics&)
+
+#undef RELAY_TO_HANDLER
+
void QuotaInternalsProxy::DidGetAvailableSpace(quota::QuotaStatusCode status,
int64 space) {
if (status == quota::kQuotaStatusOk)
@@ -167,25 +167,6 @@ void QuotaInternalsProxy::DidGetHostUsage(const std::string& host,
hosts_pending_.begin()->second);
}
-void QuotaInternalsProxy::VisitHost(const std::string& host,
- quota::StorageType type) {
- if (hosts_visited_.insert(std::make_pair(host, type)).second) {
- hosts_pending_.insert(std::make_pair(host, type));
- if (hosts_pending_.size() == 1) {
- GetHostUsage(host, type);
- }
- }
-}
-
-void QuotaInternalsProxy::GetHostUsage(const std::string& host,
- quota::StorageType type) {
- DCHECK(quota_manager_);
- quota_manager_->GetHostUsage(
- host, type,
- base::Bind(&QuotaInternalsProxy::DidGetHostUsage,
- weak_factory_.GetWeakPtr()));
-}
-
void QuotaInternalsProxy::RequestPerOriginInfo(quota::StorageType type) {
DCHECK(quota_manager_);
@@ -215,4 +196,23 @@ void QuotaInternalsProxy::RequestPerOriginInfo(quota::StorageType type) {
ReportPerHostInfo(host_info);
}
+void QuotaInternalsProxy::VisitHost(const std::string& host,
+ quota::StorageType type) {
+ if (hosts_visited_.insert(std::make_pair(host, type)).second) {
+ hosts_pending_.insert(std::make_pair(host, type));
+ if (hosts_pending_.size() == 1) {
+ GetHostUsage(host, type);
+ }
+ }
+}
+
+void QuotaInternalsProxy::GetHostUsage(const std::string& host,
+ quota::StorageType type) {
+ DCHECK(quota_manager_);
+ quota_manager_->GetHostUsage(
+ host, type,
+ base::Bind(&QuotaInternalsProxy::DidGetHostUsage,
+ weak_factory_.GetWeakPtr()));
+}
+
} // namespace quota_internals
« no previous file with comments | « chrome/browser/ui/webui/quota_internals_proxy.h ('k') | chrome/browser/ui/webui/tracing_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698