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

Side by Side Diff: chrome/browser/extensions/api/sockets_tcp/sockets_tcp_api.h

Issue 76403004: An implementation of chrome.socket.secure(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: An integration test, and some nits fixed. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SOCKETS_TCP_SOCKETS_TCP_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
7 7
8 #include "chrome/browser/extensions/api/socket/socket_api.h" 8 #include "chrome/browser/extensions/api/socket/socket_api.h"
9 #include "chrome/common/extensions/api/sockets_tcp.h" 9 #include "chrome/common/extensions/api/sockets_tcp.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 class ResumableTCPSocket; 12 class ResumableTCPSocket;
13 class TLSSocket;
13 } 14 }
14 15
15 namespace extensions { 16 namespace extensions {
16 namespace api { 17 namespace api {
17 18
18 class TCPSocketAsyncApiFunction : public SocketAsyncApiFunction { 19 class TCPSocketAsyncApiFunction : public SocketAsyncApiFunction {
19 protected: 20 protected:
20 virtual ~TCPSocketAsyncApiFunction(); 21 virtual ~TCPSocketAsyncApiFunction();
21 22
22 virtual scoped_ptr<SocketResourceManagerInterface> 23 virtual scoped_ptr<SocketResourceManagerInterface>
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 SocketsTcpGetSocketsFunction(); 233 SocketsTcpGetSocketsFunction();
233 234
234 protected: 235 protected:
235 virtual ~SocketsTcpGetSocketsFunction(); 236 virtual ~SocketsTcpGetSocketsFunction();
236 237
237 // AsyncApiFunction: 238 // AsyncApiFunction:
238 virtual bool Prepare() OVERRIDE; 239 virtual bool Prepare() OVERRIDE;
239 virtual void Work() OVERRIDE; 240 virtual void Work() OVERRIDE;
240 }; 241 };
241 242
243 class SocketsTcpSecureFunction : public TCPSocketAsyncApiFunction {
244 public:
245 DECLARE_EXTENSION_FUNCTION("sockets.tcp.secure", SOCKETS_TCP_SECURE);
246 SocketsTcpSecureFunction();
247
248 protected:
249 virtual ~SocketsTcpSecureFunction();
250 virtual bool Prepare() OVERRIDE;
251 virtual void AsyncWorkStart() OVERRIDE;
252
253 private:
254 virtual void TlsConnectDone(scoped_ptr<extensions::TLSSocket> sock,
255 int result);
256 bool paused_;
257 bool persistent_;
258 scoped_ptr<api::socket::Secure::Params> params_;
259 net::URLRequestContextGetter* url_request_getter_;
Ryan Sleevi 2014/02/04 22:28:14 scoped_refptr<>
lally 2014/02/11 22:05:35 Done.
260
261 DISALLOW_COPY_AND_ASSIGN(SocketsTcpSecureFunction);
262 };
263
242 } // namespace api 264 } // namespace api
243 } // namespace extensions 265 } // namespace extensions
244 266
245 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ 267 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698