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

Side by Side Diff: chrome/browser/extensions/api/socket/tcp_socket.h

Issue 10790137: Adds socket.getInfo to the socket API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Socket updates 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
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 CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/api/socket/socket.h" 10 #include "chrome/browser/extensions/api/socket/socket.h"
(...skipping 24 matching lines...) Expand all
35 const ReadCompletionCallback& callback) OVERRIDE; 35 const ReadCompletionCallback& callback) OVERRIDE;
36 virtual void RecvFrom(int count, 36 virtual void RecvFrom(int count,
37 const RecvFromCompletionCallback& callback) OVERRIDE; 37 const RecvFromCompletionCallback& callback) OVERRIDE;
38 virtual void SendTo(scoped_refptr<net::IOBuffer> io_buffer, 38 virtual void SendTo(scoped_refptr<net::IOBuffer> io_buffer,
39 int byte_count, 39 int byte_count,
40 const std::string& address, 40 const std::string& address,
41 int port, 41 int port,
42 const CompletionCallback& callback) OVERRIDE; 42 const CompletionCallback& callback) OVERRIDE;
43 virtual bool SetKeepAlive(bool enable, int delay) OVERRIDE; 43 virtual bool SetKeepAlive(bool enable, int delay) OVERRIDE;
44 virtual bool SetNoDelay(bool no_delay) OVERRIDE; 44 virtual bool SetNoDelay(bool no_delay) OVERRIDE;
45 virtual bool IsTCPSocket() OVERRIDE;
46 virtual bool GetPeerAddress(net::IPEndPoint* address) OVERRIDE;
47 virtual bool GetLocalAddress(net::IPEndPoint* address) OVERRIDE;
45 48
46 static TCPSocket* CreateSocketForTesting( 49 static TCPSocket* CreateSocketForTesting(
47 net::TCPClientSocket* tcp_client_socket, 50 net::TCPClientSocket* tcp_client_socket,
48 ApiResourceEventNotifier* event_notifier); 51 ApiResourceEventNotifier* event_notifier);
49 52
50 protected: 53 protected:
51 virtual int WriteImpl(net::IOBuffer* io_buffer, 54 virtual int WriteImpl(net::IOBuffer* io_buffer,
52 int io_buffer_size, 55 int io_buffer_size,
53 const net::CompletionCallback& callback) OVERRIDE; 56 const net::CompletionCallback& callback) OVERRIDE;
54 57
55 private: 58 private:
56 void OnConnectComplete(int result); 59 void OnConnectComplete(int result);
57 void OnReadComplete(scoped_refptr<net::IOBuffer> io_buffer, 60 void OnReadComplete(scoped_refptr<net::IOBuffer> io_buffer,
58 int result); 61 int result);
59 62
60 TCPSocket(net::TCPClientSocket* tcp_client_socket, 63 TCPSocket(net::TCPClientSocket* tcp_client_socket,
61 ApiResourceEventNotifier* event_notifier); 64 ApiResourceEventNotifier* event_notifier);
62 65
63 scoped_ptr<net::TCPClientSocket> socket_; 66 scoped_ptr<net::TCPClientSocket> socket_;
64 67
65 CompletionCallback connect_callback_; 68 CompletionCallback connect_callback_;
66 69
67 ReadCompletionCallback read_callback_; 70 ReadCompletionCallback read_callback_;
68 }; 71 };
69 72
70 } // namespace extensions 73 } // namespace extensions
71 74
72 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_ 75 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_TCP_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698