OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ | 5 #ifndef JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ |
6 #define JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ | 6 #define JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "net/socket/socket.h" | 10 #include "net/socket/socket.h" |
| 11 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" |
11 #include "third_party/libjingle/source/talk/base/socketaddress.h" | 12 #include "third_party/libjingle/source/talk/base/socketaddress.h" |
12 #include "third_party/libjingle/source/talk/base/sigslot.h" | 13 #include "third_party/libjingle/source/talk/base/sigslot.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class MessageLoop; | 16 class MessageLoop; |
16 } | 17 } |
17 | 18 |
18 namespace cricket { | 19 namespace cricket { |
19 class TransportChannel; | 20 class TransportChannel; |
20 } // namespace cricket | 21 } // namespace cricket |
(...skipping 26 matching lines...) Expand all Loading... |
47 virtual int Write(net::IOBuffer* buf, int buf_len, | 48 virtual int Write(net::IOBuffer* buf, int buf_len, |
48 const net::CompletionCallback& callback) OVERRIDE; | 49 const net::CompletionCallback& callback) OVERRIDE; |
49 | 50 |
50 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 51 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
51 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 52 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
52 | 53 |
53 private: | 54 private: |
54 void OnNewPacket(cricket::TransportChannel* channel, | 55 void OnNewPacket(cricket::TransportChannel* channel, |
55 const char* data, | 56 const char* data, |
56 size_t data_size, | 57 size_t data_size, |
| 58 const talk_base::PacketTime& packet_time, |
57 int flags); | 59 int flags); |
58 void OnWritableState(cricket::TransportChannel* channel); | 60 void OnWritableState(cricket::TransportChannel* channel); |
59 void OnChannelDestroyed(cricket::TransportChannel* channel); | 61 void OnChannelDestroyed(cricket::TransportChannel* channel); |
60 | 62 |
61 base::MessageLoop* message_loop_; | 63 base::MessageLoop* message_loop_; |
62 | 64 |
63 cricket::TransportChannel* channel_; | 65 cricket::TransportChannel* channel_; |
64 | 66 |
65 base::Closure destruction_callback_; | 67 base::Closure destruction_callback_; |
66 | 68 |
67 net::CompletionCallback read_callback_; | 69 net::CompletionCallback read_callback_; |
68 scoped_refptr<net::IOBuffer> read_buffer_; | 70 scoped_refptr<net::IOBuffer> read_buffer_; |
69 int read_buffer_size_; | 71 int read_buffer_size_; |
70 | 72 |
71 net::CompletionCallback write_callback_; | 73 net::CompletionCallback write_callback_; |
72 scoped_refptr<net::IOBuffer> write_buffer_; | 74 scoped_refptr<net::IOBuffer> write_buffer_; |
73 int write_buffer_size_; | 75 int write_buffer_size_; |
74 | 76 |
75 int closed_error_code_; | 77 int closed_error_code_; |
76 | 78 |
77 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); | 79 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); |
78 }; | 80 }; |
79 | 81 |
80 } // namespace jingle_glue | 82 } // namespace jingle_glue |
81 | 83 |
82 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ | 84 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ |
OLD | NEW |