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

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

Issue 2925053005: [cast_channel] Implement CastSocketService::OpenSocket() (Closed)
Patch Set: implement CastSocketService::OpenSocket() 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, 93 ChannelAuthType channel_auth,
95 net::NetLog* net_log, 94 net::NetLog* net_log,
96 const base::TimeDelta& timeout, 95 const base::TimeDelta& timeout,
97 bool keep_alive, 96 bool keep_alive,
98 const scoped_refptr<Logger>& logger, 97 const scoped_refptr<Logger>& logger,
99 uint64_t device_capabilities) 98 uint64_t device_capabilities)
100 : CastSocketImpl(owner_extension_id, 99 : CastSocketImpl(ip_endpoint,
101 ip_endpoint,
102 channel_auth, 100 channel_auth,
103 net_log, 101 net_log,
104 timeout, 102 timeout,
105 keep_alive, 103 keep_alive,
106 logger, 104 logger,
107 device_capabilities, 105 device_capabilities,
108 AuthContext::Create()) {} 106 AuthContext::Create()) {}
109 107
110 CastSocketImpl::CastSocketImpl(const std::string& owner_extension_id, 108 CastSocketImpl::CastSocketImpl(const net::IPEndPoint& ip_endpoint,
111 const net::IPEndPoint& ip_endpoint,
112 ChannelAuthType channel_auth, 109 ChannelAuthType channel_auth,
113 net::NetLog* net_log, 110 net::NetLog* net_log,
114 const base::TimeDelta& timeout, 111 const base::TimeDelta& timeout,
115 bool keep_alive, 112 bool keep_alive,
116 const scoped_refptr<Logger>& logger, 113 const scoped_refptr<Logger>& logger,
117 uint64_t device_capabilities, 114 uint64_t device_capabilities,
118 const AuthContext& auth_context) 115 const AuthContext& auth_context)
119 : channel_id_(0), 116 : channel_id_(0),
120 ip_endpoint_(ip_endpoint), 117 ip_endpoint_(ip_endpoint),
121 channel_auth_(channel_auth), 118 channel_auth_(channel_auth),
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 void CastSocketImpl::SetErrorState(ChannelError error_state) { 598 void CastSocketImpl::SetErrorState(ChannelError error_state) {
602 VLOG_WITH_CONNECTION(1) << "SetErrorState " 599 VLOG_WITH_CONNECTION(1) << "SetErrorState "
603 << ::cast_channel::ChannelErrorToString(error_state); 600 << ::cast_channel::ChannelErrorToString(error_state);
604 DCHECK_EQ(ChannelError::NONE, error_state_); 601 DCHECK_EQ(ChannelError::NONE, error_state_);
605 error_state_ = error_state; 602 error_state_ = error_state;
606 delegate_->OnError(error_state_); 603 delegate_->OnError(error_state_);
607 } 604 }
608 605
609 } // namespace cast_channel 606 } // namespace cast_channel
610 #undef VLOG_WITH_CONNECTION 607 #undef VLOG_WITH_CONNECTION
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698