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

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

Issue 91043003: Simplify some argument checking for socket calls (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years 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 | runtime/bin/dartutils.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 #ifndef BIN_DARTUTILS_H_ 5 #ifndef BIN_DARTUTILS_H_
6 #define BIN_DARTUTILS_H_ 6 #define BIN_DARTUTILS_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "include/dart_native_api.h" 9 #include "include/dart_native_api.h"
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 DISALLOW_COPY_AND_ASSIGN(CommandLineOptions); 75 DISALLOW_COPY_AND_ASSIGN(CommandLineOptions);
76 }; 76 };
77 77
78 78
79 class DartUtils { 79 class DartUtils {
80 public: 80 public:
81 // Returns the integer value of a Dart object. If the object is not 81 // Returns the integer value of a Dart object. If the object is not
82 // an integer value an API error is propagated. 82 // an integer value an API error is propagated.
83 static int64_t GetIntegerValue(Dart_Handle value_obj); 83 static int64_t GetIntegerValue(Dart_Handle value_obj);
84 // Returns the integer value of a Dart object. If the object is not
85 // an integer value or outside the requested range an API error is
86 // propagated.
87 static int64_t GetInt64ValueCheckRange(
88 Dart_Handle value_obj, int64_t lower, int64_t upper);
84 // Returns the intptr_t value of a Dart object. If the object is not 89 // Returns the intptr_t value of a Dart object. If the object is not
85 // an integer value or the value is outside the intptr_t range an 90 // an integer value or the value is outside the intptr_t range an
86 // API error is propagated. 91 // API error is propagated.
87 static intptr_t GetIntptrValue(Dart_Handle value_obj); 92 static intptr_t GetIntptrValue(Dart_Handle value_obj);
88 // Checks that the value object is an integer object that fits in a 93 // Checks that the value object is an integer object that fits in a
89 // signed 64-bit integer. If it is, the value is returned in the 94 // signed 64-bit integer. If it is, the value is returned in the
90 // value out parameter and true is returned. Otherwise, false is 95 // value out parameter and true is returned. Otherwise, false is
91 // returned. 96 // returned.
92 static bool GetInt64Value(Dart_Handle value_obj, int64_t* value); 97 static bool GetInt64Value(Dart_Handle value_obj, int64_t* value);
93 // Returns the string value of a Dart object. If the object is not 98 // Returns the string value of a Dart object. If the object is not
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 540 }
536 541
537 private: 542 private:
538 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array); 543 DISALLOW_COPY_AND_ASSIGN(CObjectExternalUint8Array);
539 }; 544 };
540 545
541 } // namespace bin 546 } // namespace bin
542 } // namespace dart 547 } // namespace dart
543 548
544 #endif // BIN_DARTUTILS_H_ 549 #endif // BIN_DARTUTILS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698