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

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: Address all comments 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
« no previous file with comments | « runtime/bin/secure_socket.cc ('k') | sdk/lib/_internal/lib/io_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
diff --git a/runtime/bin/secure_socket_patch.dart b/runtime/bin/secure_socket_patch.dart
index 58735f894b6db50751f3bf969c3c8bf6cf99eac3..4b7c5abcfb2349534dd71c35a0d5c532b5495809 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._isBufferEncrypted(i) ?
+ ENCRYPTED_SIZE :
+ SIZE);
}
}
@@ -78,13 +88,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;
}
« no previous file with comments | « runtime/bin/secure_socket.cc ('k') | sdk/lib/_internal/lib/io_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698