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 "extensions/browser/api/cast_channel/cast_socket.h" | 5 #include "extensions/browser/api/cast_channel/cast_socket.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 return state == proto::CONN_STATE_FINISHED || | 71 return state == proto::CONN_STATE_FINISHED || |
72 state == proto::CONN_STATE_ERROR || state == proto::CONN_STATE_TIMEOUT; | 72 state == proto::CONN_STATE_ERROR || state == proto::CONN_STATE_TIMEOUT; |
73 } | 73 } |
74 | 74 |
75 // Cert verifier which blindly accepts all certificates, regardless of validity. | 75 // Cert verifier which blindly accepts all certificates, regardless of validity. |
76 class FakeCertVerifier : public net::CertVerifier { | 76 class FakeCertVerifier : public net::CertVerifier { |
77 public: | 77 public: |
78 FakeCertVerifier() {} | 78 FakeCertVerifier() {} |
79 ~FakeCertVerifier() override {} | 79 ~FakeCertVerifier() override {} |
80 | 80 |
81 int Verify(net::X509Certificate* cert, | 81 int Verify(const net::CertVerifier::RequestParams& params, |
82 const std::string&, | |
83 const std::string&, | |
84 int, | |
85 net::CRLSet*, | 82 net::CRLSet*, |
86 net::CertVerifyResult* verify_result, | 83 net::CertVerifyResult* verify_result, |
87 const net::CompletionCallback&, | 84 const net::CompletionCallback&, |
88 std::unique_ptr<net::CertVerifier::Request>*, | 85 std::unique_ptr<net::CertVerifier::Request>*, |
89 const net::BoundNetLog&) override { | 86 const net::BoundNetLog&) override { |
90 verify_result->Reset(); | 87 verify_result->Reset(); |
91 verify_result->verified_cert = cert; | 88 verify_result->verified_cert = params.certificate(); |
92 return net::OK; | 89 return net::OK; |
93 } | 90 } |
94 }; | 91 }; |
95 | 92 |
96 } // namespace | 93 } // namespace |
97 | 94 |
98 CastSocket::CastSocket(const std::string& owner_extension_id) | 95 CastSocket::CastSocket(const std::string& owner_extension_id) |
99 : ApiResource(owner_extension_id) { | 96 : ApiResource(owner_extension_id) { |
100 } | 97 } |
101 | 98 |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state; | 613 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state; |
617 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_); | 614 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_); |
618 error_state_ = error_state; | 615 error_state_ = error_state; |
619 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_)); | 616 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_)); |
620 delegate_->OnError(error_state_); | 617 delegate_->OnError(error_state_); |
621 } | 618 } |
622 } // namespace cast_channel | 619 } // namespace cast_channel |
623 } // namespace api | 620 } // namespace api |
624 } // namespace extensions | 621 } // namespace extensions |
625 #undef VLOG_WITH_CONNECTION | 622 #undef VLOG_WITH_CONNECTION |
OLD | NEW |