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

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

Issue 76403004: An implementation of chrome.socket.secure(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made TLSSocket resumable, responses to sleevi's round-1 comments. Created 7 years 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/socket.h
diff --git a/chrome/browser/extensions/api/socket/socket.h b/chrome/browser/extensions/api/socket/socket.h
index 2e73cb0d1fee27a496af8b9d77ca2f0a4391b8e5..fdd96d5b8e4edbd9375ae7114b911bed43d0be5a 100644
--- a/chrome/browser/extensions/api/socket/socket.h
+++ b/chrome/browser/extensions/api/socket/socket.h
@@ -42,9 +42,18 @@ class Socket : public ApiResource {
enum SocketType {
TYPE_TCP,
TYPE_UDP,
+ TYPE_TLS
};
virtual ~Socket();
+
+ void SetHostname(const std::string& hostname) {
+ hostname_ = hostname;
+ }
rpaquay 2013/12/09 23:02:03 The convention for simple accessors is "set_hostna
lally 2013/12/12 02:31:39 Done.
+ const std::string& Hostname() {
+ return hostname_;
+ }
+
rpaquay 2013/12/09 23:02:03 The convention for simple accessor is "hostname()"
lally 2013/12/12 02:31:39 Done.
virtual void Connect(const std::string& address,
int port,
const CompletionCallback& callback) = 0;
@@ -102,7 +111,8 @@ class Socket : public ApiResource {
const net::CompletionCallback& callback) = 0;
virtual void OnWriteComplete(int result);
- const std::string address_;
+ // The name given to Connect(), used when verifying a TLS certificate.
+ std::string hostname_;
bool is_connected_;
private:

Powered by Google App Engine
This is Rietveld 408576698