Index: chrome/browser/extensions/api/socket/socket.h |
diff --git a/chrome/browser/extensions/api/socket/socket.h b/chrome/browser/extensions/api/socket/socket.h |
index 2e73cb0d1fee27a496af8b9d77ca2f0a4391b8e5..5b230fbff7102095e4d8249d2b312239b7d3d674 100644 |
--- a/chrome/browser/extensions/api/socket/socket.h |
+++ b/chrome/browser/extensions/api/socket/socket.h |
@@ -42,9 +42,22 @@ class Socket : public ApiResource { |
enum SocketType { |
TYPE_TCP, |
TYPE_UDP, |
+ TYPE_TLS |
}; |
virtual ~Socket(); |
+ |
+ const std::string& hostname() const { |
+ return hostname_; |
+ } |
+ |
+ void set_hostname(const std::string& hostname) { |
+ hostname_ = hostname; |
+ } |
+ |
+ // |address| is a resolved IP address. Call set_hostname() to save the |
+ // original DNS name of the host if this socket may later get upgraded to |
+ // TLS (see TLSSocket::UpgradeSocketToTLS()). |
virtual void Connect(const std::string& address, |
int port, |
const CompletionCallback& callback) = 0; |
@@ -102,7 +115,9 @@ class Socket : public ApiResource { |
const net::CompletionCallback& callback) = 0; |
virtual void OnWriteComplete(int result); |
- const std::string address_; |
+ // The DNS name of the host that this socket is connected to, used when |
+ // verifying a TLS certificate. |
+ std::string hostname_; |
bool is_connected_; |
private: |