OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 // Returns a URL with the given prefix and index | 33 // Returns a URL with the given prefix and index |
34 GURL TestURL(const char* prefix, int i) { | 34 GURL TestURL(const char* prefix, int i) { |
35 return GURL(base::StringPrintf("%s%d", prefix, i)); | 35 return GURL(base::StringPrintf("%s%d", prefix, i)); |
36 } | 36 } |
37 | 37 |
38 // We have no slaves, so all methods on this listener are a no-ops. | 38 // We have no slaves, so all methods on this listener are a no-ops. |
39 class DummyVisitedLinkEventListener : public VisitedLinkMaster::Listener { | 39 class DummyVisitedLinkEventListener : public VisitedLinkMaster::Listener { |
40 public: | 40 public: |
41 DummyVisitedLinkEventListener() {} | 41 DummyVisitedLinkEventListener() {} |
42 virtual void NewTable(base::SharedMemory* table) OVERRIDE {} | 42 virtual void NewTable(base::SharedMemory* table) override {} |
43 virtual void Add(VisitedLinkCommon::Fingerprint) OVERRIDE {} | 43 virtual void Add(VisitedLinkCommon::Fingerprint) override {} |
44 virtual void Reset() OVERRIDE {} | 44 virtual void Reset() override {} |
45 }; | 45 }; |
46 | 46 |
47 | 47 |
48 // this checks IsVisited for the URLs starting with the given prefix and | 48 // this checks IsVisited for the URLs starting with the given prefix and |
49 // within the given range | 49 // within the given range |
50 void CheckVisited(VisitedLinkMaster& master, const char* prefix, | 50 void CheckVisited(VisitedLinkMaster& master, const char* prefix, |
51 int begin, int end) { | 51 int begin, int end) { |
52 for (int i = begin; i < end; i++) | 52 for (int i = begin; i < end; i++) |
53 master.IsVisited(TestURL(prefix, i)); | 53 master.IsVisited(TestURL(prefix, i)); |
54 } | 54 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 cold_sum += cold_load_times[i]; | 192 cold_sum += cold_load_times[i]; |
193 hot_sum += hot_load_times[i]; | 193 hot_sum += hot_load_times[i]; |
194 } | 194 } |
195 base::LogPerfResult( | 195 base::LogPerfResult( |
196 "Visited_link_cold_load_time", cold_sum / cold_load_times.size(), "ms"); | 196 "Visited_link_cold_load_time", cold_sum / cold_load_times.size(), "ms"); |
197 base::LogPerfResult( | 197 base::LogPerfResult( |
198 "Visited_link_hot_load_time", hot_sum / hot_load_times.size(), "ms"); | 198 "Visited_link_hot_load_time", hot_sum / hot_load_times.size(), "ms"); |
199 } | 199 } |
200 | 200 |
201 } // namespace visitedlink | 201 } // namespace visitedlink |
OLD | NEW |