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

Unified Diff: runtime/bin/secure_socket_patch.dart

Issue 15899003: Change SecureSocket to use a single patch class instead of multiple patch classes the way it is bei… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/secure_socket_patch.dart
===================================================================
--- runtime/bin/secure_socket_patch.dart (revision 23079)
+++ runtime/bin/secure_socket_patch.dart (working copy)
@@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
patch class SecureSocket {
+ /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) =>
+ new _SecureSocket(rawSocket);
+
/* patch */ static void initialize({String database,
String password,
bool useBuiltinRoots: true})
@@ -15,6 +18,25 @@
}
+class _SecureSocket extends _Socket implements SecureSocket {
+ _SecureSocket(RawSecureSocket raw) : super(raw);
+
+ void set onBadCertificate(bool callback(X509Certificate certificate)) {
+ if (_raw == null) {
+ throw new StateError("onBadCertificate called on destroyed SecureSocket");
+ }
+ _raw.onBadCertificate = callback;
+ }
+
+ X509Certificate get peerCertificate {
+ if (_raw == null) {
+ throw new StateError("peerCertificate called on destroyed SecureSocket");
+ }
+ return _raw.peerCertificate;
+ }
+}
+
+
/**
* _SecureFilterImpl wraps a filter that encrypts and decrypts data travelling
* over an encrypted socket. The filter also handles the handshaking
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698