| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 patch class SecureSocket { | 5 patch class SecureSocket { |
| 6 /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) => | 6 /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) => |
| 7 new _SecureSocket(rawSocket); | 7 new _SecureSocket(rawSocket); |
| 8 | 8 |
| 9 /* patch */ static void initialize({String database, | 9 /* patch */ static void initialize({String database, |
| 10 String password, | 10 String password, |
| 11 bool useBuiltinRoots: true}) | 11 bool useBuiltinRoots: true}) |
| 12 native "SecureSocket_InitializeLibrary"; | 12 native "SecureSocket_InitializeLibrary"; |
| 13 } | 13 } |
| 14 | 14 |
| 15 | 15 |
| 16 patch class _SecureFilter { | 16 patch class _SecureFilter { |
| 17 /* patch */ factory _SecureFilter() => new _SecureFilterImpl(); | 17 /* patch */ factory _SecureFilter() => new _SecureFilterImpl(); |
| 18 | |
| 19 /* patch */ static SendPort _newServicePort() | |
| 20 native "SecureSocket_NewServicePort"; | |
| 21 } | 18 } |
| 22 | 19 |
| 23 | 20 |
| 24 class _SecureSocket extends _Socket implements SecureSocket { | 21 class _SecureSocket extends _Socket implements SecureSocket { |
| 25 _SecureSocket(RawSecureSocket raw) : super(raw); | 22 _SecureSocket(RawSecureSocket raw) : super(raw); |
| 26 | 23 |
| 27 void set onBadCertificate(bool callback(X509Certificate certificate)) { | 24 void set onBadCertificate(bool callback(X509Certificate certificate)) { |
| 28 if (_raw == null) { | 25 if (_raw == null) { |
| 29 throw new StateError("onBadCertificate called on destroyed SecureSocket"); | 26 throw new StateError("onBadCertificate called on destroyed SecureSocket"); |
| 30 } | 27 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 native "SecureSocket_RegisterBadCertificateCallback"; | 101 native "SecureSocket_RegisterBadCertificateCallback"; |
| 105 | 102 |
| 106 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler) | 103 void registerHandshakeCompleteCallback(Function handshakeCompleteHandler) |
| 107 native "SecureSocket_RegisterHandshakeCompleteCallback"; | 104 native "SecureSocket_RegisterHandshakeCompleteCallback"; |
| 108 | 105 |
| 109 // This is a security issue, as it exposes a raw pointer to Dart code. | 106 // This is a security issue, as it exposes a raw pointer to Dart code. |
| 110 int _pointer() native "SecureSocket_FilterPointer"; | 107 int _pointer() native "SecureSocket_FilterPointer"; |
| 111 | 108 |
| 112 List<_ExternalBuffer> buffers; | 109 List<_ExternalBuffer> buffers; |
| 113 } | 110 } |
| OLD | NEW |