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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 uint64 device_capabilities) | 96 uint64 device_capabilities) |
97 : CastSocket(owner_extension_id), | 97 : CastSocket(owner_extension_id), |
98 owner_extension_id_(owner_extension_id), | 98 owner_extension_id_(owner_extension_id), |
99 channel_id_(0), | 99 channel_id_(0), |
100 ip_endpoint_(ip_endpoint), | 100 ip_endpoint_(ip_endpoint), |
101 channel_auth_(channel_auth), | 101 channel_auth_(channel_auth), |
102 net_log_(net_log), | 102 net_log_(net_log), |
103 keep_alive_(keep_alive), | 103 keep_alive_(keep_alive), |
104 logger_(logger), | 104 logger_(logger), |
105 connect_timeout_(timeout), | 105 connect_timeout_(timeout), |
106 connect_timeout_timer_(new base::OneShotTimer<CastSocketImpl>), | 106 connect_timeout_timer_(new base::OneShotTimer), |
107 is_canceled_(false), | 107 is_canceled_(false), |
108 device_capabilities_(device_capabilities), | 108 device_capabilities_(device_capabilities), |
109 connect_state_(proto::CONN_STATE_START_CONNECT), | 109 connect_state_(proto::CONN_STATE_START_CONNECT), |
110 error_state_(CHANNEL_ERROR_NONE), | 110 error_state_(CHANNEL_ERROR_NONE), |
111 ready_state_(READY_STATE_NONE), | 111 ready_state_(READY_STATE_NONE), |
112 auth_delegate_(nullptr) { | 112 auth_delegate_(nullptr) { |
113 DCHECK(net_log_); | 113 DCHECK(net_log_); |
114 DCHECK(channel_auth_ == CHANNEL_AUTH_TYPE_SSL || | 114 DCHECK(channel_auth_ == CHANNEL_AUTH_TYPE_SSL || |
115 channel_auth_ == CHANNEL_AUTH_TYPE_SSL_VERIFIED); | 115 channel_auth_ == CHANNEL_AUTH_TYPE_SSL_VERIFIED); |
116 net_log_source_.type = net::NetLog::SOURCE_SOCKET; | 116 net_log_source_.type = net::NetLog::SOURCE_SOCKET; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state; | 617 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state; |
618 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_); | 618 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_); |
619 error_state_ = error_state; | 619 error_state_ = error_state; |
620 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_)); | 620 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_)); |
621 delegate_->OnError(error_state_); | 621 delegate_->OnError(error_state_); |
622 } | 622 } |
623 } // namespace cast_channel | 623 } // namespace cast_channel |
624 } // namespace api | 624 } // namespace api |
625 } // namespace extensions | 625 } // namespace extensions |
626 #undef VLOG_WITH_CONNECTION | 626 #undef VLOG_WITH_CONNECTION |
OLD | NEW |