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

Unified Diff: extensions/browser/api/socket/tcp_socket.h

Issue 76403004: An implementation of chrome.socket.secure(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Morning LKGR Rebase. Created 6 years, 5 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
« no previous file with comments | « extensions/browser/api/socket/socket_api.cc ('k') | extensions/browser/api/socket/tcp_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/socket/tcp_socket.h
diff --git a/extensions/browser/api/socket/tcp_socket.h b/extensions/browser/api/socket/tcp_socket.h
index fbb8c543bcf27d7e214b21006375df63c9c71fb8..4b0af13bb1eb0efc9ad549a881af8e5c7fb46c15 100644
--- a/extensions/browser/api/socket/tcp_socket.h
+++ b/extensions/browser/api/socket/tcp_socket.h
@@ -54,6 +54,12 @@ class TCPSocket : public Socket {
virtual bool GetPeerAddress(net::IPEndPoint* address) OVERRIDE;
virtual bool GetLocalAddress(net::IPEndPoint* address) OVERRIDE;
+
+ // Like Disconnect(), only Release() doesn't delete the underlying stream
+ // or attempt to close it. Useful when giving away ownership with
+ // ClientStream().
+ virtual void Release();
+
virtual Socket::SocketType GetSocketType() const OVERRIDE;
static TCPSocket* CreateSocketForTesting(
@@ -64,6 +70,13 @@ class TCPSocket : public Socket {
net::TCPServerSocket* tcp_server_socket,
const std::string& owner_extension_id);
+ // Returns NULL if GetSocketType() isn't TYPE_TCP or if the connection
+ // wasn't set up via Connect() (vs Listen()/Accept()).
+ net::TCPClientSocket* ClientStream();
+
+ // Whether a Read() has been issued, that hasn't come back yet.
+ bool HasPendingRead() const;
+
protected:
virtual int WriteImpl(net::IOBuffer* io_buffer,
int io_buffer_size,
« no previous file with comments | « extensions/browser/api/socket/socket_api.cc ('k') | extensions/browser/api/socket/tcp_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698