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

Side by Side Diff: net/udp/udp_socket_libevent.h

Issue 10854063: Clean-up inline members of nested classes (net/) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a NET_EXPOR_PRIVATE Created 8 years, 4 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 | « net/tools/flip_server/output_ordering.cc ('k') | net/udp/udp_socket_libevent.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 NET_UDP_UDP_SOCKET_LIBEVENT_H_ 5 #ifndef NET_UDP_UDP_SOCKET_LIBEVENT_H_
6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_ 6 #define NET_UDP_UDP_SOCKET_LIBEVENT_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0, 120 SOCKET_OPTION_REUSE_ADDRESS = 1 << 0,
121 SOCKET_OPTION_BROADCAST = 1 << 1 121 SOCKET_OPTION_BROADCAST = 1 << 1
122 }; 122 };
123 123
124 class ReadWatcher : public MessageLoopForIO::Watcher { 124 class ReadWatcher : public MessageLoopForIO::Watcher {
125 public: 125 public:
126 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {} 126 explicit ReadWatcher(UDPSocketLibevent* socket) : socket_(socket) {}
127 127
128 // MessageLoopForIO::Watcher methods 128 // MessageLoopForIO::Watcher methods
129 129
130 virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE { 130 virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE;
131 if (!socket_->read_callback_.is_null())
132 socket_->DidCompleteRead();
133 }
134 131
135 virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {} 132 virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {}
136 133
137 private: 134 private:
138 UDPSocketLibevent* const socket_; 135 UDPSocketLibevent* const socket_;
139 136
140 DISALLOW_COPY_AND_ASSIGN(ReadWatcher); 137 DISALLOW_COPY_AND_ASSIGN(ReadWatcher);
141 }; 138 };
142 139
143 class WriteWatcher : public MessageLoopForIO::Watcher { 140 class WriteWatcher : public MessageLoopForIO::Watcher {
144 public: 141 public:
145 explicit WriteWatcher(UDPSocketLibevent* socket) : socket_(socket) {} 142 explicit WriteWatcher(UDPSocketLibevent* socket) : socket_(socket) {}
146 143
147 // MessageLoopForIO::Watcher methods 144 // MessageLoopForIO::Watcher methods
148 145
149 virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {} 146 virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {}
150 147
151 virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE { 148 virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE;
152 if (!socket_->write_callback_.is_null())
153 socket_->DidCompleteWrite();
154 }
155 149
156 private: 150 private:
157 UDPSocketLibevent* const socket_; 151 UDPSocketLibevent* const socket_;
158 152
159 DISALLOW_COPY_AND_ASSIGN(WriteWatcher); 153 DISALLOW_COPY_AND_ASSIGN(WriteWatcher);
160 }; 154 };
161 155
162 void DoReadCallback(int rv); 156 void DoReadCallback(int rv);
163 void DoWriteCallback(int rv); 157 void DoWriteCallback(int rv);
164 void DidCompleteRead(); 158 void DidCompleteRead();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 CompletionCallback write_callback_; 230 CompletionCallback write_callback_;
237 231
238 BoundNetLog net_log_; 232 BoundNetLog net_log_;
239 233
240 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent); 234 DISALLOW_COPY_AND_ASSIGN(UDPSocketLibevent);
241 }; 235 };
242 236
243 } // namespace net 237 } // namespace net
244 238
245 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_ 239 #endif // NET_UDP_UDP_SOCKET_LIBEVENT_H_
OLDNEW
« no previous file with comments | « net/tools/flip_server/output_ordering.cc ('k') | net/udp/udp_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698