Bug 144270

Summary: Make `enum NavigationType` be an enum class
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, cgarcia, commit-queue, gustavo, japhet, mcatanzaro, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 144269    
Attachments:
Description Flags
Patch v1 achristensen: review+

Description Brady Eidson 2015-04-27 11:16:55 PDT
Make `enum NavigationType` be an enum class
Comment 1 Brady Eidson 2015-04-27 11:31:17 PDT
Created attachment 251762 [details]
Patch v1
Comment 2 WebKit Commit Bot 2015-04-27 11:32:28 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Alex Christensen 2015-04-27 11:40:17 PDT
Comment on attachment 251762 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=251762&action=review

r=me

> Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:1569
> +        [NSNumber numberWithInt:static_cast<int>(action.type())], WebActionNavigationTypeKey,

Why is this necessary?  I would omit this from this change.
Comment 4 Brady Eidson 2015-04-27 11:42:55 PDT
(In reply to comment #3)
> Comment on attachment 251762 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=251762&action=review
> 
> r=me
> 
> > Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm:1569
> > +        [NSNumber numberWithInt:static_cast<int>(action.type())], WebActionNavigationTypeKey,
> 
> Why is this necessary?  I would omit this from this change.

Because it is illegal to implicitly cast an `enum class` to an integer - One of the stronger protections enum class provides.

Without this change, this patch rightfully fails to build!
Comment 5 Brady Eidson 2015-04-27 11:47:46 PDT
http://trac.webkit.org/changeset/183405