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

Side by Side Diff: bin/secure_socket.cc

Issue 12255018: Add typed data interface to Dart API, this only changes the C++ API as dicussed in a previous email… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 10 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 | « bin/io_buffer.cc ('k') | 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 encrypted_buffer_size_ = static_cast<int>(encrypted_buffer_size); 305 encrypted_buffer_size_ = static_cast<int>(encrypted_buffer_size);
306 306
307 307
308 Dart_Handle data_identifier = DartUtils::NewString("data"); 308 Dart_Handle data_identifier = DartUtils::NewString("data");
309 for (int i = 0; i < kNumBuffers; ++i) { 309 for (int i = 0; i < kNumBuffers; ++i) {
310 int size = isEncrypted(i) ? encrypted_buffer_size_ : buffer_size_; 310 int size = isEncrypted(i) ? encrypted_buffer_size_ : buffer_size_;
311 dart_buffer_objects_[i] = ThrowIfError( 311 dart_buffer_objects_[i] = ThrowIfError(
312 Dart_NewPersistentHandle(Dart_ListGetAt(dart_buffers_object, i))); 312 Dart_NewPersistentHandle(Dart_ListGetAt(dart_buffers_object, i)));
313 buffers_[i] = new uint8_t[size]; 313 buffers_[i] = new uint8_t[size];
314 Dart_Handle data = ThrowIfError( 314 Dart_Handle data = ThrowIfError(
315 Dart_NewExternalByteArray(buffers_[i], size, NULL, NULL)); 315 Dart_NewExternalTypedData(kUint8, buffers_[i], size, NULL, NULL));
316 ThrowIfError(Dart_SetField(dart_buffer_objects_[i], 316 ThrowIfError(Dart_SetField(dart_buffer_objects_[i],
317 data_identifier, 317 data_identifier,
318 data)); 318 data));
319 } 319 }
320 } 320 }
321 321
322 322
323 void SSLFilter::RegisterHandshakeCompleteCallback(Dart_Handle complete) { 323 void SSLFilter::RegisterHandshakeCompleteCallback(Dart_Handle complete) {
324 ASSERT(NULL == handshake_complete_); 324 ASSERT(NULL == handshake_complete_);
325 handshake_complete_ = ThrowIfError(Dart_NewPersistentHandle(complete)); 325 handshake_complete_ = ThrowIfError(Dart_NewPersistentHandle(complete));
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 if (PR_WOULD_BLOCK_ERROR != pr_error) { 687 if (PR_WOULD_BLOCK_ERROR != pr_error) {
688 ThrowPRException("Error reading plaintext from SSLFilter"); 688 ThrowPRException("Error reading plaintext from SSLFilter");
689 } 689 }
690 bytes_processed = 0; 690 bytes_processed = 0;
691 } 691 }
692 break; 692 break;
693 } 693 }
694 } 694 }
695 return bytes_processed; 695 return bytes_processed;
696 } 696 }
OLDNEW
« no previous file with comments | « bin/io_buffer.cc ('k') | bin/socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698