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

Side by Side Diff: chrome/browser/win/enumerate_modules_model.cc

Issue 2564273002: Merge M55: Annotate Trusteer Rapport < 3.6 as incompatible with Chrome. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/win/enumerate_modules_model.h ('k') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/win/enumerate_modules_model.h" 5 #include "chrome/browser/win/enumerate_modules_model.h"
6 6
7 #include <softpub.h> 7 #include <softpub.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <tlhelp32.h> 10 #include <tlhelp32.h>
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions", 438 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateShellExtensions",
439 checkpoint2 - checkpoint); 439 checkpoint2 - checkpoint);
440 440
441 checkpoint = checkpoint2; 441 checkpoint = checkpoint2;
442 EnumerateWinsockModules(); 442 EnumerateWinsockModules();
443 checkpoint2 = base::TimeTicks::Now(); 443 checkpoint2 = base::TimeTicks::Now();
444 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules", 444 UMA_HISTOGRAM_TIMES("Conflicts.EnumerateWinsockModules",
445 checkpoint2 - checkpoint); 445 checkpoint2 - checkpoint);
446 446
447 // TODO(chrisha): Annotate any modules that are suspicious/bad. 447 // TODO(chrisha): Annotate any modules that are suspicious/bad.
448 AnnotateBadModules();
448 449
449 ReportThirdPartyMetrics(); 450 ReportThirdPartyMetrics();
450 451
451 std::sort(enumerated_modules_->begin(), 452 std::sort(enumerated_modules_->begin(),
452 enumerated_modules_->end(), ModuleSort); 453 enumerated_modules_->end(), ModuleSort);
453 454
454 UMA_HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime", 455 UMA_HISTOGRAM_TIMES("Conflicts.EnumerationTotalTime",
455 base::TimeTicks::Now() - start_time); 456 base::TimeTicks::Now() - start_time);
456 457
457 // Send a reply back on the UI thread. The |observer_| outlives this 458 // Send a reply back on the UI thread. The |observer_| outlives this
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 location.substr(prefix.length() - 1); 628 location.substr(prefix.length() - 1);
628 size_t length = new_location.length() - mapping->second.length(); 629 size_t length = new_location.length() - mapping->second.length();
629 if (length < min_length) { 630 if (length < min_length) {
630 entry->location = new_location; 631 entry->location = new_location;
631 min_length = length; 632 min_length = length;
632 } 633 }
633 } 634 }
634 } 635 }
635 } 636 }
636 637
638 void ModuleEnumerator::AnnotateBadModules() {
639 for (auto& module : *enumerated_modules_) {
640 if (module.name == L"rapportnikko.dll") {
641 base::Version version(base::UTF16ToASCII(module.version));
642 base::Version good("3.6");
643 if (version.CompareTo(good) < 0) {
644 module.status = ModuleStatus::CONFIRMED_BAD;
645 module.recommended_action = RecommendedAction::UNINSTALL;
646 }
647 }
648 }
649 }
650
637 void ModuleEnumerator::ReportThirdPartyMetrics() { 651 void ModuleEnumerator::ReportThirdPartyMetrics() {
638 static const wchar_t kMicrosoft[] = L"Microsoft "; 652 static const wchar_t kMicrosoft[] = L"Microsoft ";
639 653
640 // Used for counting unique certificates that need to be validated. A 654 // Used for counting unique certificates that need to be validated. A
641 // catalog counts as a single certificate, as does a file with a baked in 655 // catalog counts as a single certificate, as does a file with a baked in
642 // certificate. 656 // certificate.
643 std::set<base::FilePath> unique_certificates; 657 std::set<base::FilePath> unique_certificates;
644 size_t microsoft_certificates = 0; 658 size_t microsoft_certificates = 0;
645 size_t signed_modules = 0; 659 size_t signed_modules = 0;
646 size_t microsoft_modules = 0; 660 size_t microsoft_modules = 0;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 module_enumerator_.reset(); 926 module_enumerator_.reset();
913 927
914 UMA_HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules", 928 UMA_HISTOGRAM_COUNTS_100("Conflicts.SuspectedBadModules",
915 suspected_bad_modules_detected_); 929 suspected_bad_modules_detected_);
916 UMA_HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules", 930 UMA_HISTOGRAM_COUNTS_100("Conflicts.ConfirmedBadModules",
917 confirmed_bad_modules_detected_); 931 confirmed_bad_modules_detected_);
918 932
919 // Forward the callback to any registered observers. 933 // Forward the callback to any registered observers.
920 FOR_EACH_OBSERVER(Observer, observers_, OnScanCompleted()); 934 FOR_EACH_OBSERVER(Observer, observers_, OnScanCompleted());
921 } 935 }
OLDNEW
« no previous file with comments | « chrome/browser/win/enumerate_modules_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698