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

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

Issue 9366001: Implement support for route change notifications in the Transport interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 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
« no previous file with comments | « no previous file | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 11 matching lines...) Expand all
22 // TransportChannelSocketAdapter implements net::Socket interface on 22 // TransportChannelSocketAdapter implements net::Socket interface on
23 // top of libjingle's TransportChannel. It is used by 23 // top of libjingle's TransportChannel. It is used by
24 // JingleChromotocolConnection to provide net::Socket interface for channels. 24 // JingleChromotocolConnection to provide net::Socket interface for channels.
25 class TransportChannelSocketAdapter : public net::Socket, 25 class TransportChannelSocketAdapter : public net::Socket,
26 public sigslot::has_slots<> { 26 public sigslot::has_slots<> {
27 public: 27 public:
28 // TransportChannel object is always owned by the corresponding session. 28 // TransportChannel object is always owned by the corresponding session.
29 explicit TransportChannelSocketAdapter(cricket::TransportChannel* channel); 29 explicit TransportChannelSocketAdapter(cricket::TransportChannel* channel);
30 virtual ~TransportChannelSocketAdapter(); 30 virtual ~TransportChannelSocketAdapter();
31 31
32 // Sets callback that should be called when the adapter is being destroyed. 32 // Sets callback that should be called when the adapter is being
33 // destroyed. The callback is not allowed to touch the adapter, but
34 // can do anything else, e.g. destroy the TransportChannel.
33 void SetOnDestroyedCallback(const base::Closure& callback); 35 void SetOnDestroyedCallback(const base::Closure& callback);
34 36
35 // Closes the stream. |error_code| specifies error code that will 37 // Closes the stream. |error_code| specifies error code that will
36 // be returned by Read() and Write() after the stream is closed. 38 // be returned by Read() and Write() after the stream is closed.
37 // Must be called before the session and the channel are destroyed. 39 // Must be called before the session and the channel are destroyed.
38 void Close(int error_code); 40 void Close(int error_code);
39 41
40 // Socket implementation. 42 // Socket implementation.
41 virtual int Read(net::IOBuffer* buf, int buf_len, 43 virtual int Read(net::IOBuffer* buf, int buf_len,
42 const net::CompletionCallback& callback) OVERRIDE; 44 const net::CompletionCallback& callback) OVERRIDE;
(...skipping 24 matching lines...) Expand all
67 int write_buffer_size_; 69 int write_buffer_size_;
68 70
69 int closed_error_code_; 71 int closed_error_code_;
70 72
71 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter); 73 DISALLOW_COPY_AND_ASSIGN(TransportChannelSocketAdapter);
72 }; 74 };
73 75
74 } // namespace jingle_glue 76 } // namespace jingle_glue
75 77
76 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_ 78 #endif // JINGLE_GLUE_CHANNEL_SOCKET_ADAPTER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698