Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: extensions/browser/api/cast_channel/cast_socket.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 20 matching lines...) Expand all
31 #include "extensions/common/api/cast_channel/cast_channel.pb.h" 31 #include "extensions/common/api/cast_channel/cast_channel.pb.h"
32 #include "net/base/address_list.h" 32 #include "net/base/address_list.h"
33 #include "net/base/host_port_pair.h" 33 #include "net/base/host_port_pair.h"
34 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
35 #include "net/cert/cert_verifier.h" 35 #include "net/cert/cert_verifier.h"
36 #include "net/cert/cert_verify_result.h" 36 #include "net/cert/cert_verify_result.h"
37 #include "net/cert/ct_policy_enforcer.h" 37 #include "net/cert/ct_policy_enforcer.h"
38 #include "net/cert/multi_log_ct_verifier.h" 38 #include "net/cert/multi_log_ct_verifier.h"
39 #include "net/cert/x509_certificate.h" 39 #include "net/cert/x509_certificate.h"
40 #include "net/http/transport_security_state.h" 40 #include "net/http/transport_security_state.h"
41 #include "net/log/net_log_source_type.h"
41 #include "net/socket/client_socket_factory.h" 42 #include "net/socket/client_socket_factory.h"
42 #include "net/socket/client_socket_handle.h" 43 #include "net/socket/client_socket_handle.h"
43 #include "net/socket/ssl_client_socket.h" 44 #include "net/socket/ssl_client_socket.h"
44 #include "net/socket/stream_socket.h" 45 #include "net/socket/stream_socket.h"
45 #include "net/socket/tcp_client_socket.h" 46 #include "net/socket/tcp_client_socket.h"
46 #include "net/ssl/ssl_config_service.h" 47 #include "net/ssl/ssl_config_service.h"
47 #include "net/ssl/ssl_info.h" 48 #include "net/ssl/ssl_info.h"
48 49
49 // Helper for logging data with remote host IP and authentication state. 50 // Helper for logging data with remote host IP and authentication state.
50 // Assumes |ip_endpoint_| of type net::IPEndPoint and |channel_auth_| of enum 51 // Assumes |ip_endpoint_| of type net::IPEndPoint and |channel_auth_| of enum
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 is_canceled_(false), 126 is_canceled_(false),
126 device_capabilities_(device_capabilities), 127 device_capabilities_(device_capabilities),
127 audio_only_(false), 128 audio_only_(false),
128 connect_state_(proto::CONN_STATE_START_CONNECT), 129 connect_state_(proto::CONN_STATE_START_CONNECT),
129 error_state_(CHANNEL_ERROR_NONE), 130 error_state_(CHANNEL_ERROR_NONE),
130 ready_state_(READY_STATE_NONE), 131 ready_state_(READY_STATE_NONE),
131 auth_delegate_(nullptr) { 132 auth_delegate_(nullptr) {
132 DCHECK(net_log_); 133 DCHECK(net_log_);
133 DCHECK(channel_auth_ == CHANNEL_AUTH_TYPE_SSL || 134 DCHECK(channel_auth_ == CHANNEL_AUTH_TYPE_SSL ||
134 channel_auth_ == CHANNEL_AUTH_TYPE_SSL_VERIFIED); 135 channel_auth_ == CHANNEL_AUTH_TYPE_SSL_VERIFIED);
135 net_log_source_.type = net::NetLog::SOURCE_SOCKET; 136 net_log_source_.type = net::NetLogSourceType::SOCKET;
136 net_log_source_.id = net_log_->NextID(); 137 net_log_source_.id = net_log_->NextID();
137 } 138 }
138 139
139 CastSocketImpl::~CastSocketImpl() { 140 CastSocketImpl::~CastSocketImpl() {
140 // Ensure that resources are freed but do not run pending callbacks to avoid 141 // Ensure that resources are freed but do not run pending callbacks to avoid
141 // any re-entrancy. 142 // any re-entrancy.
142 CloseInternal(); 143 CloseInternal();
143 } 144 }
144 145
145 ReadyState CastSocketImpl::ready_state() const { 146 ReadyState CastSocketImpl::ready_state() const {
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state; 622 VLOG_WITH_CONNECTION(1) << "SetErrorState " << error_state;
622 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_); 623 DCHECK_EQ(CHANNEL_ERROR_NONE, error_state_);
623 error_state_ = error_state; 624 error_state_ = error_state;
624 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_)); 625 logger_->LogSocketErrorState(channel_id_, ErrorStateToProto(error_state_));
625 delegate_->OnError(error_state_); 626 delegate_->OnError(error_state_);
626 } 627 }
627 } // namespace cast_channel 628 } // namespace cast_channel
628 } // namespace api 629 } // namespace api
629 } // namespace extensions 630 } // namespace extensions
630 #undef VLOG_WITH_CONNECTION 631 #undef VLOG_WITH_CONNECTION
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698