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

Side by Side Diff: runtime/bin/secure_socket.cc

Issue 15689013: - Modify dart_api.h to be a proper C API. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/io_buffer.cc ('k') | runtime/bin/socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/bin/io_buffer.cc ('k') | runtime/bin/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698