Changeset 19506 in webkit


Ignore:
Timestamp:
Feb 8, 2007 1:01:28 PM (17 years ago)
Author:
beidson
Message:

Reviewed by Tim Hatcher

Tweaked the thread violation behavior to be disabled by default, and to provide
an easy breakpoint to set.
The possibilities for the "WebCoreThreadCheck" user defaults key are -

  • The value "None" disables thread checking
  • The value "Log" causes an NSLog on a violation
  • The value "Exception" causes exceptions to be raised on a violation
  • platform/Logging.h:
  • platform/mac/LoggingMac.mm: (WebCore::_WebCoreThreadViolationCheck): (WebCoreReportThreadViolation): In the global namespace, making breakpoints cake!
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r19503 r19506  
     12007-02-08  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Tim Hatcher
     4
     5        Tweaked the thread violation behavior to be disabled by default, and to provide
     6        an easy breakpoint to set. 
     7        The possibilities for the "WebCoreThreadCheck" user defaults key are -
     8          - The value "None" disables thread checking
     9          - The value "Log" causes an NSLog on a violation
     10          - The value "Exception" causes exceptions to be raised on a violation
     11
     12        * platform/Logging.h:
     13        * platform/mac/LoggingMac.mm:
     14        (WebCore::_WebCoreThreadViolationCheck):
     15        (WebCoreReportThreadViolation):  In the global namespace, making breakpoints cake!
     16
    1172007-02-08  Brady Eidson  <beidson@apple.com>
    218
  • trunk/WebCore/platform/Logging.h

    r19503 r19506  
    5656} // namespace WebCore
    5757
     58extern "C" void WebCoreReportThreadViolation(const char* funciton, bool threadViolationIsException);
     59
    5860#define WebCoreThreadViolationCheck() do \
    5961WebCore::_WebCoreThreadViolationCheck(WTF_PRETTY_FUNCTION); \
  • trunk/WebCore/platform/mac/LoggingMac.mm

    r19503 r19506  
    6969{
    7070    static bool fetchDefault = true;
    71     static bool performThreadCheck = true;
     71    static bool performThreadCheck = false;
    7272    static bool threadViolationIsException = false;
    7373    if (fetchDefault) {
     
    7575        if ([threadCheckLevel isEqualToString:@"None"])
    7676            performThreadCheck = false;
    77         else if ([threadCheckLevel isEqualToString:@"Exception"])
     77        else if ([threadCheckLevel isEqualToString:@"Exception"]) {
     78            performThreadCheck = true;
    7879            threadViolationIsException = true;
     80        } else if ([threadCheckLevel isEqualToString:@"Log"]) {
     81            performThreadCheck = true;
     82            threadViolationIsException = false;
     83        }
    7984        fetchDefault = false;
    8085    }
     
    8691        return;
    8792       
     93    WebCoreReportThreadViolation(function, threadViolationIsException);
     94}
     95
     96} // namespace WebCore
     97
     98// Split out the actual reporting of the thread violation to make it easier to set a breakpoint
     99void WebCoreReportThreadViolation(const char* function, bool threadViolationIsException)
     100{
    88101    if (threadViolationIsException)
    89102        [NSException raise:@"WebKitThreadingException" format:@"%s was called from a secondary thread", function];
     
    91104        NSLog(@"WebKit Threading Violation - %s called from secondary thread", function);
    92105}
    93 
    94 } // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.