| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // we have no slaves, so this broadcase is a NOP | 33 // we have no slaves, so this broadcase is a NOP |
| 34 VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent; | 34 VisitedLinkMaster::PostNewTableEvent DummyBroadcastNewTableEvent; |
| 35 void DummyBroadcastNewTableEvent(base::SharedMemory *table) { | 35 void DummyBroadcastNewTableEvent(base::SharedMemory *table) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Call at the beginning of the test to retrieve the database name. | 38 // Call at the beginning of the test to retrieve the database name. |
| 39 void InitDBName(std::wstring* db_name) { | 39 void InitDBName(std::wstring* db_name) { |
| 40 FilePath db_path; | 40 FilePath db_path; |
| 41 ASSERT_TRUE(file_util::GetCurrentDirectory(&db_path)); | 41 ASSERT_TRUE(file_util::GetCurrentDirectory(&db_path)); |
| 42 db_path = db_path.Append(FILE_PATH_LITERAL("TempVisitedLinks")); | 42 db_path = db_path.AppendASCII("TempVisitedLinks"); |
| 43 *db_name = db_path.ToWStringHack(); | 43 *db_name = db_path.ToWStringHack(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 // this checks IsVisited for the URLs starting with the given prefix and | 46 // this checks IsVisited for the URLs starting with the given prefix and |
| 47 // within the given range | 47 // within the given range |
| 48 void CheckVisited(VisitedLinkMaster& master, const char* prefix, | 48 void CheckVisited(VisitedLinkMaster& master, const char* prefix, |
| 49 int begin, int end) { | 49 int begin, int end) { |
| 50 for (int i = begin; i < end; i++) | 50 for (int i = begin; i < end; i++) |
| 51 master.IsVisited(TestURL(prefix, i)); | 51 master.IsVisited(TestURL(prefix, i)); |
| 52 } | 52 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 184 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
| 185 cold_sum += cold_load_times[i]; | 185 cold_sum += cold_load_times[i]; |
| 186 hot_sum += hot_load_times[i]; | 186 hot_sum += hot_load_times[i]; |
| 187 } | 187 } |
| 188 LogPerfResult("Visited_link_cold_load_time", | 188 LogPerfResult("Visited_link_cold_load_time", |
| 189 cold_sum / cold_load_times.size(), "ms"); | 189 cold_sum / cold_load_times.size(), "ms"); |
| 190 LogPerfResult("Visited_link_hot_load_time", | 190 LogPerfResult("Visited_link_hot_load_time", |
| 191 hot_sum / hot_load_times.size(), "ms"); | 191 hot_sum / hot_load_times.size(), "ms"); |
| 192 } | 192 } |
| 193 | 193 |
| OLD | NEW |