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

Side by Side Diff: extensions/browser/api/cast_channel/cast_channel_api.h

Issue 2925053005: [cast_channel] Implement CastSocketService::OpenSocket() (Closed)
Patch Set: resolve code review comments from Mark 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 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 scoped_refptr<cast_channel::Logger> logger_; 156 scoped_refptr<cast_channel::Logger> logger_;
157 157
158 DISALLOW_COPY_AND_ASSIGN(CastMessageHandler); 158 DISALLOW_COPY_AND_ASSIGN(CastMessageHandler);
159 }; 159 };
160 160
161 // Validates that |connect_info| represents a valid IP end point and returns a 161 // Validates that |connect_info| represents a valid IP end point and returns a
162 // new IPEndPoint if so. Otherwise returns nullptr. 162 // new IPEndPoint if so. Otherwise returns nullptr.
163 static net::IPEndPoint* ParseConnectInfo( 163 static net::IPEndPoint* ParseConnectInfo(
164 const api::cast_channel::ConnectInfo& connect_info); 164 const api::cast_channel::ConnectInfo& connect_info);
165 165
166 void OnOpen(cast_channel::ChannelError result); 166 void OnOpen(int channel_id, cast_channel::ChannelError result);
167 167
168 std::unique_ptr<api::cast_channel::Open::Params> params_; 168 std::unique_ptr<api::cast_channel::Open::Params> params_;
169 // The id of the newly opened socket.
170 int new_channel_id_;
171 CastChannelAPI* api_; 169 CastChannelAPI* api_;
172 std::unique_ptr<net::IPEndPoint> ip_endpoint_; 170 std::unique_ptr<net::IPEndPoint> ip_endpoint_;
173 base::TimeDelta liveness_timeout_; 171 base::TimeDelta liveness_timeout_;
174 base::TimeDelta ping_interval_; 172 base::TimeDelta ping_interval_;
175 173
176 FRIEND_TEST_ALL_PREFIXES(CastChannelOpenFunctionTest, TestParseConnectInfo); 174 FRIEND_TEST_ALL_PREFIXES(CastChannelOpenFunctionTest, TestParseConnectInfo);
177 DISALLOW_COPY_AND_ASSIGN(CastChannelOpenFunction); 175 DISALLOW_COPY_AND_ASSIGN(CastChannelOpenFunction);
178 }; 176 };
179 177
180 class CastChannelSendFunction : public CastChannelAsyncApiFunction { 178 class CastChannelSendFunction : public CastChannelAsyncApiFunction {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 215
218 std::unique_ptr<api::cast_channel::Close::Params> params_; 216 std::unique_ptr<api::cast_channel::Close::Params> params_;
219 CastChannelAPI* api_; 217 CastChannelAPI* api_;
220 218
221 DISALLOW_COPY_AND_ASSIGN(CastChannelCloseFunction); 219 DISALLOW_COPY_AND_ASSIGN(CastChannelCloseFunction);
222 }; 220 };
223 221
224 } // namespace extensions 222 } // namespace extensions
225 223
226 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ 224 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698