| OLD | NEW |
| 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 #include "chrome/browser/safe_browsing/protocol_manager.h" | 5 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } else { | 612 } else { |
| 613 IssueChunkRequest(); | 613 IssueChunkRequest(); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 void SafeBrowsingProtocolManager::ReportMalware(const GURL& malware_url, | 617 void SafeBrowsingProtocolManager::ReportMalware(const GURL& malware_url, |
| 618 const GURL& page_url, | 618 const GURL& page_url, |
| 619 const GURL& referrer_url) { | 619 const GURL& referrer_url) { |
| 620 std::string report_str = StringPrintf( | 620 std::string report_str = StringPrintf( |
| 621 kSbMalwareReportUrl, | 621 kSbMalwareReportUrl, |
| 622 EscapeQueryParamValue(malware_url.spec()).c_str(), | 622 EscapeQueryParamValue(malware_url.spec(), true).c_str(), |
| 623 EscapeQueryParamValue(page_url.spec()).c_str(), | 623 EscapeQueryParamValue(page_url.spec(), true).c_str(), |
| 624 EscapeQueryParamValue(referrer_url.spec()).c_str(), | 624 EscapeQueryParamValue(referrer_url.spec(), true).c_str(), |
| 625 client_name_.c_str(), | 625 client_name_.c_str(), |
| 626 version_.c_str()); | 626 version_.c_str()); |
| 627 GURL report_url(report_str); | 627 GURL report_url(report_str); |
| 628 URLFetcher* report = new URLFetcher(report_url, URLFetcher::GET, this); | 628 URLFetcher* report = new URLFetcher(report_url, URLFetcher::GET, this); |
| 629 report->set_load_flags(net::LOAD_DISABLE_CACHE); | 629 report->set_load_flags(net::LOAD_DISABLE_CACHE); |
| 630 report->set_request_context(request_context_getter_); | 630 report->set_request_context(request_context_getter_); |
| 631 report->Start(); | 631 report->Start(); |
| 632 malware_reports_.insert(report); | 632 malware_reports_.insert(report); |
| 633 } | 633 } |
| 634 | 634 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 664 void SafeBrowsingProtocolManager::HandleGetHashError(const Time& now) { | 664 void SafeBrowsingProtocolManager::HandleGetHashError(const Time& now) { |
| 665 int next = GetNextBackOffTime(&gethash_error_count_, &gethash_back_off_mult_); | 665 int next = GetNextBackOffTime(&gethash_error_count_, &gethash_back_off_mult_); |
| 666 next_gethash_time_ = now + TimeDelta::FromSeconds(next); | 666 next_gethash_time_ = now + TimeDelta::FromSeconds(next); |
| 667 } | 667 } |
| 668 | 668 |
| 669 void SafeBrowsingProtocolManager::UpdateFinished(bool success) { | 669 void SafeBrowsingProtocolManager::UpdateFinished(bool success) { |
| 670 UMA_HISTOGRAM_COUNTS("SB2.UpdateSize", update_size_); | 670 UMA_HISTOGRAM_COUNTS("SB2.UpdateSize", update_size_); |
| 671 update_size_ = 0; | 671 update_size_ = 0; |
| 672 sb_service_->UpdateFinished(success); | 672 sb_service_->UpdateFinished(success); |
| 673 } | 673 } |
| OLD | NEW |