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

Side by Side Diff: net/sdch/sdch_owner.cc

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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 | « net/sdch/sdch_owner.h ('k') | net/sdch/sdch_owner_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "net/sdch/sdch_owner.h" 5 #include "net/sdch/sdch_owner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/alias.h" 8 #include "base/debug/alias.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h"
10 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
11 #include "base/prefs/persistent_pref_store.h" 12 #include "base/prefs/persistent_pref_store.h"
12 #include "base/prefs/value_map_pref_store.h" 13 #include "base/prefs/value_map_pref_store.h"
13 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
14 #include "base/time/default_clock.h" 15 #include "base/time/default_clock.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "net/base/sdch_manager.h" 17 #include "net/base/sdch_manager.h"
17 #include "net/base/sdch_net_log_params.h" 18 #include "net/base/sdch_net_log_params.h"
18 19
19 namespace net { 20 namespace net {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 RecordDictionaryEvictionOrUnload(it.server_hash(), it.size(), new_uses, 274 RecordDictionaryEvictionOrUnload(it.server_hash(), it.size(), new_uses,
274 fate); 275 fate);
275 } 276 }
276 manager_->RemoveObserver(this); 277 manager_->RemoveObserver(this);
277 278
278 // This object only observes the external store during loading, 279 // This object only observes the external store during loading,
279 // i.e. before it's made the default preferences store. 280 // i.e. before it's made the default preferences store.
280 if (external_pref_store_) 281 if (external_pref_store_)
281 external_pref_store_->RemoveObserver(this); 282 external_pref_store_->RemoveObserver(this);
282 283
283 int64 object_lifetime = 284 int64_t object_lifetime = (clock_->Now() - creation_time_).InMilliseconds();
284 (clock_->Now() - creation_time_).InMilliseconds();
285 for (const auto& val : consumed_byte_seconds_) { 285 for (const auto& val : consumed_byte_seconds_) {
286 if (object_lifetime > 0) { 286 if (object_lifetime > 0) {
287 // Objects that are created and immediately destroyed don't add any memory 287 // Objects that are created and immediately destroyed don't add any memory
288 // pressure over time (and also cause a crash here). 288 // pressure over time (and also cause a crash here).
289 UMA_HISTOGRAM_MEMORY_KB("Sdch3.TimeWeightedMemoryUse", 289 UMA_HISTOGRAM_MEMORY_KB("Sdch3.TimeWeightedMemoryUse",
290 val / object_lifetime); 290 val / object_lifetime);
291 } 291 }
292 } 292 }
293 293
294 } 294 }
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 } 711 }
712 712
713 return true; 713 return true;
714 } 714 }
715 715
716 bool SdchOwner::IsPersistingDictionaries() const { 716 bool SdchOwner::IsPersistingDictionaries() const {
717 return in_memory_pref_store_.get() != nullptr; 717 return in_memory_pref_store_.get() != nullptr;
718 } 718 }
719 719
720 } // namespace net 720 } // namespace net
OLDNEW
« no previous file with comments | « net/sdch/sdch_owner.h ('k') | net/sdch/sdch_owner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698