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

Side by Side Diff: chrome/browser/ui/webui/quota_internals_proxy.cc

Issue 10958032: Merged HostQuotaCallback into QuotaCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ui/webui/quota_internals_proxy.h" 5 #include "chrome/browser/ui/webui/quota_internals_proxy.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 return; 31 return;
32 } 32 }
33 33
34 quota_manager_ = quota_manager; 34 quota_manager_ = quota_manager;
35 quota_manager_->GetAvailableSpace( 35 quota_manager_->GetAvailableSpace(
36 base::Bind(&QuotaInternalsProxy::DidGetAvailableSpace, 36 base::Bind(&QuotaInternalsProxy::DidGetAvailableSpace,
37 weak_factory_.GetWeakPtr())); 37 weak_factory_.GetWeakPtr()));
38 38
39 quota_manager_->GetTemporaryGlobalQuota( 39 quota_manager_->GetTemporaryGlobalQuota(
40 base::Bind(&QuotaInternalsProxy::DidGetGlobalQuota, 40 base::Bind(&QuotaInternalsProxy::DidGetGlobalQuota,
41 weak_factory_.GetWeakPtr())); 41 weak_factory_.GetWeakPtr(), quota::kStorageTypeTemporary));
42 42
43 quota_manager_->GetGlobalUsage( 43 quota_manager_->GetGlobalUsage(
44 quota::kStorageTypeTemporary, 44 quota::kStorageTypeTemporary,
45 base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage, 45 base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage,
46 weak_factory_.GetWeakPtr())); 46 weak_factory_.GetWeakPtr()));
47 47
48 quota_manager_->GetGlobalUsage( 48 quota_manager_->GetGlobalUsage(
49 quota::kStorageTypePersistent, 49 quota::kStorageTypePersistent,
50 base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage, 50 base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage,
51 weak_factory_.GetWeakPtr())); 51 weak_factory_.GetWeakPtr()));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 RELAY_TO_HANDLER(ReportStatistics, const Statistics&) 86 RELAY_TO_HANDLER(ReportStatistics, const Statistics&)
87 87
88 #undef RELAY_TO_HANDLER 88 #undef RELAY_TO_HANDLER
89 89
90 void QuotaInternalsProxy::DidGetAvailableSpace(quota::QuotaStatusCode status, 90 void QuotaInternalsProxy::DidGetAvailableSpace(quota::QuotaStatusCode status,
91 int64 space) { 91 int64 space) {
92 if (status == quota::kQuotaStatusOk) 92 if (status == quota::kQuotaStatusOk)
93 ReportAvailableSpace(space); 93 ReportAvailableSpace(space);
94 } 94 }
95 95
96 void QuotaInternalsProxy::DidGetGlobalQuota(quota::QuotaStatusCode status, 96 void QuotaInternalsProxy::DidGetGlobalQuota(quota::StorageType type,
97 quota::StorageType type, 97 quota::QuotaStatusCode status,
98 int64 quota) { 98 int64 quota) {
99 if (status == quota::kQuotaStatusOk) { 99 if (status == quota::kQuotaStatusOk) {
100 GlobalStorageInfo info(type); 100 GlobalStorageInfo info(type);
101 info.set_quota(quota); 101 info.set_quota(quota);
102 ReportGlobalInfo(info); 102 ReportGlobalInfo(info);
103 } 103 }
104 } 104 }
105 105
106 void QuotaInternalsProxy::DidGetGlobalUsage(quota::StorageType type, 106 void QuotaInternalsProxy::DidGetGlobalUsage(quota::StorageType type,
107 int64 usage, 107 int64 usage,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void QuotaInternalsProxy::GetHostUsage(const std::string& host, 209 void QuotaInternalsProxy::GetHostUsage(const std::string& host,
210 quota::StorageType type) { 210 quota::StorageType type) {
211 DCHECK(quota_manager_); 211 DCHECK(quota_manager_);
212 quota_manager_->GetHostUsage( 212 quota_manager_->GetHostUsage(
213 host, type, 213 host, type,
214 base::Bind(&QuotaInternalsProxy::DidGetHostUsage, 214 base::Bind(&QuotaInternalsProxy::DidGetHostUsage,
215 weak_factory_.GetWeakPtr(), host, type)); 215 weak_factory_.GetWeakPtr(), host, type));
216 } 216 }
217 217
218 } // namespace quota_internals 218 } // namespace quota_internals
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698