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

Unified Diff: runtime/include/dart_api.h

Issue 8334009: Use the distinguished class, ApiFailure, to signal when a Dart_Result is (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 | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/include/dart_api.h
===================================================================
--- runtime/include/dart_api.h (revision 537)
+++ runtime/include/dart_api.h (working copy)
@@ -53,7 +53,6 @@
kRetCInt64,
kRetCDouble,
kRetLibSpec,
- kRetError,
} Dart_ReturnType;
typedef struct {
@@ -65,7 +64,6 @@
Dart_Handle obj_value;
int64_t int64_value;
double double_value;
- const char* errmsg;
} retval_;
} Dart_Result;
@@ -103,9 +101,8 @@
// TODO(iposva): This is a placeholder for the eventual external Dart API.
// Return value handling after a Dart API call.
-inline bool Dart_IsValidResult(const Dart_Result& result) {
- return (result.type_ != kRetError);
-}
+DART_EXPORT bool Dart_IsValidResult(const Dart_Result& result);
+
inline intptr_t Dart_GetResultAsCIntptr(const Dart_Result& result) {
assert(result.type_ == kRetCIntptr); // Valid to access result as C int.
return result.retval_.int_value;
@@ -167,17 +164,8 @@
result.retval_.double_value = value;
return result;
}
-inline const char* Dart_GetErrorCString(const Dart_Result& result) {
- assert(result.type_ == kRetError); // Valid to access only on failure.
- return result.retval_.errmsg;
-}
-inline Dart_Result Dart_ErrorResult(const char* value) {
- // Assumes passed in string value will be available on return.
- Dart_Result result;
- result.type_ = kRetError;
- result.retval_.errmsg = value;
- return result;
-}
+DART_EXPORT const char* Dart_GetErrorCString(const Dart_Result& result);
+DART_EXPORT Dart_Result Dart_ErrorResult(const char* value);
// Initialize the VM with commmand line flags.
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698