| 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/socketaddress.h" | 11 #include "third_party/libjingle/source/talk/base/socketaddress.h" |
| 12 #include "third_party/libjingle/source/talk/base/sigslot.h" | 12 #include "third_party/libjingle/source/talk/base/sigslot.h" |
| 13 | 13 |
| 14 namespace base { |
| 14 class MessageLoop; | 15 class MessageLoop; |
| 16 } |
| 15 | 17 |
| 16 namespace cricket { | 18 namespace cricket { |
| 17 class TransportChannel; | 19 class TransportChannel; |
| 18 } // namespace cricket | 20 } // namespace cricket |
| 19 | 21 |
| 20 namespace jingle_glue { | 22 namespace jingle_glue { |
| 21 | 23 |
| 22 // TransportChannelSocketAdapter implements net::Socket interface on | 24 // TransportChannelSocketAdapter implements net::Socket interface on |
| 23 // top of libjingle's TransportChannel. It is used by | 25 // top of libjingle's TransportChannel. It is used by |
| 24 // JingleChromotocolConnection to provide net::Socket interface for channels. | 26 // JingleChromotocolConnection to provide net::Socket interface for channels. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 49 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 51 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 50 | 52 |
| 51 private: | 53 private: |
| 52 void OnNewPacket(cricket::TransportChannel* channel, | 54 void OnNewPacket(cricket::TransportChannel* channel, |
| 53 const char* data, | 55 const char* data, |
| 54 size_t data_size, | 56 size_t data_size, |
| 55 int flags); | 57 int flags); |
| 56 void OnWritableState(cricket::TransportChannel* channel); | 58 void OnWritableState(cricket::TransportChannel* channel); |
| 57 void OnChannelDestroyed(cricket::TransportChannel* channel); | 59 void OnChannelDestroyed(cricket::TransportChannel* channel); |
| 58 | 60 |
| 59 MessageLoop* message_loop_; | 61 base::MessageLoop* message_loop_; |
| 60 | 62 |
| 61 cricket::TransportChannel* channel_; | 63 cricket::TransportChannel* channel_; |
| 62 | 64 |
| 63 base::Closure destruction_callback_; | 65 base::Closure destruction_callback_; |
| 64 | 66 |
| 65 net::CompletionCallback read_callback_; | 67 net::CompletionCallback read_callback_; |
| 66 scoped_refptr<net::IOBuffer> read_buffer_; | 68 scoped_refptr<net::IOBuffer> read_buffer_; |
| 67 int read_buffer_size_; | 69 int read_buffer_size_; |
| 68 | 70 |
| 69 net::CompletionCallback write_callback_; | 71 net::CompletionCallback write_callback_; |
| 70 scoped_refptr<net::IOBuffer> write_buffer_; | 72 scoped_refptr<net::IOBuffer> write_buffer_; |
| 71 int write_buffer_size_; | 73 int write_buffer_size_; |
| 72 | 74 |
| 73 int closed_error_code_; | 75 int closed_error_code_; |
| 74 | 76 |
| 75 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); | 77 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace jingle_glue | 80 } // namespace jingle_glue |
| 79 | 81 |
| 80 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ | 82 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ |
| OLD | NEW |