Bug 125182 - [GTK][WK2] Fix WebKit2 build after API::Client changes
Summary: [GTK][WK2] Fix WebKit2 build after API::Client changes
Status: RESOLVED DUPLICATE of bug 125206
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nick Diego Yamane (diegoyam)
URL:
Keywords:
: 125187 (view as bug list)
Depends on:
Blocks: 125173 125206
  Show dependency treegraph
 
Reported: 2013-12-03 14:13 PST by Nick Diego Yamane (diegoyam)
Modified: 2013-12-04 10:55 PST (History)
14 users (show)

See Also:


Attachments
Patch (1.79 KB, patch)
2013-12-03 14:15 PST, Nick Diego Yamane (diegoyam)
no flags Details | Formatted Diff | Diff
Patch (2.67 KB, patch)
2013-12-03 15:04 PST, Nick Diego Yamane (diegoyam)
no flags Details | Formatted Diff | Diff
Patch (9.80 KB, patch)
2013-12-03 15:28 PST, Nick Diego Yamane (diegoyam)
no flags Details | Formatted Diff | Diff
Patch (49.14 KB, patch)
2013-12-03 18:44 PST, Nick Diego Yamane (diegoyam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Diego Yamane (diegoyam) 2013-12-03 14:13:49 PST
[GTK][EFL][WK2] Fix WebKit2 build after r160028
Comment 1 Nick Diego Yamane (diegoyam) 2013-12-03 14:15:29 PST
Created attachment 218338 [details]
Patch
Comment 2 Nick Diego Yamane (diegoyam) 2013-12-03 14:38:20 PST
It's still failing due to changes from bug 125178.

../../Source/WebKit2/Shared/API/c/WKDeclarationSpecifiers.h:49:48: error: missing binary operator before token "("
 #if defined(__has_extension) && __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
                                                ^
../../Source/WebKit2/Shared/API/c/WKDeclarationSpecifiers.h:55:48: error: missing binary operator before token "("
 #if defined(__has_extension) && __has_extension(enumerator_attributes) && __has_extension(attribute_unavailable_with_message)
                                                ^
Comment 3 Anders Carlsson 2013-12-03 14:41:39 PST
You can probably try something like

#ifndef __has_extension
#define __has_extension(x) 0
#endif
Comment 4 Nick Diego Yamane (diegoyam) 2013-12-03 14:44:27 PST
(In reply to comment #3)
> You can probably try something like
> 
> #ifndef __has_extension
> #define __has_extension(x) 0
> #endif

From bug 116352, it looks like we should use "__has_feature" instead of "__has_extension". So should we add #ifndef to the WKDeclarationSpecifiers.h or to use "__has_feature" which already is properly handled in Compiler.h ?
Comment 5 Anders Carlsson 2013-12-03 14:53:34 PST
(In reply to comment #4)
> (In reply to comment #3)
> > You can probably try something like
> > 
> > #ifndef __has_extension
> > #define __has_extension(x) 0
> > #endif
> 
> From bug 116352, it looks like we should use "__has_feature" instead of "__has_extension". So should we add #ifndef to the WKDeclarationSpecifiers.h or to use "__has_feature" which already is properly handled in Compiler.h ?

This is in the API headers so we can’t use ifdefs from Compiler.h
Comment 6 Nick Diego Yamane (diegoyam) 2013-12-03 15:04:29 PST
Created attachment 218349 [details]
Patch

Also adding fix after r160036
Comment 7 Nick Diego Yamane (diegoyam) 2013-12-03 15:28:45 PST
Created attachment 218354 [details]
Patch

Renaming APIClient to API::Client
Comment 8 Csaba Osztrogonác 2013-12-03 15:34:32 PST
*** Bug 125187 has been marked as a duplicate of this bug. ***
Comment 9 Csaba Osztrogonác 2013-12-03 15:38:49 PST
(In reply to comment #7)
> Created an attachment (id=218354) [details]
> Patch
> 
> Renaming APIClient to API::Client

EFL build is still broken with this patch, some error log:

/home/oszi/WebKit/Source/WebKit2/UIProcess/efl/WebUIPopupMenuClient.h:41:112: error: wrong number of template arguments (2, should be 1)
/home/oszi/WebKit/Source/WebKit2/Shared/APIClient.h:36:42: error: provided for 'template<class ClientInterface> class API::Client'
...
Comment 10 Csaba Osztrogonác 2013-12-03 15:40:54 PST
It seems you will need similar changes to http://trac.webkit.org/changeset/159988
Comment 11 Thiago de Barros Lacerda 2013-12-03 15:44:22 PST
Comment on attachment 218354 [details]
Patch

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

> Source/WebKit2/Shared/API/c/WKDeclarationSpecifiers.h:49
> +#ifndef __has_extension

Hey nick, maybe would be cleaner to do some workaround like I did in https://bugs.webkit.org/show_bug.cgi?id=125187, instead of adding some code that does nothing.
What do you think? Ossy?
Comment 12 Nick Diego Yamane (diegoyam) 2013-12-03 15:48:01 PST
(In reply to comment #9)
> (In reply to comment #7)
> > Created an attachment (id=218354) [details] [details]
> > Patch
> > 
> > Renaming APIClient to API::Client
> 
> EFL build is still broken with this patch, some error log:
> 
> /home/oszi/WebKit/Source/WebKit2/UIProcess/efl/WebUIPopupMenuClient.h:41:112: error: wrong number of template arguments (2, should be 1)
> /home/oszi/WebKit/Source/WebKit2/Shared/APIClient.h:36:42: error: provided for 'template<class ClientInterface> class API::Client'
> ...

Yeah, the changes needed are less trivial I thought initially. ClientTraits was reimplemented..
Comment 13 Nick Diego Yamane (diegoyam) 2013-12-03 15:48:28 PST
(In reply to comment #10)
> It seems you will need similar changes to http://trac.webkit.org/changeset/159988

Hmm, I'll take a look at it. thanks.
Comment 14 Nick Diego Yamane (diegoyam) 2013-12-03 15:49:59 PST
(In reply to comment #11)
> (From update of attachment 218354 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218354&action=review
> 
> > Source/WebKit2/Shared/API/c/WKDeclarationSpecifiers.h:49
> > +#ifndef __has_extension
> 
> Hey nick, maybe would be cleaner to do some workaround like I did in https://bugs.webkit.org/show_bug.cgi?id=125187, instead of adding some code that does nothing.
> What do you think? Ossy?

Hmm, good. But that's still not enough to solve the build issues :)
Comment 15 Nick Diego Yamane (diegoyam) 2013-12-03 15:59:33 PST
(In reply to comment #13)
> (In reply to comment #10)
> > It seems you will need similar changes to http://trac.webkit.org/changeset/159988
> 
> Hmm, I'll take a look at it. thanks.

Hey Ossy, you're right. We'll have to do similar things to that patch to get it working!

So we'll need lots of changes to get the following classes working according to the new API::Client implementation:

* WebBatteryProvider
* WebNetworkInfoProvider
* WebTextCheckerClient
* WebVibrationProvider
* efl/WebUIPopupMenuClient
* gtk/WebFullScreenClientGtk
* gtk/WebInspectorClientGtk
* soup/WebSoupRequestManagerClient
Comment 16 Thiago de Barros Lacerda 2013-12-03 16:09:17 PST
(In reply to comment #14)
> (In reply to comment #11)
> > (From update of attachment 218354 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=218354&action=review
> > 
> > > Source/WebKit2/Shared/API/c/WKDeclarationSpecifiers.h:49
> > > +#ifndef __has_extension
> > 
> > Hey nick, maybe would be cleaner to do some workaround like I did in https://bugs.webkit.org/show_bug.cgi?id=125187, instead of adding some code that does nothing.
> > What do you think? Ossy?
> 
> Hmm, good. But that's still not enough to solve the build issues :)

I know, it is just for that specific part of the code
Comment 17 Nick Diego Yamane (diegoyam) 2013-12-03 18:44:28 PST
Created attachment 218373 [details]
Patch

Moving to the new API::Client
Comment 18 WebKit Commit Bot 2013-12-03 18:46:54 PST
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 19 Nick Diego Yamane (diegoyam) 2013-12-03 18:58:52 PST
FYI, EFL will be addressed in bug 125206.
Comment 20 Nick Diego Yamane (diegoyam) 2013-12-03 19:11:44 PST
Comment on attachment 218373 [details]
Patch

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

> Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp:48
> +    WKViewSetFullScreenClientGtk(toAPI(WEBKIT_WEB_VIEW_BASE(webView)), reinterpret_cast<WKFullScreenClientGtkBase*>(&wkFullScreenClient));

I'm not sure if that's the right thing to do here :(

@andersca, could you help us on this?

> Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp:110
> +    WKTextCheckerSetClient(reinterpret_cast<WKTextCheckerClientBase*>(&wkTextCheckerClient));

ditto.

> Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp:332
> +    WKInspectorSetInspectorClientGtk(toAPI(webInspector), reinterpret_cast<WKInspectorClientGtkBase*>(&wkInspectorClientGtk));

ditto.
Comment 21 Csaba Osztrogonác 2013-12-04 00:37:43 PST
Comment on attachment 218373 [details]
Patch

The build is still broken with this patch :(
Comment 22 Csaba Osztrogonác 2013-12-04 00:42:12 PST
(In reply to comment #19)
> FYI, EFL will be addressed in bug 125206.

What happened? This bug was to fix EFL and GTK too originally.
Why do we have two separated bug report now? And there isn't
any patch with r? in the other bug report. :(
Comment 23 Gustavo Noronha (kov) 2013-12-04 02:56:27 PST
This seems to have been made obsolete by the patch on the other bug.

*** This bug has been marked as a duplicate of bug 125206 ***
Comment 24 Anders Carlsson 2013-12-04 10:28:40 PST
Comment on attachment 218373 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp:48
>> +    WKViewSetFullScreenClientGtk(toAPI(WEBKIT_WEB_VIEW_BASE(webView)), reinterpret_cast<WKFullScreenClientGtkBase*>(&wkFullScreenClient));
> 
> I'm not sure if that's the right thing to do here :(
> 
> @andersca, could you help us on this?

This should just be &wkFullScreenClient.base.

>> Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp:332
>> +    WKInspectorSetInspectorClientGtk(toAPI(webInspector), reinterpret_cast<WKInspectorClientGtkBase*>(&wkInspectorClientGtk));
> 
> ditto.

Same thing here.
Comment 25 Nick Diego Yamane (diegoyam) 2013-12-04 10:55:39 PST
(In reply to comment #24)
> (From update of attachment 218373 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=218373&action=review
> 
> >> Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp:48
> >> +    WKViewSetFullScreenClientGtk(toAPI(WEBKIT_WEB_VIEW_BASE(webView)), reinterpret_cast<WKFullScreenClientGtkBase*>(&wkFullScreenClient));
> > 
> > I'm not sure if that's the right thing to do here :(
> > 
> > @andersca, could you help us on this?
> 
> This should just be &wkFullScreenClient.base.
> 
> >> Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp:332
> >> +    WKInspectorSetInspectorClientGtk(toAPI(webInspector), reinterpret_cast<WKInspectorClientGtkBase*>(&wkInspectorClientGtk));
> > 
> > ditto.
> 
> Same thing here.

Ok, thanks.
It will be fixed in bug 125231.