Changeset 76191 in webkit
- Timestamp:
- Jan 19, 2011 6:18:13 PM (13 years ago)
- Location:
- trunk/Source/WebKit/mac
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/mac/ChangeLog
r76170 r76191 1 2011-01-19 Darin Adler <darin@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Would like script debugging protocol method to differentiate between caught and uncaught exceptions 6 https://bugs.webkit.org/show_bug.cgi?id=52104 7 rdar://problem/8704226 8 9 * WebView/WebDelegateImplementationCaching.h: 10 Fix type of second integer in CallScriptDebugDelegate function overload 11 to be int to match the actual Objective-C method. Added a new overload 12 that includes a BOOL in the right place. Added a boolean named 13 exceptionWasRaisedExpectsHasHandlerFlag. 14 15 * WebView/WebDelegateImplementationCaching.mm: 16 (CallDelegate): Added overloads as above. 17 (CallScriptDebugDelegate): Ditto. 18 19 * WebView/WebScriptDebugDelegate.h: Added new method with the additional 20 boolean argument. Marked the old method informally deprecated. 21 22 * WebView/WebScriptDebugger.mm: 23 (WebScriptDebugger::exception): Added code to call with or without the 24 boolean depending on exceptionWasRaisedExpectsHasHandlerFlag. 25 26 * WebView/WebView.mm: 27 (-[WebView _cacheScriptDebugDelegateImplementations]): Set up the 28 exceptionWasRaisedExpectsHasHandlerFlag. Also fixed old code that was not 29 guaranteed to set didParseSourceExpectsBaseLineNumber to NO. 30 1 31 2011-01-19 Tony Gentilcore <tonyg@chromium.org> 2 32 -
trunk/Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h
r58442 r76191 81 81 struct WebScriptDebugDelegateImplementationCache { 82 82 BOOL didParseSourceExpectsBaseLineNumber; 83 BOOL exceptionWasRaisedExpectsHasHandlerFlag; 83 84 IMP didParseSourceFunc; 84 85 IMP failedToParseSourceFunc; … … 139 140 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, NSInteger, id); 140 141 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, id, id, id); 141 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, NSInteger, id); 142 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, NSInteger, int, id); 143 id CallScriptDebugDelegate(IMP, WebView *, SEL, id, BOOL, NSInteger, int, id); 142 144 143 145 id CallHistoryDelegate(IMP, WebView *, SEL); -
trunk/Source/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
r58442 r76191 346 346 } 347 347 348 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, NSIntegerinteger2, id object2)348 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, NSInteger integer1, int integer2, id object2) 349 349 { 350 350 if (!delegate) … … 360 360 } 361 361 362 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, BOOL boolean, NSInteger integer1, int integer2, id object2) 363 { 364 if (!delegate) 365 return nil; 366 if (!self->_private->catchesDelegateExceptions) 367 return implementation(delegate, selector, self, object1, boolean, integer1, integer2, object2); 368 @try { 369 return implementation(delegate, selector, self, object1, boolean, integer1, integer2, object2); 370 } @catch(id exception) { 371 ReportDiscardedDelegateException(selector, exception); 372 } 373 return nil; 374 } 375 362 376 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object1, id object2, NSInteger integer, id object3) 363 377 { … … 575 589 } 576 590 577 id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, NSIntegerinteger2, id object2)591 id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, NSInteger integer1, int integer2, id object2) 578 592 { 579 593 return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, integer1, integer2, object2); 580 594 } 581 595 596 id CallScriptDebugDelegate(IMP implementation, WebView *self, SEL selector, id object1, BOOL boolean, NSInteger integer1, int integer2, id object2) 597 { 598 return CallDelegate(implementation, self, self->_private->scriptDebugDelegate, selector, object1, boolean, integer1, integer2, object2); 599 } 600 582 601 id CallHistoryDelegate(IMP implementation, WebView *self, SEL selector) 583 602 { -
trunk/Source/WebKit/mac/WebView/WebScriptDebugDelegate.h
r40631 r76191 100 100 // exception is being thrown 101 101 - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame 102 hasHandler:(BOOL)hasHandler 102 103 sourceId:(WebSourceId)sid 103 104 line:(int)lineno 104 105 forWebFrame:(WebFrame *)webFrame; 106 107 // exception is being thrown (deprecated old version; called only if new version is not implemented) 108 - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame 109 sourceId:(WebSourceId)sid 110 line:(int)lineno 111 forWebFrame:(WebFrame *)webFrame; 112 105 113 @end 106 114 -
trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm
r76129 r76191 213 213 [m_topCallFrame.get() _setDebuggerCallFrame:debuggerCallFrame]; 214 214 215 WebScriptDebugDelegateImplementationCache* implementations = WebViewGetScriptDebugDelegateImplementations(webView); 216 if (implementations->exceptionWasRaisedFunc) 217 CallScriptDebugDelegate(implementations->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); 215 WebScriptDebugDelegateImplementationCache* cache = WebViewGetScriptDebugDelegateImplementations(webView); 216 if (cache->exceptionWasRaisedFunc) { 217 if (cache->exceptionWasRaisedExpectsHasHandlerFlag) 218 CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:hasHandler:sourceId:line:forWebFrame:), m_topCallFrame.get(), hasHandler, sourceID, lineNumber, webFrame); 219 else 220 CallScriptDebugDelegate(cache->exceptionWasRaisedFunc, webView, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:), m_topCallFrame.get(), sourceID, lineNumber, webFrame); 221 } 218 222 219 223 m_callingDelegate = false; -
trunk/Source/WebKit/mac/WebView/WebView.mm
r75857 r76191 1605 1605 if (cache->didParseSourceFunc) 1606 1606 cache->didParseSourceExpectsBaseLineNumber = YES; 1607 else 1607 else { 1608 cache->didParseSourceExpectsBaseLineNumber = NO; 1608 1609 cache->didParseSourceFunc = getMethod(delegate, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:)); 1610 } 1609 1611 1610 1612 cache->failedToParseSourceFunc = getMethod(delegate, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:)); … … 1612 1614 cache->willExecuteStatementFunc = getMethod(delegate, @selector(webView:willExecuteStatement:sourceId:line:forWebFrame:)); 1613 1615 cache->willLeaveCallFrameFunc = getMethod(delegate, @selector(webView:willLeaveCallFrame:sourceId:line:forWebFrame:)); 1614 cache->exceptionWasRaisedFunc = getMethod(delegate, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:)); 1616 1617 cache->exceptionWasRaisedFunc = getMethod(delegate, @selector(webView:exceptionWasRaised:hasHandler:sourceId:line:forWebFrame:)); 1618 if (cache->exceptionWasRaisedFunc) 1619 cache->exceptionWasRaisedExpectsHasHandlerFlag = YES; 1620 else { 1621 cache->exceptionWasRaisedExpectsHasHandlerFlag = NO; 1622 cache->exceptionWasRaisedFunc = getMethod(delegate, @selector(webView:exceptionWasRaised:sourceId:line:forWebFrame:)); 1623 } 1615 1624 } 1616 1625
Note: See TracChangeset
for help on using the changeset viewer.