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

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

Issue 59083012: - Do not use size_t. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/dartutils.h ('k') | runtime/include/dart_api.h » ('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/dartutils.h" 5 #include "bin/dartutils.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 bool bytes_written = file_stream->WriteFully(buffer, num_bytes); 237 bool bytes_written = file_stream->WriteFully(buffer, num_bytes);
238 ASSERT(bytes_written); 238 ASSERT(bytes_written);
239 } 239 }
240 240
241 241
242 void DartUtils::CloseFile(void* stream) { 242 void DartUtils::CloseFile(void* stream) {
243 delete reinterpret_cast<File*>(stream); 243 delete reinterpret_cast<File*>(stream);
244 } 244 }
245 245
246 246
247 bool DartUtils::EntropySource(uint8_t* buffer, size_t length) { 247 bool DartUtils::EntropySource(uint8_t* buffer, intptr_t length) {
248 return Crypto::GetRandomBytes(length, buffer); 248 return Crypto::GetRandomBytes(length, buffer);
249 } 249 }
250 250
251 251
252 static Dart_Handle SingleArgDart_Invoke(Dart_Handle lib, const char* method, 252 static Dart_Handle SingleArgDart_Invoke(Dart_Handle lib, const char* method,
253 Dart_Handle arg) { 253 Dart_Handle arg) {
254 const int kNumArgs = 1; 254 const int kNumArgs = 1;
255 Dart_Handle dart_args[kNumArgs]; 255 Dart_Handle dart_args[kNumArgs];
256 dart_args[0] = arg; 256 dart_args[0] = arg;
257 return Dart_Invoke(lib, DartUtils::NewString(method), kNumArgs, dart_args); 257 return Dart_Invoke(lib, DartUtils::NewString(method), kNumArgs, dart_args);
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 new CObjectString(CObject::NewString(os_error->message())); 1048 new CObjectString(CObject::NewString(os_error->message()));
1049 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); 1049 CObjectArray* result = new CObjectArray(CObject::NewArray(3));
1050 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); 1050 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError)));
1051 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); 1051 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code())));
1052 result->SetAt(2, error_message); 1052 result->SetAt(2, error_message);
1053 return result; 1053 return result;
1054 } 1054 }
1055 1055
1056 } // namespace bin 1056 } // namespace bin
1057 } // namespace dart 1057 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698