Bug 144270 - Make `enum NavigationType` be an enum class
Summary: Make `enum NavigationType` be an enum class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 144269
  Show dependency treegraph
 
Reported: 2015-04-27 11:16 PDT by Brady Eidson
Modified: 2015-04-27 11:47 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1 (16.08 KB, patch)
2015-04-27 11:31 PDT, Brady Eidson
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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