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

Unified Diff: runtime/bin/dartutils.cc

Issue 8380020: Refactor the dart api a bit: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/eventhandler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
===================================================================
--- runtime/bin/dartutils.cc (revision 775)
+++ runtime/bin/dartutils.cc (working copy)
@@ -11,47 +11,50 @@
int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) {
ASSERT(Dart_IsInteger(value_obj));
- Dart_Result result = Dart_IntegerValue(value_obj);
- ASSERT(Dart_IsValidResult(result));
- return Dart_GetResultAsCInt64(result);
+ int64_t value = 0;
+ Dart_Handle result = Dart_IntegerValue(value_obj, &value);
+ ASSERT(Dart_IsValid(result));
+ return value;
}
const char* DartUtils::GetStringValue(Dart_Handle str_obj) {
- Dart_Result result = Dart_StringToCString(str_obj);
- ASSERT(Dart_IsValidResult(result));
- return Dart_GetResultAsCString(result);
+ const char* cstring = NULL;
+ Dart_Handle result = Dart_StringToCString(str_obj, &cstring);
+ ASSERT(Dart_IsValid(result));
+ return cstring;
}
bool DartUtils::GetBooleanValue(Dart_Handle bool_obj) {
- Dart_Result result = Dart_BooleanValue(bool_obj);
- ASSERT(Dart_IsValidResult(result));
- return Dart_GetResultAsCBoolean(result);
+ bool value = false;
+ Dart_Handle result = Dart_BooleanValue(bool_obj, &value);
+ ASSERT(Dart_IsValid(result));
+ return value;
}
void DartUtils::SetIntegerInstanceField(Dart_Handle handle,
const char* name,
intptr_t val) {
- Dart_Result result = Dart_SetInstanceField(handle,
+ Dart_Handle result = Dart_SetInstanceField(handle,
Dart_NewString(name),
Dart_NewInteger(val));
- ASSERT(Dart_IsValidResult(result));
+ ASSERT(Dart_IsValid(result));
}
intptr_t DartUtils::GetIntegerInstanceField(Dart_Handle handle,
const char* name) {
- Dart_Result result =
+ Dart_Handle result =
Dart_GetInstanceField(handle, Dart_NewString(name));
- ASSERT(Dart_IsValidResult(result));
- intptr_t value = DartUtils::GetIntegerValue(Dart_GetResult(result));
+ ASSERT(Dart_IsValid(result));
+ intptr_t value = DartUtils::GetIntegerValue(result);
return value;
}
void DartUtils::SetStringInstanceField(Dart_Handle handle,
const char* name,
const char* val) {
- Dart_Result result = Dart_SetInstanceField(handle,
+ Dart_Handle result = Dart_SetInstanceField(handle,
Dart_NewString(name),
Dart_NewString(val));
- ASSERT(Dart_IsValidResult(result));
+ ASSERT(Dart_IsValid(result));
}
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/bin/eventhandler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698