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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc

Issue 504068: Revert 34994, maybe it regressed startup perf - Fix cpu/memory measurements o... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/trace_event.cc ('k') | chrome/browser/task_manager.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 (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 // Unit tests for the SafeBrowsing storage system. 5 // Unit tests for the SafeBrowsing storage system.
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 FilePath full_initial_db = GetFullSBDataPath(initial_db); 1071 FilePath full_initial_db = GetFullSBDataPath(initial_db);
1072 ASSERT_TRUE(file_util::CopyFile(full_initial_db, path)); 1072 ASSERT_TRUE(file_util::CopyFile(full_initial_db, path));
1073 } 1073 }
1074 1074
1075 SafeBrowsingDatabase* database = SafeBrowsingDatabase::Create(); 1075 SafeBrowsingDatabase* database = SafeBrowsingDatabase::Create();
1076 database->Init(path, NULL); 1076 database->Init(path, NULL);
1077 1077
1078 Time before_time = Time::Now(); 1078 Time before_time = Time::Now();
1079 base::ProcessHandle handle = base::Process::Current().handle(); 1079 base::ProcessHandle handle = base::Process::Current().handle();
1080 scoped_ptr<base::ProcessMetrics> metric( 1080 scoped_ptr<base::ProcessMetrics> metric(
1081 #if !defined(OS_MACOSX)
1082 base::ProcessMetrics::CreateProcessMetrics(handle)); 1081 base::ProcessMetrics::CreateProcessMetrics(handle));
1083 #else
1084 // Getting stats only for the current process is enough, so NULL is fine.
1085 base::ProcessMetrics::CreateProcessMetrics(handle, NULL));
1086 #endif
1087 CHECK(metric->GetIOCounters(&before)); 1082 CHECK(metric->GetIOCounters(&before));
1088 1083
1089 std::vector<SBListChunkRanges> lists; 1084 std::vector<SBListChunkRanges> lists;
1090 database->UpdateStarted(); 1085 database->UpdateStarted();
1091 database->GetListsInfo(&lists); 1086 database->GetListsInfo(&lists);
1092 database->DeleteChunks(deletes); 1087 database->DeleteChunks(deletes);
1093 for (size_t i = 0; i < chunks.size(); ++i) 1088 for (size_t i = 0; i < chunks.size(); ++i)
1094 database->InsertChunks(chunks[i].listname, chunks[i].chunks); 1089 database->InsertChunks(chunks[i].listname, chunks[i].chunks);
1095 1090
1096 database->UpdateFinished(true); 1091 database->UpdateFinished(true);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 TEST(SafeBrowsingDatabase, DISABLED_DatabaseOldLotsofDeletesIO) { 1246 TEST(SafeBrowsingDatabase, DISABLED_DatabaseOldLotsofDeletesIO) {
1252 std::vector<ChunksInfo> chunks; 1247 std::vector<ChunksInfo> chunks;
1253 std::vector<SBChunkDelete>* deletes = new std::vector<SBChunkDelete>; 1248 std::vector<SBChunkDelete>* deletes = new std::vector<SBChunkDelete>;
1254 SBChunkDelete del; 1249 SBChunkDelete del;
1255 del.is_sub_del = false; 1250 del.is_sub_del = false;
1256 del.list_name = safe_browsing_util::kMalwareList; 1251 del.list_name = safe_browsing_util::kMalwareList;
1257 del.chunk_del.push_back(ChunkRange(3539, 3579)); 1252 del.chunk_del.push_back(ChunkRange(3539, 3579));
1258 deletes->push_back(del); 1253 deletes->push_back(del);
1259 PeformUpdate(GetOldSafeBrowsingPath(), chunks, deletes); 1254 PeformUpdate(GetOldSafeBrowsingPath(), chunks, deletes);
1260 } 1255 }
OLDNEW
« no previous file with comments | « base/trace_event.cc ('k') | chrome/browser/task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698