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

Side by Side Diff: runtime/bin/tls_socket_patch.dart

Issue 10916081: Add secure sockets to dart:io (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove some magic numbers, edit TODOs. Created 8 years, 1 month 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
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 patch class TlsSocket {
6 /* patch */ static void setCertificateDatabase(String pkcertDirectory)
7 native "TlsSocket_SetCertificateDatabase";
8 }
9
10
11 patch class TlsFilter {
12 /* patch */ factory TlsFilter() => new _TlsFilter();
13 }
14
15
16 /**
17 * _TlsFilter wraps a filter that encrypts and decrypts data travelling
18 * over a TLS encrypted socket. The filter also handles the handshaking
19 * and certificate verification.
20 *
21 * The filter exposes its input and output buffers as Dart objects that
22 * are backed by an external C array of bytes, so that both Dart code and
23 * native code can access the same data.
24 */
25 class _TlsFilter extends NativeFieldWrapperClass1 implements TlsFilter {
26 _TlsFilter() {
27 buffers = new List<_TlsExternalBuffer>(_TlsSocket.kNumBuffers);
28 for (int i = 0; i < _TlsSocket.kNumBuffers; ++i) {
29 buffers[i] = new _TlsExternalBuffer();
30 }
31 }
32
33 void connect(String hostName) native "TlsSocket_Connect";
34
35 void destroy() native "TlsSocket_Destroy";
36
37 void handshake() native "TlsSocket_Handshake";
38
39 void init() native "TlsSocket_Init";
40
41 int processBuffer(int bufferIndex) native "TlsSocket_ProcessBuffer";
42
43 void registerHandshakeCallbacks(Function startHandshakeHandler,
44 Function finishHandshakeHandler)
45 native "TlsSocket_RegisterHandshakeCallbacks";
46
47 List<_TlsExternalBuffer> buffers;
48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698