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

Side by Side Diff: components/cast_channel/cast_socket.cc

Issue 2942743002: [cast_channel] Clean up CastSocketImpl ctor parameters (Closed)
Patch Set: Created 3 years, 6 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 "components/cast_channel/cast_socket.h" 5 #include "components/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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return net::OK; 82 return net::OK;
83 } 83 }
84 }; 84 };
85 85
86 } // namespace 86 } // namespace
87 87
88 using ChannelError = ::cast_channel::ChannelError; 88 using ChannelError = ::cast_channel::ChannelError;
89 using ChannelAuthType = ::cast_channel::ChannelAuthType; 89 using ChannelAuthType = ::cast_channel::ChannelAuthType;
90 using ReadyState = ::cast_channel::ReadyState; 90 using ReadyState = ::cast_channel::ReadyState;
91 91
92 CastSocketImpl::CastSocketImpl(const std::string& owner_extension_id, 92 CastSocketImpl::CastSocketImpl(const net::IPEndPoint& ip_endpoint,
93 const net::IPEndPoint& ip_endpoint,
94 ChannelAuthType channel_auth,
95 net::NetLog* net_log, 93 net::NetLog* net_log,
96 const base::TimeDelta& timeout, 94 const base::TimeDelta& timeout,
97 bool keep_alive, 95 bool keep_alive,
98 const scoped_refptr<Logger>& logger, 96 const scoped_refptr<Logger>& logger,
99 uint64_t device_capabilities) 97 uint64_t device_capabilities)
100 : CastSocketImpl(owner_extension_id, 98 : CastSocketImpl(ip_endpoint,
101 ip_endpoint,
102 channel_auth,
103 net_log, 99 net_log,
104 timeout, 100 timeout,
105 keep_alive, 101 keep_alive,
106 logger, 102 logger,
107 device_capabilities, 103 device_capabilities,
108 AuthContext::Create()) {} 104 AuthContext::Create()) {}
109 105
110 CastSocketImpl::CastSocketImpl(const std::string& owner_extension_id, 106 CastSocketImpl::CastSocketImpl(const net::IPEndPoint& ip_endpoint,
111 const net::IPEndPoint& ip_endpoint,
112 ChannelAuthType channel_auth,
113 net::NetLog* net_log, 107 net::NetLog* net_log,
114 const base::TimeDelta& timeout, 108 const base::TimeDelta& timeout,
115 bool keep_alive, 109 bool keep_alive,
116 const scoped_refptr<Logger>& logger, 110 const scoped_refptr<Logger>& logger,
117 uint64_t device_capabilities, 111 uint64_t device_capabilities,
118 const AuthContext& auth_context) 112 const AuthContext& auth_context)
119 : channel_id_(0), 113 : channel_id_(0),
120 ip_endpoint_(ip_endpoint), 114 ip_endpoint_(ip_endpoint),
121 channel_auth_(channel_auth), 115 channel_auth_(ChannelAuthType::SSL_VERIFIED),
imcheng 2017/06/14 22:25:34 Can we remove this field and just hardcode SSL_VER
zhaobin 2017/06/15 02:22:22 Done.
122 net_log_(net_log), 116 net_log_(net_log),
123 keep_alive_(keep_alive), 117 keep_alive_(keep_alive),
124 logger_(logger), 118 logger_(logger),
125 auth_context_(auth_context), 119 auth_context_(auth_context),
126 connect_timeout_(timeout), 120 connect_timeout_(timeout),
127 connect_timeout_timer_(new base::OneShotTimer), 121 connect_timeout_timer_(new base::OneShotTimer),
128 is_canceled_(false), 122 is_canceled_(false),
129 device_capabilities_(device_capabilities), 123 device_capabilities_(device_capabilities),
130 audio_only_(false), 124 audio_only_(false),
131 connect_state_(proto::CONN_STATE_START_CONNECT), 125 connect_state_(proto::CONN_STATE_START_CONNECT),
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 void CastSocketImpl::SetErrorState(ChannelError error_state) { 595 void CastSocketImpl::SetErrorState(ChannelError error_state) {
602 VLOG_WITH_CONNECTION(1) << "SetErrorState " 596 VLOG_WITH_CONNECTION(1) << "SetErrorState "
603 << ::cast_channel::ChannelErrorToString(error_state); 597 << ::cast_channel::ChannelErrorToString(error_state);
604 DCHECK_EQ(ChannelError::NONE, error_state_); 598 DCHECK_EQ(ChannelError::NONE, error_state_);
605 error_state_ = error_state; 599 error_state_ = error_state;
606 delegate_->OnError(error_state_); 600 delegate_->OnError(error_state_);
607 } 601 }
608 602
609 } // namespace cast_channel 603 } // namespace cast_channel
610 #undef VLOG_WITH_CONNECTION 604 #undef VLOG_WITH_CONNECTION
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698