RESOLVED FIXED 91598
[EFL] Add central error management to EFL port
https://bugs.webkit.org/show_bug.cgi?id=91598
Summary [EFL] Add central error management to EFL port
Chris Dumez
Reported 2012-07-18 00:40:28 PDT
We need a ErrorsEfl.h header in WebCore that defines all the possible errors used by EFL port. We can then use that header in both WebKit1 and WebKit2 EFL. This is the approach used by the GTK port. At the moment, the EFL port has no central error management and we use static constants defined here and there for error domains and codes.
Attachments
Proposed patch (24.15 KB, patch)
2012-07-18 02:22 PDT, Chris Dumez
no flags
Patch (23.97 KB, patch)
2012-07-18 03:05 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2012-07-18 02:22:04 PDT
Created attachment 152966 [details] Proposed patch
Gyuyoung Kim
Comment 2 2012-07-18 02:47:01 PDT
Comment on attachment 152966 [details] Proposed patch Looks good to me. Thanks !!
Dominik Röttsches (drott)
Comment 3 2012-07-18 02:52:54 PDT
Comment on attachment 152966 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=152966&action=review LGTM with the two nits. > Source/WebCore/platform/efl/ErrorsEfl.h:52 > +// Sync'd with Mac's WebKit Errors. Can you mention here where these are copied from, i.e. // copied from WebKit/Misc/WebKitErrors[Private].h > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:365 > + if (!strcmp(error->domain, "WebKitNetworkError")) { I think this translation deserves a comment explaining why it's done - matching test expectations etc.
jochen
Comment 4 2012-07-18 02:59:06 PDT
Comment on attachment 152966 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=152966&action=review > Source/WebCore/platform/efl/ErrorsEfl.cpp:41 > + request.url().string(), "Load request cancelled"); you don't need to wrap the line here and below > Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp:374 > if (error->failing_url && *error->failing_url != '\0') { no need for { } since the body is one line only now
Chris Dumez
Comment 5 2012-07-18 03:05:45 PDT
Created attachment 152975 [details] Patch Take Dominik and Jochen's feedback into consideration.
jochen
Comment 6 2012-07-18 03:38:56 PDT
The patch looks good to me
Kenneth Rohde Christiansen
Comment 7 2012-07-18 03:45:09 PDT
Comment on attachment 152975 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152975&action=review > Source/WebCore/platform/efl/ErrorsEfl.cpp:42 > +namespace WebCore { > + > +ResourceError cancelledError(const ResourceRequest& request) > +{ > + return ResourceError(errorDomainNetwork, NetworkErrorCancelled, request.url().string(), "Load request cancelled"); > +} > + I guess this is not really EFL related. Maybe it makes sense to share with Qt?
Kenneth Rohde Christiansen
Comment 8 2012-07-18 03:45:46 PDT
Simon would it make sense to use some of this for Qt?
Chris Dumez
Comment 9 2012-07-18 04:04:03 PDT
(In reply to comment #7) > (From update of attachment 152975 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=152975&action=review > > > Source/WebCore/platform/efl/ErrorsEfl.cpp:42 > > +namespace WebCore { > > + > > +ResourceError cancelledError(const ResourceRequest& request) > > +{ > > + return ResourceError(errorDomainNetwork, NetworkErrorCancelled, request.url().string(), "Load request cancelled"); > > +} > > + > > I guess this is not really EFL related. Maybe it makes sense to share with Qt? In Qt port, you would probably want to use tr() for the strings. GTK port is using Gettext for example.
Kenneth Rohde Christiansen
Comment 10 2012-07-18 04:20:22 PDT
(In reply to comment #9) > (In reply to comment #7) > > (From update of attachment 152975 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=152975&action=review > > > > > Source/WebCore/platform/efl/ErrorsEfl.cpp:42 > > > +namespace WebCore { > > > + > > > +ResourceError cancelledError(const ResourceRequest& request) > > > +{ > > > + return ResourceError(errorDomainNetwork, NetworkErrorCancelled, request.url().string(), "Load request cancelled"); > > > +} > > > + > > > > I guess this is not really EFL related. Maybe it makes sense to share with Qt? > > In Qt port, you would probably want to use tr() for the strings. GTK port is using Gettext for example. That could easily be fixed with a macro in Platform.h or so
Kenneth Rohde Christiansen
Comment 11 2012-07-18 04:21:10 PDT
> That could easily be fixed with a macro in Platform.h or so hmm, maybe not gettext has to look thought the files and search for _ or something. Not sure how tr() works.
Simon Hausmann
Comment 12 2012-07-18 04:38:13 PDT
Comment on attachment 152975 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152975&action=review >>>> Source/WebCore/platform/efl/ErrorsEfl.cpp:42 >>>> + >>> >>> I guess this is not really EFL related. Maybe it makes sense to share with Qt? >> >> In Qt port, you would probably want to use tr() for the strings. GTK port is using Gettext for example. > > That could easily be fixed with a macro in Platform.h or so Sounds interesting. The macro part I'm not sure about, because for the purpose of translation the name of the "function" that encloses the translation matters.
Chris Dumez
Comment 13 2012-07-18 05:21:44 PDT
We need this as soon as possible for our port. While integrating with Qt (and likely GTK) is an interesting idea, this may take time as we need to solve some issues such as localization and patch all the relevant code for those ports. Could we land this patch like as it is for now and discuss the possible code sharing with other ports in a separate thread?
Kenneth Rohde Christiansen
Comment 14 2012-07-18 11:19:06 PDT
Comment on attachment 152975 [details] Patch sure r=me
Chris Dumez
Comment 15 2012-07-18 12:04:34 PDT
Could someone please cq+ ? I need this to land so that I can rebase the dependency at Bug 91602.
WebKit Review Bot
Comment 16 2012-07-18 13:01:57 PDT
Comment on attachment 152975 [details] Patch Clearing flags on attachment: 152975 Committed r123004: <http://trac.webkit.org/changeset/123004>
WebKit Review Bot
Comment 17 2012-07-18 13:02:05 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.