[Webkit-unassigned] [Bug 26638] WebKitErrors.m: _initWithPluginErrorCode: does not set localizedDescription

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 23 01:28:38 PDT 2009


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


mrowe at apple.com changed:

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




------- Comment #2 from mrowe at apple.com  2009-06-23 01:28 PDT -------
(From update of attachment 31708)
> diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
> index c48775e..7091307 100644
> --- a/WebKit/mac/ChangeLog
> +++ b/WebKit/mac/ChangeLog
> @@ -1,3 +1,10 @@
> +2009-06-23  Jeff Johnson  <opendarwin at lapcatsoftware.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        * Misc/WebKitErrors.m:
> +        (-[NSError _initWithPluginErrorCode:contentURL:pluginPageURL:pluginName:MIMEType:]):
> +
>  2009-06-20  Darin Adler  <darin at apple.com>

The ChangeLog should contain a link to the bug and it's title, along with a
brief description of the change.  See other entries in the file for an example.

>          Reviewed by Sam Weinig.
> diff --git a/WebKit/mac/Misc/WebKitErrors.m b/WebKit/mac/Misc/WebKitErrors.m
> index 5985d9a..303c426 100644
> --- a/WebKit/mac/Misc/WebKitErrors.m
> +++ b/WebKit/mac/Misc/WebKitErrors.m
> @@ -106,6 +106,11 @@ static NSMutableDictionary *descriptions = nil;
>      [[self class] _registerWebKitErrors];
>      
>      NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init];
> +    NSDictionary *descriptionsDict = [descriptions objectForKey:WebKitErrorDomain];
> +    NSString *localizedDesc = descriptionsDict ? [descriptionsDict objectForKey:[NSNumber numberWithInt:code]] : nil;
> +    if (localizedDesc) {
> +        [userInfo setObject:localizedDesc forKey:NSLocalizedDescriptionKey];
> +    }
>      if (contentURL) {
>          [userInfo setObject:contentURL forKey:@"NSErrorFailingURLKey"];
>  #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)

I mentioned a few style issues with this code on IRC:

* Sending a message with an object return type to nil will return nil, so the
ternary statement is not necessary
* Abbreviating Description to Desc is inconsistent with the other variable
name, and not something we typically do
* We omit braces around a single-line if statement

For easy reference, the WebKit coding style guidelines are at
<http://webkit.org/coding/coding-style.html>.

Besides the ChangeLog and style issues the change is good.  If you can make
these changes and resubmit the patch I'll happily throw an r+ on it for you.


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



More information about the webkit-unassigned mailing list