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

Side by Side Diff: chrome/browser/enumerate_modules_model_win.cc

Issue 6098009: Make sure the histogram counters for about:conflicts get uploaded.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/enumerate_modules_model_win.h" 5 #include "chrome/browser/enumerate_modules_model_win.h"
6 6
7 #include <Tlhelp32.h> 7 #include <Tlhelp32.h>
8 #include <wintrust.h> 8 #include <wintrust.h>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 enumerated_modules_->clear(); 343 enumerated_modules_->clear();
344 344
345 // Make sure the path mapping vector is setup so we can collapse paths. 345 // Make sure the path mapping vector is setup so we can collapse paths.
346 PreparePathMappings(); 346 PreparePathMappings();
347 347
348 base::TimeTicks checkpoint = base::TimeTicks::Now(); 348 base::TimeTicks checkpoint = base::TimeTicks::Now();
349 349
350 // Enumerating loaded modules must happen first since the other types of 350 // Enumerating loaded modules must happen first since the other types of
351 // modules check for duplication against the loaded modules. 351 // modules check for duplication against the loaded modules.
352 EnumerateLoadedModules(); 352 EnumerateLoadedModules();
353 HISTOGRAM_TIMES("Conflicts.EnumerateLoadedModules", 353 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateLoadedModules",
354 base::TimeTicks::Now() - checkpoint); 354 base::TimeTicks::Now() - checkpoint);
355 355
356 checkpoint = base::TimeTicks::Now(); 356 checkpoint = base::TimeTicks::Now();
jar (doing other things) 2011/01/08 00:00:59 nit: This may not be critical.... but the call to
357 EnumerateShellExtensions(); 357 EnumerateShellExtensions();
358 HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions", 358 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions",
359 base::TimeTicks::Now() - checkpoint); 359 base::TimeTicks::Now() - checkpoint);
360 360
361 checkpoint = base::TimeTicks::Now(); 361 checkpoint = base::TimeTicks::Now();
362 EnumerateWinsockModules(); 362 EnumerateWinsockModules();
363 HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules", 363 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules",
364 base::TimeTicks::Now() - checkpoint); 364 base::TimeTicks::Now() - checkpoint);
365 365
366 MatchAgainstBlacklist(); 366 MatchAgainstBlacklist();
367 367
368 std::sort(enumerated_modules_->begin(), 368 std::sort(enumerated_modules_->begin(),
369 enumerated_modules_->end(), ModuleSort); 369 enumerated_modules_->end(), ModuleSort);
370 370
371 if (!limited_mode_) { 371 if (!limited_mode_) {
372 // Send a reply back on the UI thread. 372 // Send a reply back on the UI thread.
373 BrowserThread::PostTask( 373 BrowserThread::PostTask(
374 callback_thread_id_, FROM_HERE, 374 callback_thread_id_, FROM_HERE,
375 NewRunnableMethod(this, &ModuleEnumerator::ReportBack)); 375 NewRunnableMethod(this, &ModuleEnumerator::ReportBack));
376 } else { 376 } else {
377 // We are on the main thread already. 377 // We are on the main thread already.
378 ReportBack(); 378 ReportBack();
379 } 379 }
380 380
381 HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime", 381 UMA_HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime",
382 base::TimeTicks::Now() - start_time); 382 base::TimeTicks::Now() - start_time);
383 } 383 }
384 384
385 void ModuleEnumerator::EnumerateLoadedModules() { 385 void ModuleEnumerator::EnumerateLoadedModules() {
386 // Get all modules in the current process. 386 // Get all modules in the current process.
387 ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, 387 ScopedHandle snap(::CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,
388 ::GetCurrentProcessId())); 388 ::GetCurrentProcessId()));
389 if (!snap.Get()) 389 if (!snap.Get())
390 return; 390 return;
391 391
392 // Walk the module list. 392 // Walk the module list.
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 module != enumerated_modules_.end(); ++module) { 830 module != enumerated_modules_.end(); ++module) {
831 if (module->status == ModuleEnumerator::CONFIRMED_BAD) 831 if (module->status == ModuleEnumerator::CONFIRMED_BAD)
832 ++confirmed_bad_modules_detected_; 832 ++confirmed_bad_modules_detected_;
833 if (module->status == ModuleEnumerator::SUSPECTED_BAD) 833 if (module->status == ModuleEnumerator::SUSPECTED_BAD)
834 ++suspected_bad_modules_detected_; 834 ++suspected_bad_modules_detected_;
835 } 835 }
836 836
837 scanning_ = false; 837 scanning_ = false;
838 lock->Release(); 838 lock->Release();
839 839
840 HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules", 840 UMA_HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules",
841 suspected_bad_modules_detected_); 841 suspected_bad_modules_detected_);
842 HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules", 842 UMA_HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules",
843 confirmed_bad_modules_detected_); 843 confirmed_bad_modules_detected_);
844 844
845 // Notifications are not available in limited mode. 845 // Notifications are not available in limited mode.
846 if (limited_mode_) 846 if (limited_mode_)
847 return; 847 return;
848 848
849 NotificationService::current()->Notify( 849 NotificationService::current()->Notify(
850 NotificationType::MODULE_LIST_ENUMERATED, 850 NotificationType::MODULE_LIST_ENUMERATED,
851 Source<EnumerateModulesModel>(this), 851 Source<EnumerateModulesModel>(this),
852 NotificationService::NoDetails()); 852 NotificationService::NoDetails());
853 853
(...skipping 23 matching lines...) Expand all
877 GenerateHash(WideToUTF8(module.name), &filename); 877 GenerateHash(WideToUTF8(module.name), &filename);
878 GenerateHash(WideToUTF8(module.location), &location); 878 GenerateHash(WideToUTF8(module.location), &location);
879 GenerateHash(WideToUTF8(module.description), &description); 879 GenerateHash(WideToUTF8(module.description), &description);
880 GenerateHash(WideToUTF8(module.digital_signer), &signer); 880 GenerateHash(WideToUTF8(module.digital_signer), &signer);
881 881
882 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS, 882 string16 url = l10n_util::GetStringFUTF16(IDS_HELP_CENTER_VIEW_CONFLICTS,
883 ASCIIToUTF16(filename), ASCIIToUTF16(location), 883 ASCIIToUTF16(filename), ASCIIToUTF16(location),
884 ASCIIToUTF16(description), ASCIIToUTF16(signer)); 884 ASCIIToUTF16(description), ASCIIToUTF16(signer));
885 return GURL(UTF16ToUTF8(url)); 885 return GURL(UTF16ToUTF8(url));
886 } 886 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698