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

Side by Side Diff: Source/bindings/dart/DartUtilities.h

Issue 27767003: Convert serialized values to ints if they are whole and less than 53 bits. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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 | « no previous file | Source/bindings/dart/DartUtilities.cpp » ('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 2011, Google Inc. 1 // Copyright 2011, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 if (Dart_IsError(result)) { 357 if (Dart_IsError(result)) {
358 exception = Dart_NewStringFromCString(Dart_GetError(result)); 358 exception = Dart_NewStringFromCString(Dart_GetError(result));
359 return 0; 359 return 0;
360 } 360 }
361 if (value < INT_MIN || value > INT_MAX) { 361 if (value < INT_MIN || value > INT_MAX) {
362 exception = Dart_NewStringFromCString("value out of range"); 362 exception = Dart_NewStringFromCString("value out of range");
363 return 0; 363 return 0;
364 } 364 }
365 return value; 365 return value;
366 } 366 }
367 static Dart_Handle intToDart(int value) 367 static Dart_Handle intToDart(int64_t value)
368 { 368 {
369 return Dart_NewInteger(value); 369 return Dart_NewInteger(value);
370 } 370 }
371 371
372 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception); 372 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception);
373 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha ndle& exception) 373 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha ndle& exception)
374 { 374 {
375 int64_t value; 375 int64_t value;
376 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value); 376 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value);
377 if (Dart_IsError(result)) { 377 if (Dart_IsError(result)) {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 } 634 }
635 }; 635 };
636 636
637 637
638 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__ FILE__, __LINE__) 638 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__ FILE__, __LINE__)
639 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION()) ; 639 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION()) ;
640 640
641 } // namespace WebCore 641 } // namespace WebCore
642 642
643 #endif // DartUtilities_h 643 #endif // DartUtilities_h
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/dart/DartUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698