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

Unified Diff: src/api.h

Issue 130933003: Various ApiCheck-related cleanups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index aa3c38c406e2647675c476f0fa37f3e561ca7e7d..6091aa1abb691cbef2b88142e5853039a9fb5386 100644
--- a/src/api.h
+++ b/src/api.h
@@ -196,7 +196,12 @@ class RegisteredExtension {
class Utils {
public:
- static bool ReportApiFailure(const char* location, const char* message);
+ static inline bool ApiCheck(bool condition,
+ const char* location,
+ const char* message) {
+ if (!condition) Utils::ReportApiFailure(location, message);
+ return condition;
+ }
static Local<FunctionTemplate> ToFunctionTemplate(NeanderObject obj);
static Local<ObjectTemplate> ToObjectTemplate(NeanderObject obj);
@@ -303,6 +308,9 @@ OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE)
static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) {
return OpenHandle(*handle);
}
+
+ private:
+ static void ReportApiFailure(const char* location, const char* message);
};
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698