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

Side by Side Diff: chrome/browser/extensions/api/cast_channel/cast_socket.h

Issue 160973002: Two chagnes to cast socket: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "chrome/browser/extensions/api/api_resource.h" 17 #include "chrome/browser/extensions/api/api_resource.h"
18 #include "chrome/browser/extensions/api/api_resource_manager.h" 18 #include "chrome/browser/extensions/api/api_resource_manager.h"
19 #include "chrome/browser/extensions/api/cast_channel/cast_channel.pb.h"
20 #include "chrome/common/extensions/api/cast_channel.h" 19 #include "chrome/common/extensions/api/cast_channel.h"
21 #include "net/base/completion_callback.h" 20 #include "net/base/completion_callback.h"
22 #include "net/base/io_buffer.h" 21 #include "net/base/io_buffer.h"
23 #include "net/base/ip_endpoint.h" 22 #include "net/base/ip_endpoint.h"
24 #include "net/base/net_log.h" 23 #include "net/base/net_log.h"
25 #include "url/gurl.h" 24 #include "url/gurl.h"
26 25
27 namespace net { 26 namespace net {
28 class AddressList; 27 class AddressList;
29 class CertVerifier; 28 class CertVerifier;
30 class SSLClientSocket; 29 class SSLClientSocket;
31 class StreamSocket; 30 class StreamSocket;
32 class TCPClientSocket; 31 class TCPClientSocket;
33 class TransportSecurityState; 32 class TransportSecurityState;
34 } 33 }
35 34
36 namespace extensions { 35 namespace extensions {
37 namespace api { 36 namespace api {
38 namespace cast_channel { 37 namespace cast_channel {
39 38
39 class CastMessage;
40
40 // Size (in bytes) of the largest allowed message payload on the wire (without 41 // Size (in bytes) of the largest allowed message payload on the wire (without
41 // the header). 42 // the header).
42 extern const uint32 kMaxMessageSize; 43 extern const uint32 kMaxMessageSize;
43 44
44 // Size (in bytes) of the message header. 45 // Size (in bytes) of the message header.
45 extern const uint32 kMessageHeaderSize; 46 extern const uint32 kMessageHeaderSize;
46 47
47 // This class implements a channel between Chrome and a Cast device using a TCP 48 // This class implements a channel between Chrome and a Cast device using a TCP
48 // socket. The channel may be unauthenticated (cast://) or authenticated 49 // socket. The channel may be unauthenticated (cast://) or authenticated
49 // (casts://). All CastSocket objects must be used only on the IO thread. 50 // (casts://). All CastSocket objects must be used only on the IO thread.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 271
271 // IOBuffer for reading the message header. 272 // IOBuffer for reading the message header.
272 scoped_refptr<net::GrowableIOBuffer> header_read_buffer_; 273 scoped_refptr<net::GrowableIOBuffer> header_read_buffer_;
273 // IOBuffer for reading the message body. 274 // IOBuffer for reading the message body.
274 scoped_refptr<net::GrowableIOBuffer> body_read_buffer_; 275 scoped_refptr<net::GrowableIOBuffer> body_read_buffer_;
275 // IOBuffer to currently read into. 276 // IOBuffer to currently read into.
276 scoped_refptr<net::GrowableIOBuffer> current_read_buffer_; 277 scoped_refptr<net::GrowableIOBuffer> current_read_buffer_;
277 // The number of bytes in the current message body. 278 // The number of bytes in the current message body.
278 uint32 current_message_size_; 279 uint32 current_message_size_;
279 // Last message received on the socket. 280 // Last message received on the socket.
280 CastMessage current_message_; 281 scoped_ptr<CastMessage> current_message_;
281 282
282 // The NetLog for this service. 283 // The NetLog for this service.
283 net::NetLog* net_log_; 284 net::NetLog* net_log_;
284 // The NetLog source for this service. 285 // The NetLog source for this service.
285 net::NetLog::Source net_log_source_; 286 net::NetLog::Source net_log_source_;
286 287
287 // CertVerifier is owned by us but should be deleted AFTER SSLClientSocket 288 // CertVerifier is owned by us but should be deleted AFTER SSLClientSocket
288 // since in some cases the destructor of SSLClientSocket may call a method 289 // since in some cases the destructor of SSLClientSocket may call a method
289 // to cancel a cert verification request. 290 // to cancel a cert verification request.
290 scoped_ptr<net::CertVerifier> cert_verifier_; 291 scoped_ptr<net::CertVerifier> cert_verifier_;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 FRIEND_TEST_ALL_PREFIXES(CastSocketTest, TestReadMany); 352 FRIEND_TEST_ALL_PREFIXES(CastSocketTest, TestReadMany);
352 FRIEND_TEST_ALL_PREFIXES(CastSocketTest, TestFullSecureConnectionFlowAsync); 353 FRIEND_TEST_ALL_PREFIXES(CastSocketTest, TestFullSecureConnectionFlowAsync);
353 DISALLOW_COPY_AND_ASSIGN(CastSocket); 354 DISALLOW_COPY_AND_ASSIGN(CastSocket);
354 }; 355 };
355 356
356 } // namespace cast_channel 357 } // namespace cast_channel
357 } // namespace api 358 } // namespace api
358 } // namespace extensions 359 } // namespace extensions
359 360
360 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ 361 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698