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

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

Issue 2105123002: various: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « skia/ext/skia_trace_memory_dump_impl.cc ('k') | ui/gfx/render_text_unittest.cc » ('j') | 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 14 matching lines...) Expand all
25 25
26 } // namespace 26 } // namespace
27 27
28 UsageTracker::UsageTracker(const QuotaClientList& clients, 28 UsageTracker::UsageTracker(const QuotaClientList& clients,
29 StorageType type, 29 StorageType type,
30 SpecialStoragePolicy* special_storage_policy, 30 SpecialStoragePolicy* special_storage_policy,
31 StorageMonitor* storage_monitor) 31 StorageMonitor* storage_monitor)
32 : type_(type), 32 : type_(type),
33 storage_monitor_(storage_monitor), 33 storage_monitor_(storage_monitor),
34 weak_factory_(this) { 34 weak_factory_(this) {
35 for (const 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 STLDeleteValues(&client_tracker_map_);
(...skipping 170 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 | « skia/ext/skia_trace_memory_dump_impl.cc ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698