Changeset 20296 in webkit


Ignore:
Timestamp:
Mar 18, 2007 4:25:01 PM (17 years ago)
Author:
bdash
Message:

2007-03-18 Dan Waylonis <waylonis@mac.com>

Reviewed by Tim Hatcher.

Fix http://bugs.webkit.org/show_bug.cgi?id=13005
Bug 13005: WebScriptObject +throwException needs NULL check.

Add checking for NULL interpreter before throwing exception.

  • bindings/objc/WebScriptObject.mm: (+[WebScriptObject throwException:]):

2007-03-18 Dan Waylonis <waylonis@mac.com>

Reviewed by Tim Hatcher.

DumpRenderTree changes for http://bugs.webkit.org/show_bug.cgi?id=13005
Bug 13005: WebScriptObject +throwException needs NULL check.

Add tests to ensure that a plugin can safely throw an exception in dealloc.

  • DumpRenderTree/ObjCPlugin.h:
  • DumpRenderTree/ObjCPlugin.m: (+[ObjCPlugin webScriptNameForKey:]): (+[ObjCPlugin isKeyExcludedFromWebScript:]): (-[ObjCPlugin dealloc]):

2007-03-18 Dan Waylonis <waylonis@mac.com>

Reviewed by Tim Hatcher.

Tests for http://bugs.webkit.org/show_bug.cgi?id=13005
Bug 13005: WebScriptObject +throwException needs NULL check.

A plugin that throws on dealloc can crash WebKit.

  • plugins/throw-on-dealloc-expected.txt: Added.
  • plugins/throw-on-dealloc.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r20295 r20296  
     12007-03-18  Dan Waylonis  <waylonis@mac.com>
     2
     3        Reviewed by Tim Hatcher.
     4
     5        Tests for http://bugs.webkit.org/show_bug.cgi?id=13005
     6        Bug 13005: WebScriptObject +throwException needs NULL check.
     7
     8        A plugin that throws on dealloc can crash WebKit.
     9
     10        * plugins/throw-on-dealloc-expected.txt: Added.
     11        * plugins/throw-on-dealloc.html: Added.
     12
    1132007-03-18  Geoffrey Garen  <ggaren@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r20295 r20296  
     12007-03-18  Dan Waylonis  <waylonis@mac.com>
     2
     3        Reviewed by Tim Hatcher.
     4
     5        Fix http://bugs.webkit.org/show_bug.cgi?id=13005
     6        Bug 13005: WebScriptObject +throwException needs NULL check.
     7
     8        Add checking for NULL interpreter before throwing exception.
     9
     10        * bindings/objc/WebScriptObject.mm:
     11        (+[WebScriptObject throwException:]):
     12
    1132007-03-18  Geoffrey Garen  <ggaren@apple.com>
    214
  • trunk/WebCore/bindings/objc/WebScriptObject.mm

    r20240 r20296  
    169169    first = interp;
    170170    do {
     171        if (!interp)
     172            return NO;
     173
    171174        // If the interpreter has a context, we set the exception.
    172175        if (interp->context()) {
  • trunk/WebKitTools/ChangeLog

    r20141 r20296  
     12007-03-18  Dan Waylonis  <waylonis@mac.com>
     2
     3        Reviewed by Tim Hatcher.
     4
     5        DumpRenderTree changes for http://bugs.webkit.org/show_bug.cgi?id=13005
     6        Bug 13005: WebScriptObject +throwException needs NULL check.
     7
     8        Add tests to ensure that a plugin can safely throw an exception in dealloc.
     9
     10        * DumpRenderTree/ObjCPlugin.h:
     11        * DumpRenderTree/ObjCPlugin.m:
     12        (+[ObjCPlugin webScriptNameForKey:]):
     13        (+[ObjCPlugin isKeyExcludedFromWebScript:]):
     14        (-[ObjCPlugin dealloc]):
     15
    1162007-03-13  Mark Rowe  <mrowe@apple.com>
    217
  • trunk/WebKitTools/DumpRenderTree/ObjCPlugin.h

    r15020 r20296  
    2929@interface ObjCPlugin : NSObject
    3030{
     31    BOOL throwOnDealloc;
    3132}
    3233
  • trunk/WebKitTools/DumpRenderTree/ObjCPlugin.m

    r16118 r20296  
    158158}
    159159
     160+ (NSString *)webScriptNameForKey:(const char *)key
     161{
     162    if (strcmp(key, "throwOnDealloc") == 0)
     163      return @"throwOnDealloc";
     164   
     165    return nil;
     166}
     167
     168+ (BOOL)isKeyExcludedFromWebScript:(const char *)key
     169{
     170    if (strcmp(key, "throwOnDealloc") == 0)
     171      return NO;
     172   
     173    return YES;
     174}
     175
    160176- (void)removeBridgeRestrictions:(id)container
    161177{
     
    180196}
    181197
    182 @end
     198- (void)dealloc
     199{
     200    if (throwOnDealloc)
     201        [WebScriptObject throwException:@"Throwing exception on dealloc of ObjCPlugin"];
     202   
     203    [super dealloc];
     204}
     205
     206@end
Note: See TracChangeset for help on using the changeset viewer.