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

Side by Side Diff: components/history/core/browser/visit_tracker.cc

Issue 1548113002: Switch to standard integer types in components/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 4 years, 12 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "components/history/core/browser/visit_tracker.h" 5 #include "components/history/core/browser/visit_tracker.h"
6 6
7 #include <stddef.h>
8
7 #include "base/stl_util.h" 9 #include "base/stl_util.h"
8 10
9 namespace history { 11 namespace history {
10 12
11 // When the list gets longer than 'MaxItems', CleanupTransitionList will resize 13 // When the list gets longer than 'MaxItems', CleanupTransitionList will resize
12 // the list down to 'ResizeTo' size. This is so we only do few block moves of 14 // the list down to 'ResizeTo' size. This is so we only do few block moves of
13 // the data rather than constantly shuffle stuff around in the vector. 15 // the data rather than constantly shuffle stuff around in the vector.
14 static const size_t kMaxItemsInTransitionList = 96; 16 static const size_t kMaxItemsInTransitionList = 96;
15 static const size_t kResizeBigTransitionListTo = 64; 17 static const size_t kResizeBigTransitionListTo = 64;
16 static_assert(kResizeBigTransitionListTo < kMaxItemsInTransitionList, 18 static_assert(kResizeBigTransitionListTo < kMaxItemsInTransitionList,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 101
100 void VisitTracker::CleanupTransitionList(TransitionList* transitions) { 102 void VisitTracker::CleanupTransitionList(TransitionList* transitions) {
101 if (transitions->size() <= kMaxItemsInTransitionList) 103 if (transitions->size() <= kMaxItemsInTransitionList)
102 return; // Nothing to do. 104 return; // Nothing to do.
103 105
104 transitions->erase(transitions->begin(), 106 transitions->erase(transitions->begin(),
105 transitions->begin() + kResizeBigTransitionListTo); 107 transitions->begin() + kResizeBigTransitionListTo);
106 } 108 }
107 109
108 } // namespace history 110 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/visit_tracker.h ('k') | components/history/core/browser/visit_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698