| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/safe_browsing/incident_reporting/blacklist_load_analyze
r.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyze
r.h" |
| 6 | 6 |
| 7 #include "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Returns true if successful, false otherwise. | 27 // Returns true if successful, false otherwise. |
| 28 bool GetLoadedBlacklistedModules(std::vector<base::string16>* module_names) { | 28 bool GetLoadedBlacklistedModules(std::vector<base::string16>* module_names) { |
| 29 DCHECK(module_names); | 29 DCHECK(module_names); |
| 30 | 30 |
| 31 std::set<ModuleInfo> module_info_set; | 31 std::set<ModuleInfo> module_info_set; |
| 32 if (!GetLoadedModules(&module_info_set)) | 32 if (!GetLoadedModules(&module_info_set)) |
| 33 return false; | 33 return false; |
| 34 | 34 |
| 35 std::set<ModuleInfo>::const_iterator module_iter(module_info_set.begin()); | 35 std::set<ModuleInfo>::const_iterator module_iter(module_info_set.begin()); |
| 36 for (; module_iter != module_info_set.end(); ++module_iter) { | 36 for (; module_iter != module_info_set.end(); ++module_iter) { |
| 37 base::string16 module_file_name(base::StringToLowerASCII( | 37 base::string16 module_file_name(base::ToLowerASCII( |
| 38 base::FilePath(module_iter->name).BaseName().value())); | 38 base::FilePath(module_iter->name).BaseName().value())); |
| 39 if (blacklist::GetBlacklistIndex(module_file_name.c_str()) != -1) { | 39 if (blacklist::GetBlacklistIndex(module_file_name.c_str()) != -1) { |
| 40 module_names->push_back(module_iter->name); | 40 module_names->push_back(module_iter->name); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 return true; | 44 return true; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void VerifyBlacklistLoadState(scoped_ptr<IncidentReceiver> incident_receiver) { | 47 void VerifyBlacklistLoadState(scoped_ptr<IncidentReceiver> incident_receiver) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Send the report. | 103 // Send the report. |
| 104 incident_receiver->AddIncidentForProcess( | 104 incident_receiver->AddIncidentForProcess( |
| 105 make_scoped_ptr(new BlacklistLoadIncident(blacklist_load.Pass()))); | 105 make_scoped_ptr(new BlacklistLoadIncident(blacklist_load.Pass()))); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace safe_browsing | 110 } // namespace safe_browsing |
| OLD | NEW |