OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/net/chrome_dns_cert_provenance_checker.h" | 5 #include "chrome/browser/net/chrome_dns_cert_provenance_checker.h" |
6 | 6 |
7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "chrome/browser/net/chrome_url_request_context.h" | 9 #include "chrome/browser/net/chrome_url_request_context.h" |
10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
11 | 11 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // fire-and-forget operation, we don't care if there are any errors in the | 72 // fire-and-forget operation, we don't care if there are any errors in the |
73 // upload. | 73 // upload. |
74 class URLRequestDelegate : public net::URLRequest::Delegate { | 74 class URLRequestDelegate : public net::URLRequest::Delegate { |
75 public: | 75 public: |
76 explicit URLRequestDelegate(ChromeDnsCertProvenanceChecker* checker) | 76 explicit URLRequestDelegate(ChromeDnsCertProvenanceChecker* checker) |
77 : checker_(checker) { | 77 : checker_(checker) { |
78 } | 78 } |
79 | 79 |
80 // Delegate implementation | 80 // Delegate implementation |
81 void OnResponseStarted(net::URLRequest* request) { | 81 void OnResponseStarted(net::URLRequest* request) { |
82 const URLRequestStatus& status(request->status()); | 82 const net::URLRequestStatus& status(request->status()); |
83 if (!status.is_success()) { | 83 if (!status.is_success()) { |
84 LOG(WARNING) << "Certificate upload failed" | 84 LOG(WARNING) << "Certificate upload failed" |
85 << " status:" << status.status() | 85 << " status:" << status.status() |
86 << " os_error:" << status.os_error(); | 86 << " os_error:" << status.os_error(); |
87 } else if (request->GetResponseCode() != 200) { | 87 } else if (request->GetResponseCode() != 200) { |
88 LOG(WARNING) << "Certificate upload HTTP status: " | 88 LOG(WARNING) << "Certificate upload HTTP status: " |
89 << request->GetResponseCode(); | 89 << request->GetResponseCode(); |
90 } | 90 } |
91 checker_->RequestComplete(request); | 91 checker_->RequestComplete(request); |
92 } | 92 } |
(...skipping 13 matching lines...) Expand all Loading... |
106 std::set<net::URLRequest*> inflight_requests_; | 106 std::set<net::URLRequest*> inflight_requests_; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace | 109 } // namespace |
110 | 110 |
111 net::DnsCertProvenanceChecker* CreateChromeDnsCertProvenanceChecker( | 111 net::DnsCertProvenanceChecker* CreateChromeDnsCertProvenanceChecker( |
112 net::DnsRRResolver* dnsrr_resolver, | 112 net::DnsRRResolver* dnsrr_resolver, |
113 ChromeURLRequestContext* url_req_context) { | 113 ChromeURLRequestContext* url_req_context) { |
114 return new ChromeDnsCertProvenanceChecker(dnsrr_resolver, url_req_context); | 114 return new ChromeDnsCertProvenanceChecker(dnsrr_resolver, url_req_context); |
115 } | 115 } |
OLD | NEW |