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

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: Update 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..295388e8e9b69eb1e15e0c81cad6d92aac1bd8e9 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,13 +35,17 @@ 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);
+
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);
@@ -54,8 +55,6 @@ class UDPSocket : public Socket {
ReadCompletionCallback read_callback_;
- CompletionCallback write_callback_;
-
RecvFromCompletionCallback recv_from_callback_;
CompletionCallback send_to_callback_;

Powered by Google App Engine
This is Rietveld 408576698