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

Side by Side Diff: storage/browser/quota/usage_tracker.cc

Issue 2236453002: storage: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « storage/browser/quota/storage_monitor.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "storage/browser/quota/usage_tracker.h" 5 #include "storage/browser/quota/usage_tracker.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 24 matching lines...) Expand all
35 for (auto* client : clients) { 35 for (auto* client : clients) {
36 if (client->DoesSupport(type)) { 36 if (client->DoesSupport(type)) {
37 client_tracker_map_[client->id()] = 37 client_tracker_map_[client->id()] =
38 new ClientUsageTracker(this, client, type, special_storage_policy, 38 new ClientUsageTracker(this, client, type, special_storage_policy,
39 storage_monitor_); 39 storage_monitor_);
40 } 40 }
41 } 41 }
42 } 42 }
43 43
44 UsageTracker::~UsageTracker() { 44 UsageTracker::~UsageTracker() {
45 STLDeleteValues(&client_tracker_map_); 45 base::STLDeleteValues(&client_tracker_map_);
46 } 46 }
47 47
48 ClientUsageTracker* UsageTracker::GetClientTracker(QuotaClient::ID client_id) { 48 ClientUsageTracker* UsageTracker::GetClientTracker(QuotaClient::ID client_id) {
49 ClientTrackerMap::iterator found = client_tracker_map_.find(client_id); 49 ClientTrackerMap::iterator found = client_tracker_map_.find(client_id);
50 if (found != client_tracker_map_.end()) 50 if (found != client_tracker_map_.end())
51 return found->second; 51 return found->second;
52 return nullptr; 52 return nullptr;
53 } 53 }
54 54
55 void UsageTracker::GetGlobalLimitedUsage(const UsageCallback& callback) { 55 void UsageTracker::GetGlobalLimitedUsage(const UsageCallback& callback) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // Defend against confusing inputs from clients. 216 // Defend against confusing inputs from clients.
217 if (info->usage < 0) 217 if (info->usage < 0)
218 info->usage = 0; 218 info->usage = 0;
219 219
220 // All the clients have returned their usage data. Dispatch the 220 // All the clients have returned their usage data. Dispatch the
221 // pending callbacks. 221 // pending callbacks.
222 host_usage_callbacks_.Run(host, info->usage); 222 host_usage_callbacks_.Run(host, info->usage);
223 } 223 }
224 224
225 } // namespace storage 225 } // namespace storage
OLDNEW
« no previous file with comments | « storage/browser/quota/storage_monitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698