[webkit-reviews] review denied: [Bug 26638] WebKitErrors.m: _initWithPluginErrorCode: does not set localizedDescription : [Attachment 31708] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 23 01:28:38 PDT 2009
Mark Rowe (bdash) <mrowe at apple.com> has denied opendarwin at lapcatsoftware.com's
request for review:
Bug 26638: WebKitErrors.m: _initWithPluginErrorCode: does not set
localizedDescription
https://bugs.webkit.org/show_bug.cgi?id=26638
Attachment 31708: Patch
https://bugs.webkit.org/attachment.cgi?id=31708&action=review
------- Additional Comments from Mark Rowe (bdash) <mrowe at apple.com>
> 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.
More information about the webkit-reviews
mailing list