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

Unified Diff: runtime/vm/dart_api_impl.h

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/include/dart_api.h ('k') | 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/vm/dart_api_impl.h
===================================================================
--- runtime/vm/dart_api_impl.h (revision 775)
+++ runtime/vm/dart_api_impl.h (working copy)
@@ -7,22 +7,13 @@
#include "vm/allocation.h"
-#define RETURN_FAILURE(msg) return Dart_ErrorResult(msg)
-#define RETURN_CINT(retval) return Dart_ResultAsCIntptr(retval)
-#define RETURN_CBOOLEAN(retval) return Dart_ResultAsCBoolean(retval)
-#define RETURN_CSTRING(retval) return Dart_ResultAsCString(retval)
-#define RETURN_OBJECT(obj) return Dart_ResultAsObject(Api::NewLocalHandle(obj))
-#define RETURN_CINT64(retval) return Dart_ResultAsCInt64(retval)
-#define RETURN_CDOUBLE(retval) return Dart_ResultAsCDouble(retval)
-
namespace dart {
-// Forward declarations.
-class Object;
-class RawObject;
+class ApiState;
class LocalHandle;
+class Object;
class PersistentHandle;
-class ApiState;
+class RawObject;
class Api : AllStatic {
public:
@@ -40,6 +31,12 @@
static PersistentHandle* UnwrapAsPersistentHandle(const ApiState& state,
Dart_Handle object);
+ // Get the handle used to designate successful return.
+ static Dart_Handle Success();
+
+ // Generate a handle used to designate an error return.
+ static Dart_Handle Error(const char* msg);
+
// Allocate space in the local zone.
static uword Allocate(intptr_t size);
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698