OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "bin/secure_socket.h" | 5 #include "bin/secure_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 | 317 |
318 Dart_Handle data_identifier = DartUtils::NewString("data"); | 318 Dart_Handle data_identifier = DartUtils::NewString("data"); |
319 for (int i = 0; i < kNumBuffers; ++i) { | 319 for (int i = 0; i < kNumBuffers; ++i) { |
320 int size = isEncrypted(i) ? encrypted_buffer_size_ : buffer_size_; | 320 int size = isEncrypted(i) ? encrypted_buffer_size_ : buffer_size_; |
321 dart_buffer_objects_[i] = | 321 dart_buffer_objects_[i] = |
322 Dart_NewPersistentHandle(Dart_ListGetAt(dart_buffers_object, i)); | 322 Dart_NewPersistentHandle(Dart_ListGetAt(dart_buffers_object, i)); |
323 ASSERT(dart_buffer_objects_[i] != NULL); | 323 ASSERT(dart_buffer_objects_[i] != NULL); |
324 buffers_[i] = new uint8_t[size]; | 324 buffers_[i] = new uint8_t[size]; |
325 Dart_Handle data = ThrowIfError( | 325 Dart_Handle data = ThrowIfError( |
326 Dart_NewExternalTypedData(kUint8, buffers_[i], size)); | 326 Dart_NewExternalTypedData(Dart_TypedData_kUint8, buffers_[i], size)); |
327 ThrowIfError( | 327 ThrowIfError( |
328 Dart_SetField(Dart_HandleFromPersistent(dart_buffer_objects_[i]), | 328 Dart_SetField(Dart_HandleFromPersistent(dart_buffer_objects_[i]), |
329 data_identifier, | 329 data_identifier, |
330 data)); | 330 data)); |
331 } | 331 } |
332 } | 332 } |
333 | 333 |
334 | 334 |
335 void SSLFilter::RegisterHandshakeCompleteCallback(Dart_Handle complete) { | 335 void SSLFilter::RegisterHandshakeCompleteCallback(Dart_Handle complete) { |
336 ASSERT(NULL == handshake_complete_); | 336 ASSERT(NULL == handshake_complete_); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 bytes_processed = 0; | 722 bytes_processed = 0; |
723 } | 723 } |
724 break; | 724 break; |
725 } | 725 } |
726 } | 726 } |
727 return bytes_processed; | 727 return bytes_processed; |
728 } | 728 } |
729 | 729 |
730 } // namespace bin | 730 } // namespace bin |
731 } // namespace dart | 731 } // namespace dart |
OLD | NEW |