OLD | NEW |
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/safe_browsing/client_side_detection_host.h" | 5 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 callback); | 637 callback); |
638 } | 638 } |
639 | 639 |
640 void ClientSideDetectionHost::MalwareFeatureExtractionDone( | 640 void ClientSideDetectionHost::MalwareFeatureExtractionDone( |
641 bool feature_extraction_success, | 641 bool feature_extraction_success, |
642 std::unique_ptr<ClientMalwareRequest> request) { | 642 std::unique_ptr<ClientMalwareRequest> request) { |
643 DCHECK(request.get()); | 643 DCHECK(request.get()); |
644 DVLOG(2) << "Malware Feature extraction done for URL: " << request->url() | 644 DVLOG(2) << "Malware Feature extraction done for URL: " << request->url() |
645 << ", with badip url count:" << request->bad_ip_url_info_size(); | 645 << ", with badip url count:" << request->bad_ip_url_info_size(); |
646 UMA_HISTOGRAM_BOOLEAN( | 646 UMA_HISTOGRAM_BOOLEAN( |
647 "SBClientMalware.ResourceUrlMatchesBadIp", | 647 "SBClientMalware.ResourceUrlMatchedBadIp", |
648 request->bad_ip_url_info_size() > 0); | 648 request->bad_ip_url_info_size() > 0); |
649 // Send ping if there is matching features. | 649 // Send ping if there is matching features. |
650 if (feature_extraction_success && request->bad_ip_url_info_size() > 0) { | 650 if (feature_extraction_success && request->bad_ip_url_info_size() > 0) { |
651 DVLOG(1) << "Start sending client malware request."; | 651 DVLOG(1) << "Start sending client malware request."; |
652 ClientSideDetectionService::ClientReportMalwareRequestCallback callback; | 652 ClientSideDetectionService::ClientReportMalwareRequestCallback callback; |
653 callback = base::Bind(&ClientSideDetectionHost::MaybeShowMalwareWarning, | 653 callback = base::Bind(&ClientSideDetectionHost::MaybeShowMalwareWarning, |
654 weak_factory_.GetWeakPtr()); | 654 weak_factory_.GetWeakPtr()); |
655 csd_service_->SendClientReportMalwareRequest(request.release(), callback); | 655 csd_service_->SendClientReportMalwareRequest(request.release(), callback); |
656 } | 656 } |
657 } | 657 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 ui_manager_->RemoveObserver(this); | 715 ui_manager_->RemoveObserver(this); |
716 | 716 |
717 ui_manager_ = ui_manager; | 717 ui_manager_ = ui_manager; |
718 if (ui_manager) | 718 if (ui_manager) |
719 ui_manager_->AddObserver(this); | 719 ui_manager_->AddObserver(this); |
720 | 720 |
721 database_manager_ = database_manager; | 721 database_manager_ = database_manager; |
722 } | 722 } |
723 | 723 |
724 } // namespace safe_browsing | 724 } // namespace safe_browsing |
OLD | NEW |