Bug 91598 - [EFL] Add central error management to EFL port
Summary: [EFL] Add central error management to EFL port
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
Depends on:
Blocks: 61838 91602
  Show dependency treegraph
 
Reported: 2012-07-18 00:40 PDT by Chris Dumez
Modified: 2012-07-18 13:02 PDT (History)
11 users (show)

See Also:


Attachments
Proposed patch (24.15 KB, patch)
2012-07-18 02:22 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (23.97 KB, patch)
2012-07-18 03:05 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 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.
Comment 1 Chris Dumez 2012-07-18 02:22:04 PDT
Created attachment 152966 [details]
Proposed patch
Comment 2 Gyuyoung Kim 2012-07-18 02:47:01 PDT
Comment on attachment 152966 [details]
Proposed patch

Looks good to me. Thanks !!
Comment 3 Dominik Röttsches (drott) 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.
Comment 4 jochen 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
Comment 5 Chris Dumez 2012-07-18 03:05:45 PDT
Created attachment 152975 [details]
Patch

Take Dominik and Jochen's feedback into consideration.
Comment 6 jochen 2012-07-18 03:38:56 PDT
The patch looks good to me
Comment 7 Kenneth Rohde Christiansen 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?
Comment 8 Kenneth Rohde Christiansen 2012-07-18 03:45:46 PDT
Simon would it make sense to use some of this for Qt?
Comment 9 Chris Dumez 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.
Comment 10 Kenneth Rohde Christiansen 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
Comment 11 Kenneth Rohde Christiansen 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.
Comment 12 Simon Hausmann 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.
Comment 13 Chris Dumez 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?
Comment 14 Kenneth Rohde Christiansen 2012-07-18 11:19:06 PDT
Comment on attachment 152975 [details]
Patch

sure r=me
Comment 15 Chris Dumez 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.
Comment 16 WebKit Review Bot 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>
Comment 17 WebKit Review Bot 2012-07-18 13:02:05 PDT
All reviewed patches have been landed.  Closing bug.