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

Side by Side Diff: extensions/browser/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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ 5 #ifndef EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ 6 #define EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
7 7
8 #include "extensions/browser/api/socket/socket_api.h" 8 #include "extensions/browser/api/socket/socket_api.h"
9 #include "extensions/common/api/sockets_tcp.h" 9 #include "extensions/common/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 core_api { 17 namespace core_api {
17 18
18 class TCPSocketEventDispatcher; 19 class TCPSocketEventDispatcher;
19 20
20 class TCPSocketAsyncApiFunction : public SocketAsyncApiFunction { 21 class TCPSocketAsyncApiFunction : public SocketAsyncApiFunction {
21 protected: 22 protected:
22 virtual ~TCPSocketAsyncApiFunction(); 23 virtual ~TCPSocketAsyncApiFunction();
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 SocketsTcpGetSocketsFunction(); 232 SocketsTcpGetSocketsFunction();
232 233
233 protected: 234 protected:
234 virtual ~SocketsTcpGetSocketsFunction(); 235 virtual ~SocketsTcpGetSocketsFunction();
235 236
236 // AsyncApiFunction: 237 // AsyncApiFunction:
237 virtual bool Prepare() OVERRIDE; 238 virtual bool Prepare() OVERRIDE;
238 virtual void Work() OVERRIDE; 239 virtual void Work() OVERRIDE;
239 }; 240 };
240 241
242 class SocketsTcpSecureFunction : public TCPSocketAsyncApiFunction {
243 public:
244 DECLARE_EXTENSION_FUNCTION("sockets.tcp.secure", SOCKETS_TCP_SECURE);
245
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
257 bool paused_;
258 bool persistent_;
259 scoped_ptr<sockets_tcp::Secure::Params> params_;
260 scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
261
262 DISALLOW_COPY_AND_ASSIGN(SocketsTcpSecureFunction);
263 };
264
241 } // namespace core_api 265 } // namespace core_api
242 } // namespace extensions 266 } // namespace extensions
243 267
244 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_ 268 #endif // EXTENSIONS_BROWSER_API_SOCKETS_TCP_SOCKETS_TCP_API_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/socket/tls_socket.cc ('k') | extensions/browser/api/sockets_tcp/sockets_tcp_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698