Changeset 56579 in webkit


Ignore:
Timestamp:
Mar 25, 2010 4:48:30 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-25 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Darin Fisher.

[Chromium] Add an ASSERT macro to the Chromium WebKit API
https://bugs.webkit.org/show_bug.cgi?id=36545

  • WebKit.gyp: Add WebCommon.cpp
  • public/WebCommon.h: Add the Macro.
  • public/WebPrivatePtr.h: (WebKit::WebPrivatePtr::~WebPrivatePtr): Verify the pointer is now 0.
  • src/WebCommon.cpp: Added. (WebKit::failedAssertion): Calls the WTF assert function and then crashes.
Location:
trunk/WebKit/chromium
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r56571 r56579  
     12010-03-25  Jeremy Orlow  <jorlow@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [Chromium] Add an ASSERT macro to the Chromium WebKit API
     6        https://bugs.webkit.org/show_bug.cgi?id=36545
     7
     8        * WebKit.gyp:  Add WebCommon.cpp
     9        * public/WebCommon.h:  Add the Macro.
     10        * public/WebPrivatePtr.h:
     11        (WebKit::WebPrivatePtr::~WebPrivatePtr):  Verify the pointer is now 0.
     12        * src/WebCommon.cpp: Added.
     13        (WebKit::failedAssertion): Calls the WTF assert function and then crashes.
     14
    1152010-03-25  Jochen Eisinger  <jochen@chromium.org>
    216
  • trunk/WebKit/chromium/WebKit.gyp

    r56457 r56579  
    288288                'src/WebCache.cpp',
    289289                'src/WebColor.cpp',
     290                'src/WebCommon.cpp',
    290291                'src/WebCrossOriginPreflightResultCache.cpp',
    291292                'src/WebCString.cpp',
  • trunk/WebKit/chromium/public/WebCommon.h

    r50671 r56579  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    9090#endif
    9191
     92// -----------------------------------------------------------------------------
     93// Assertions
     94
     95WEBKIT_API void failedAssertion(const char* file, int line, const char* function, const char* assertion);
     96
    9297} // namespace WebKit
    9398
     99// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks.  (Otherwise use WTF's ASSERT.)
     100#if defined(NDEBUG)
     101#define WEBKIT_ASSERT(assertion) ((void)0)
     102#else
     103#define WEBKIT_ASSERT(assertion) do { \
     104    if (!(assertion)) \
     105        failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
     106} while (0)
    94107#endif
     108
     109#endif
  • trunk/WebKit/chromium/public/WebPrivatePtr.h

    r55866 r56579  
    4545public:
    4646    WebPrivatePtr() : m_ptr(0) { }
     47    ~WebPrivatePtr() { WEBKIT_ASSERT(!m_ptr); }
    4748
    4849    bool isNull() const { return !m_ptr; }
Note: See TracChangeset for help on using the changeset viewer.