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