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

Unified Diff: ppapi/cpp/logging.h

Issue 8438005: Some description changes and documentation for logging.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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 | « ppapi/cpp/instance.h ('k') | ppapi/cpp/module_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/logging.h
===================================================================
--- ppapi/cpp/logging.h (revision 108119)
+++ ppapi/cpp/logging.h (working copy)
@@ -5,10 +5,30 @@
#ifndef PPAPI_CPP_LOGGING_H_
#define PPAPI_CPP_LOGGING_H_
+/// @file
+/// This file defines two macro asserts.
+
#include <cassert>
+/// This macro asserts that 'a' evaluates to true. In debug mode, this macro
+/// will crash the program if the assertion evaluates to false. It (typically)
+/// has no effect in release mode.
#define PP_DCHECK(a) assert(a)
+/// This macro asserts false in debug builds. It's used in code paths that you
+/// don't expect to execute.
+///
+/// <strong>Example:</code>
+///
+/// <code>
+/// if (!pointer) {
+/// // Pointer wasn't valid! This shouldn't happen.
+/// PP_NOTREACHED();
+/// return;
+/// }
+/// // Do stuff to the pointer, since you know it's valid.
+/// pointer->DoSomething();
+/// </code>
#define PP_NOTREACHED() assert(false)
#endif // PPAPI_CPP_LOGGING_H_
« no previous file with comments | « ppapi/cpp/instance.h ('k') | ppapi/cpp/module_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698