In r214934 I added error constants to API::Error, but not for all errors exposed in the C API. Because of this we are mixing both constants in WebErrors and in GTk+ WebKitPrivate.
Created attachment 312766 [details] Patch
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 on attachment 312766 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=312766&action=review > Source/WebKit2/Shared/API/APIError.h:51 > + enum General { We're trying to use more enum classes in WebKit unless there's a good reason not to. And we need to be sure to have source and binary compatibility, which I think this patch has.
(In reply to Alex Christensen from comment #3) > Comment on attachment 312766 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=312766&action=review > > > Source/WebKit2/Shared/API/APIError.h:51 > > + enum General { > > We're trying to use more enum classes in WebKit unless there's a good reason > not to. And we need to be sure to have source and binary compatibility, > which I think this patch has. Yes, in this particular case we don't use enum class, because we are interested in the integer values, we would need to cast everywhere if we used enum class.
I think the necessity of including from c headers is the only good reason to use an enum instead of an enum class.
Committed r218244: <http://trac.webkit.org/changeset/218244>
If there are two sets of constants, that must be identical, what keeps them in sync? If nothing else, should we write static_assert statements that check that they are equal?
(In reply to Darin Adler from comment #7) > If there are two sets of constants, that must be identical, what keeps them > in sync? If nothing else, should we write static_assert statements that > check that they are equal? I think we should make WKErrorGetErrorCode return the value using a switch and checking the API::Error value, even if they are currently the same values. That's what we do in the GTK+ API implementation. I'll do it in a follow up if you agree.
I do agree.