[Webkit-unassigned] [Bug 36545] [Chromium] Add an ASSERT macro to the Chromium WebKit API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 24 21:07:58 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36545


Darin Fisher (:fishd, Google) <fishd at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #51522|review?                     |review-
               Flag|                            |




--- Comment #2 from Darin Fisher (:fishd, Google) <fishd at chromium.org>  2010-03-24 21:07:58 PST ---
(From update of attachment 51522)
> +++ b/WebKit/chromium/public/WebCommon.h
...
>  } // namespace WebKit
>  
> +// -----------------------------------------------------------------------------
> +// Assertions
> +
> +namespace WebKit {
> +
> +void failedAssertion(const char* file, int line, const char* function, const char* assertion);
> +
> +} // namespace WebKit

Why close and then re-open the WebKit namespace?

Please annotate WebKit API entry points with WEBKIT_API.


> +// Only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks.  Otherwise use WTF's ASSERT.

There is actually no problem using this outside of WEBKIT_IMPLEMENTATION
blocks.


> +#if defined(NDEBUG)
> +#define WEBKIT_ASSERT(assertion) ((void)0)
> +#else
> +#define WEBKIT_ASSERT(assertion) do \
> +    if (!(assertion)) { \
> +        WebKit::failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
> +    } \

^^^ nit: webkit style says no brackets around single line statements.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list