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

Side by Side Diff: jingle/glue/channel_socket_adapter.h

Issue 8831001: base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix alignment. Created 9 years 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "net/base/completion_callback.h" 9 #include "net/base/completion_callback.h"
10 #include "net/socket/socket.h" 10 #include "net/socket/socket.h"
(...skipping 23 matching lines...) Expand all
34 // Must be called before the session and the channel are destroyed. 34 // Must be called before the session and the channel are destroyed.
35 void Close(int error_code); 35 void Close(int error_code);
36 36
37 // Socket implementation. 37 // Socket implementation.
38 virtual int Read(net::IOBuffer* buf, int buf_len, 38 virtual int Read(net::IOBuffer* buf, int buf_len,
39 net::OldCompletionCallback* callback) OVERRIDE; 39 net::OldCompletionCallback* callback) OVERRIDE;
40 virtual int Read(net::IOBuffer* buf, int buf_len, 40 virtual int Read(net::IOBuffer* buf, int buf_len,
41 const net::CompletionCallback& callback) OVERRIDE; 41 const net::CompletionCallback& callback) OVERRIDE;
42 virtual int Write(net::IOBuffer* buf, int buf_len, 42 virtual int Write(net::IOBuffer* buf, int buf_len,
43 net::OldCompletionCallback* callback) OVERRIDE; 43 net::OldCompletionCallback* callback) OVERRIDE;
44 virtual int Write(net::IOBuffer* buf, int buf_len,
45 const net::CompletionCallback& callback) OVERRIDE;
44 46
45 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 47 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
46 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 48 virtual bool SetSendBufferSize(int32 size) OVERRIDE;
47 49
48 private: 50 private:
49 void OnNewPacket(cricket::TransportChannel* channel, 51 void OnNewPacket(cricket::TransportChannel* channel,
50 const char* data, size_t data_size); 52 const char* data, size_t data_size);
51 void OnWritableState(cricket::TransportChannel* channel); 53 void OnWritableState(cricket::TransportChannel* channel);
52 void OnChannelDestroyed(cricket::TransportChannel* channel); 54 void OnChannelDestroyed(cricket::TransportChannel* channel);
53 55
54 MessageLoop* message_loop_; 56 MessageLoop* message_loop_;
55 57
56 cricket::TransportChannel* channel_; 58 cricket::TransportChannel* channel_;
57 59
58 net::OldCompletionCallback* old_read_callback_; // Not owned. 60 net::OldCompletionCallback* old_read_callback_; // Not owned.
59 net::CompletionCallback read_callback_; 61 net::CompletionCallback read_callback_;
60 scoped_refptr<net::IOBuffer> read_buffer_; 62 scoped_refptr<net::IOBuffer> read_buffer_;
61 int read_buffer_size_; 63 int read_buffer_size_;
62 64
63 net::OldCompletionCallback* write_callback_; // Not owned. 65 net::OldCompletionCallback* old_write_callback_; // Not owned.
66 net::CompletionCallback write_callback_;
64 scoped_refptr<net::IOBuffer> write_buffer_; 67 scoped_refptr<net::IOBuffer> write_buffer_;
65 int write_buffer_size_; 68 int write_buffer_size_;
66 69
67 int closed_error_code_; 70 int closed_error_code_;
68 71
69 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); 72 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter);
70 }; 73 };
71 74
72 } // namespace jingle_glue 75 } // namespace jingle_glue
73 76
74 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ 77 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_test_utils.h ('k') | jingle/glue/channel_socket_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698