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

Unified Diff: runtime/bin/secure_socket_patch.dart

Issue 16858011: dart:io | Enable multithreaded secure networking encryption. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
Index: runtime/bin/secure_socket_patch.dart
diff --git a/runtime/bin/secure_socket_patch.dart b/runtime/bin/secure_socket_patch.dart
index fdff0d517a7d80ca4f500d78b6ea87ae547c2110..13f401be505c573e49b424971c6183f54fefc12c 100644
--- a/runtime/bin/secure_socket_patch.dart
+++ b/runtime/bin/secure_socket_patch.dart
@@ -15,6 +15,9 @@ patch class SecureSocket {
patch class _SecureFilter {
/* patch */ factory _SecureFilter() => new _SecureFilterImpl();
+
+ /* patch */ static SendPort _newServicePort()
+ native "SecureSocket_NewServicePort";
}
@@ -49,10 +52,17 @@ class _SecureSocket extends _Socket implements SecureSocket {
class _SecureFilterImpl
extends NativeFieldWrapperClass1
implements _SecureFilter {
+ // Performance is improved if a full buffer of plaintext fits
+ // in the encrypted buffer, when encrypted.
+ static final int SIZE = 8 * 1024;
+ static final int ENCRYPTED_SIZE = 10 * 1024;
+
_SecureFilterImpl() {
buffers = new List<_ExternalBuffer>(_RawSecureSocket.NUM_BUFFERS);
for (int i = 0; i < _RawSecureSocket.NUM_BUFFERS; ++i) {
- buffers[i] = new _ExternalBuffer();
+ buffers[i] = new _ExternalBuffer(_RawSecureSocket.isEncrypted(i) ?
+ ENCRYPTED_SIZE :
+ SIZE);
}
}
@@ -77,13 +87,13 @@ class _SecureFilterImpl
X509Certificate get peerCertificate native "SecureSocket_PeerCertificate";
- int processBuffer(int bufferIndex) native "SecureSocket_ProcessBuffer";
-
void registerBadCertificateCallback(Function callback)
native "SecureSocket_RegisterBadCertificateCallback";
void registerHandshakeCompleteCallback(Function handshakeCompleteHandler)
native "SecureSocket_RegisterHandshakeCompleteCallback";
+ int _pointer() native "SecureSocket_FilterPointer";
+
List<_ExternalBuffer> buffers;
}

Powered by Google App Engine
This is Rietveld 408576698