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

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: Add helper functions start() and end() to _pushAllFilterStages. 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..92130da2ca3e9ef0a89f53c3e1e78a97e6794af1 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.
Søren Gjesse 2013/06/17 07:31:07 We should do some experiments with these buffer si
Bill Hesse 2013/06/20 14:56:26 Yes, we should.
+ 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._isBufferEncrypted(i) ?
+ ENCRYPTED_SIZE :
+ SIZE);
}
}
@@ -77,13 +87,14 @@ 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";
+ // This is a security issue, as it exposes a raw pointer to Dart code.
+ int _pointer() native "SecureSocket_FilterPointer";
+
List<_ExternalBuffer> buffers;
}

Powered by Google App Engine
This is Rietveld 408576698