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/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "net/cert/x509_certificate.h" | 40 #include "net/cert/x509_certificate.h" |
41 #include "net/http/http_status_code.h" | 41 #include "net/http/http_status_code.h" |
42 #include "net/url_request/url_fetcher.h" | 42 #include "net/url_request/url_fetcher.h" |
43 #include "net/url_request/url_fetcher_delegate.h" | 43 #include "net/url_request/url_fetcher_delegate.h" |
44 #include "net/url_request/url_request_context_getter.h" | 44 #include "net/url_request/url_request_context_getter.h" |
45 #include "net/url_request/url_request_status.h" | 45 #include "net/url_request/url_request_status.h" |
46 | 46 |
47 using content::BrowserThread; | 47 using content::BrowserThread; |
48 | 48 |
49 namespace { | 49 namespace { |
50 static const int64 kDownloadRequestTimeoutMs = 3000; | 50 static const int64 kDownloadRequestTimeoutMs = 7000; |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 namespace safe_browsing { | 53 namespace safe_browsing { |
54 | 54 |
55 const char DownloadProtectionService::kDownloadRequestUrl[] = | 55 const char DownloadProtectionService::kDownloadRequestUrl[] = |
56 "https://sb-ssl.google.com/safebrowsing/clientreport/download"; | 56 "https://sb-ssl.google.com/safebrowsing/clientreport/download"; |
57 | 57 |
58 namespace { | 58 namespace { |
59 ClientDownloadRequest::DownloadType GetDownloadType( | 59 ClientDownloadRequest::DownloadType GetDownloadType( |
60 const base::FilePath& file) { | 60 const base::FilePath& file) { |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 GURL DownloadProtectionService::GetDownloadRequestUrl() { | 1040 GURL DownloadProtectionService::GetDownloadRequestUrl() { |
1041 GURL url(kDownloadRequestUrl); | 1041 GURL url(kDownloadRequestUrl); |
1042 std::string api_key = google_apis::GetAPIKey(); | 1042 std::string api_key = google_apis::GetAPIKey(); |
1043 if (!api_key.empty()) | 1043 if (!api_key.empty()) |
1044 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); | 1044 url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true)); |
1045 | 1045 |
1046 return url; | 1046 return url; |
1047 } | 1047 } |
1048 | 1048 |
1049 } // namespace safe_browsing | 1049 } // namespace safe_browsing |
OLD | NEW |