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

Unified Diff: sdk/lib/io/secure_socket.dart

Issue 24395013: Merge services into a shared IOService in dart:io, and use a native port. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Finish off native_service Created 7 years, 3 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 | « sdk/lib/io/link.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 09160238bb01461e99d6a00906d00a21a5970476..c40d73156741f81ffde69232fc808b34c6954629 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -447,7 +447,6 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_SecureFilter _secureFilter = new _SecureFilter();
int _filterPointer;
- SendPort _filterService;
static Future<_RawSecureSocket> connect(
host,
@@ -988,23 +987,22 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
Future<_FilterStatus> _pushAllFilterStages() {
- if (_filterService == null) {
- _filterService = _SecureFilter._newServicePort();
- }
- List args = [_filterPointer, _status != CONNECTED];
+ bool wasInHandshake = _status != CONNECTED;
+ List args = new List(2 + NUM_BUFFERS * 2);
+ args[0] = _filterPointer;
+ args[1] = wasInHandshake;
var bufs = _secureFilter.buffers;
for (var i = 0; i < NUM_BUFFERS; ++i) {
- args.add(bufs[i].start);
- args.add(bufs[i].end);
+ args[2 * i + 2] = bufs[i].start;
+ args[2 * i + 3] = bufs[i].end;
}
- return _filterService.call(args).then((response) {
+ return IOService.dispatch(SSL_PROCESS_FILTER, args).then((response) {
if (response.length == 2) {
_reportError(new TlsException('${response[1]} error ${response[0]}'));
}
- bool wasInHandshake = response[1];
- int start(int index) => response[2 * index + 2];
- int end(int index) => response[2 * index + 3];
+ int start(int index) => response[2 * index];
+ int end(int index) => response[2 * index + 1];
_FilterStatus status = new _FilterStatus();
// Compute writeEmpty as "write plaintext buffer and write encrypted
« no previous file with comments | « sdk/lib/io/link.dart ('k') | tests/standalone/io/file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698