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

Unified Diff: chrome/browser/extensions/api/socket/udp_socket.h

Issue 10310170: Improve socket.write() to make sure all data will be sent out. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix compile error on Mac Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/socket/udp_socket.h
diff --git a/chrome/browser/extensions/api/socket/udp_socket.h b/chrome/browser/extensions/api/socket/udp_socket.h
index e09193ce5f0b949e2c7721503956a767198238d5..4d4dfdf68f64bb78ae4f5f86a54149db81fb2823 100644
--- a/chrome/browser/extensions/api/socket/udp_socket.h
+++ b/chrome/browser/extensions/api/socket/udp_socket.h
@@ -27,9 +27,6 @@ class UDPSocket : public Socket {
virtual int Bind(const std::string& address, int port) OVERRIDE;
virtual void Read(int count,
const ReadCompletionCallback& callback) OVERRIDE;
- virtual void Write(scoped_refptr<net::IOBuffer> io_buffer,
- int bytes,
- const CompletionCallback& callback) OVERRIDE;
virtual void RecvFrom(int count,
const RecvFromCompletionCallback& callback) OVERRIDE;
virtual void SendTo(scoped_refptr<net::IOBuffer> io_buffer,
@@ -38,24 +35,26 @@ class UDPSocket : public Socket {
int port,
const CompletionCallback& callback) OVERRIDE;
+ protected:
+ virtual int WriteImpl(net::IOBuffer* io_buffer,
+ int io_buffer_size,
+ const net::CompletionCallback& callback) OVERRIDE;
+
private:
// Make net::IPEndPoint can be refcounted
typedef base::RefCountedData<net::IPEndPoint> IPEndPoint;
- virtual void OnReadComplete(scoped_refptr<net::IOBuffer> io_buffer,
- int result);
- virtual void OnWriteComplete(int result);
- virtual void OnRecvFromComplete(scoped_refptr<net::IOBuffer> io_buffer,
- scoped_refptr<IPEndPoint> address,
- int result);
- virtual void OnSendToComplete(int result);
+ void OnReadComplete(scoped_refptr<net::IOBuffer> io_buffer,
+ int result);
+ void OnRecvFromComplete(scoped_refptr<net::IOBuffer> io_buffer,
+ scoped_refptr<IPEndPoint> address,
+ int result);
+ void OnSendToComplete(int result);
net::UDPSocket socket_;
ReadCompletionCallback read_callback_;
- CompletionCallback write_callback_;
-
RecvFromCompletionCallback recv_from_callback_;
CompletionCallback send_to_callback_;
« no previous file with comments | « chrome/browser/extensions/api/socket/tcp_socket_unittest.cc ('k') | chrome/browser/extensions/api/socket/udp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698