Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK][WK2] Fix build after r160104
https://bugs.webkit.org/show_bug.cgi?id=125240

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-04
Reviewed by Anders Carlsson.

Using specific version of API client when instantiating them.
Applied that same change to the following files:

* UIProcess/API/gtk/WebKitContextMenuClient.cpp:
* UIProcess/API/gtk/WebKitCookieManager.cpp:
* UIProcess/API/gtk/WebKitDownloadClient.cpp:
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
* UIProcess/API/gtk/WebKitFindController.cpp:
* UIProcess/API/gtk/WebKitFormClient.cpp:
* UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
* UIProcess/API/gtk/WebKitLoaderClient.cpp:
* UIProcess/API/gtk/WebKitPolicyClient.cpp:
* UIProcess/API/gtk/WebKitUIClient.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:

Canonical link: https://commits.webkit.org/143351@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nick Diego Yamane authored and webkit-commit-queue committed Dec 4, 2013
1 parent a6e3df8 commit 4434d76
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 57 deletions.
24 changes: 24 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,27 @@
2013-12-04 Nick Diego Yamane <nick.yamane@openbossa.org>

[GTK][WK2] Fix build after r160104
https://bugs.webkit.org/show_bug.cgi?id=125240

Reviewed by Anders Carlsson.

Using specific version of API client when instantiating them.
Applied that same change to the following files:

* UIProcess/API/gtk/WebKitContextMenuClient.cpp:
* UIProcess/API/gtk/WebKitCookieManager.cpp:
* UIProcess/API/gtk/WebKitDownloadClient.cpp:
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
* UIProcess/API/gtk/WebKitFindController.cpp:
* UIProcess/API/gtk/WebKitFormClient.cpp:
* UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
* UIProcess/API/gtk/WebKitLoaderClient.cpp:
* UIProcess/API/gtk/WebKitPolicyClient.cpp:
* UIProcess/API/gtk/WebKitUIClient.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:

2013-12-04 Dan Bernstein <mitz@apple.com>

Fixed the 32-bit Mac build.
Expand Down
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp
Expand Up @@ -33,9 +33,11 @@ static void getContextMenuFromProposedMenu(WKPageRef, WKArrayRef proposedMenu, W

void attachContextMenuClientToView(WebKitWebView* webView)
{
WKPageContextMenuClient wkContextMenuClient = {
kWKPageContextMenuClientCurrentVersion,
webView, // clientInfo
WKPageContextMenuClientV3 wkContextMenuClient = {
{
3, // version
webView, // clientInfo
},
0, // getContextMenuFromProposedMenu_deprecatedForUseWithV0
0, // customContextMenuItemSelected
0, // contextMenuDismissed
Expand All @@ -44,6 +46,6 @@ void attachContextMenuClientToView(WebKitWebView* webView)
0, // hideContextMenu
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageContextMenuClient(wkPage, &wkContextMenuClient);
WKPageSetPageContextMenuClient(wkPage, &wkContextMenuClient.base);
}

10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp
Expand Up @@ -100,12 +100,14 @@ WebKitCookieManager* webkitCookieManagerCreate(WebCookieManagerProxy* webCookieM
WebKitCookieManager* manager = WEBKIT_COOKIE_MANAGER(g_object_new(WEBKIT_TYPE_COOKIE_MANAGER, NULL));
manager->priv->webCookieManager = webCookieManager;

WKCookieManagerClient wkCookieManagerClient = {
kWKCookieManagerClientCurrentVersion,
manager, // clientInfo
WKCookieManagerClientV0 wkCookieManagerClient = {
{
0, // version
manager, // clientInfo
},
cookiesDidChange
};
WKCookieManagerSetClient(toAPI(webCookieManager), &wkCookieManagerClient);
WKCookieManagerSetClient(toAPI(webCookieManager), &wkCookieManagerClient.base);
manager->priv->webCookieManager->startObservingCookieChanges();

return manager;
Expand Down
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp
Expand Up @@ -95,9 +95,11 @@ static void didFinish(WKContextRef wkContext, WKDownloadRef wkDownload, const vo

void attachDownloadClientToContext(WebKitWebContext* webContext)
{
WKContextDownloadClient wkDownloadClient = {
kWKContextDownloadClientCurrentVersion,
webContext, // ClientInfo
WKContextDownloadClientV0 wkDownloadClient = {
{
0, // version
webContext, // ClientInfo
},
didStart,
0, // didReceiveAuthenticationChallenge
didReceiveResponse,
Expand All @@ -110,6 +112,6 @@ void attachDownloadClientToContext(WebKitWebContext* webContext)
didCancel,
0, // processDidCrash
};
WKContextSetDownloadClient(toAPI(webkitWebContextGetContext(webContext)), &wkDownloadClient);
WKContextSetDownloadClient(toAPI(webkitWebContextGetContext(webContext)), &wkDownloadClient.base);
}

10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp
Expand Up @@ -214,14 +214,16 @@ WebKitFaviconDatabase* webkitFaviconDatabaseCreate(WebIconDatabase* iconDatabase
WebKitFaviconDatabase* faviconDatabase = WEBKIT_FAVICON_DATABASE(g_object_new(WEBKIT_TYPE_FAVICON_DATABASE, NULL));
faviconDatabase->priv->iconDatabase = iconDatabase;

WKIconDatabaseClient wkIconDatabaseClient = {
kWKIconDatabaseClientCurrentVersion,
faviconDatabase, // clientInfo
WKIconDatabaseClientV1 wkIconDatabaseClient = {
{
1, // version
faviconDatabase, // clientInfo
},
didChangeIconForPageURLCallback,
0, // didRemoveAllIconsCallback
iconDataReadyForPageURLCallback,
};
WKIconDatabaseSetIconDatabaseClient(toAPI(iconDatabase), &wkIconDatabaseClient);
WKIconDatabaseSetIconDatabaseClient(toAPI(iconDatabase), &wkIconDatabaseClient.base);
return faviconDatabase;
}

Expand Down
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp
Expand Up @@ -111,15 +111,17 @@ static inline WebPageProxy* getPage(WebKitFindController* findController)
static void webkitFindControllerConstructed(GObject* object)
{
WebKitFindController* findController = WEBKIT_FIND_CONTROLLER(object);
WKPageFindClient wkFindClient = {
kWKPageFindClientCurrentVersion,
findController, // clientInfo
WKPageFindClientV0 wkFindClient = {
{
0, // version
findController, // clientInfo
},
didFindString,
didFailToFindString,
didCountStringMatches
};

WKPageSetPageFindClient(toAPI(getPage(findController)), &wkFindClient);
WKPageSetPageFindClient(toAPI(getPage(findController)), &wkFindClient.base);
}

static void webkitFindControllerGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
Expand Down
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp
Expand Up @@ -36,11 +36,13 @@ static void willSubmitForm(WKPageRef page, WKFrameRef frame, WKFrameRef sourceFr

void attachFormClientToView(WebKitWebView* webView)
{
WKPageFormClient wkFormClient = {
kWKPageFormClientCurrentVersion,
webView, // clientInfo
WKPageFormClientV0 wkFormClient = {
{
0, // version
webView, // clientInfo
},
willSubmitForm
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageFormClient(wkPage, &wkFormClient);
WKPageSetPageFormClient(wkPage, &wkFormClient.base);
}
13 changes: 8 additions & 5 deletions Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp
Expand Up @@ -64,13 +64,16 @@ WebKitGeolocationProvider::WebKitGeolocationProvider(WebGeolocationManagerProxy*
{
ASSERT(geolocationManager);

WKGeolocationProvider wkGeolocationProvider = {
kWKGeolocationProviderCurrentVersion,
this, // clientInfo
WKGeolocationProviderV1 wkGeolocationProvider = {
{
1, // version
this, // clientInfo
},
startUpdatingCallback,
stopUpdatingCallback
stopUpdatingCallback,
0 // setEnableHighAccuracy
};
WKGeolocationManagerSetProvider(toAPI(geolocationManager), &wkGeolocationProvider);
WKGeolocationManagerSetProvider(toAPI(geolocationManager), &wkGeolocationProvider.base);
}

void WebKitGeolocationProvider::startUpdating()
Expand Down
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp
Expand Up @@ -120,12 +120,14 @@ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messag

void attachInjectedBundleClientToContext(WebKitWebContext* webContext)
{
WKContextInjectedBundleClient wkInjectedBundleClient = {
kWKContextInjectedBundleClientCurrentVersion,
webContext, // clientInfo
WKContextInjectedBundleClientV1 wkInjectedBundleClient = {
{
0, // version
webContext, // clientInfo
},
didReceiveMessageFromInjectedBundle,
0, // didReceiveSynchronousMessageFromInjectedBundle
0 // getInjectedBundleInitializationUserData
};
WKContextSetInjectedBundleClient(toAPI(webkitWebContextGetContext(webContext)), &wkInjectedBundleClient);
WKContextSetInjectedBundleClient(toAPI(webkitWebContextGetContext(webContext)), &wkInjectedBundleClient.base);
}
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
Expand Up @@ -140,9 +140,11 @@ static void processDidCrash(WKPageRef page, const void* clientInfo)

void attachLoaderClientToView(WebKitWebView* webView)
{
WKPageLoaderClient wkLoaderClient = {
kWKPageLoaderClientCurrentVersion,
webView, // clientInfo
WKPageLoaderClientV3 wkLoaderClient = {
{
3, // version
webView, // clientInfo
},
didStartProvisionalLoadForFrame,
didReceiveServerRedirectForProvisionalLoadForFrame,
didFailProvisionalLoadWithErrorForFrame,
Expand Down Expand Up @@ -181,6 +183,6 @@ void attachLoaderClientToView(WebKitWebView* webView)
0, // pluginLoadPolicy
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageLoaderClient(wkPage, &wkLoaderClient);
WKPageSetPageLoaderClient(wkPage, &wkLoaderClient.base);
}

10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp
Expand Up @@ -68,15 +68,17 @@ static void decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLRespo

void attachPolicyClientToView(WebKitWebView* webView)
{
WKPagePolicyClient policyClient = {
kWKPagePolicyClientCurrentVersion,
webView, // clientInfo
WKPagePolicyClientV1 policyClient = {
{
1, // version
webView, // clientInfo
},
0, // decidePolicyForNavigationAction_deprecatedForUseWithV0
decidePolicyForNewWindowAction,
0, // decidePolicyForResponse_deprecatedForUseWithV0
0, // unableToImplementPolicy
decidePolicyForNavigationAction,
decidePolicyForResponse
};
WKPageSetPagePolicyClient(toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView))), &policyClient);
WKPageSetPagePolicyClient(toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView))), &policyClient.base);
}
10 changes: 6 additions & 4 deletions Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp
Expand Up @@ -160,9 +160,11 @@ static void runModal(WKPageRef page, const void* clientInfo)

void attachUIClientToView(WebKitWebView* webView)
{
WKPageUIClient wkUIClient = {
kWKPageUIClientCurrentVersion,
webView, // clientInfo
WKPageUIClientV2 wkUIClient = {
{
2, // version
webView, // clientInfo
},
0, // createNewPage_deprecatedForUseWithV0
showPage,
closePage,
Expand Down Expand Up @@ -211,6 +213,6 @@ void attachUIClientToView(WebKitWebView* webView)
0, // pluginLoadPolicy
};
WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
WKPageSetPageUIClient(wkPage, &wkUIClient);
WKPageSetPageUIClient(wkPage, &wkUIClient.base);
}

Expand Up @@ -116,16 +116,18 @@ WebKitWebExtension* webkitWebExtensionCreate(InjectedBundle* bundle)
{
WebKitWebExtension* extension = WEBKIT_WEB_EXTENSION(g_object_new(WEBKIT_TYPE_WEB_EXTENSION, NULL));

WKBundleClient wkBundleClient = {
kWKBundleClientCurrentVersion,
extension, // clientInfo
WKBundleClientV1 wkBundleClient = {
{
1, // version
extension, // clientInfo
},
didCreatePage,
willDestroyPage,
0, // didInitializePageGroup
didReceiveMessage,
didReceiveMessageToPage
};
WKBundleSetClient(toAPI(bundle), &wkBundleClient);
WKBundleSetClient(toAPI(bundle), &wkBundleClient.base);

return extension;
}
Expand Down
20 changes: 12 additions & 8 deletions Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
Expand Up @@ -309,9 +309,11 @@ WebKitWebPage* webkitWebPageCreate(WebPage* webPage)
WebKitWebPage* page = WEBKIT_WEB_PAGE(g_object_new(WEBKIT_TYPE_WEB_PAGE, NULL));
page->priv->webPage = webPage;

WKBundlePageLoaderClient loaderClient = {
kWKBundlePageLoaderClientCurrentVersion,
page,
WKBundlePageLoaderClientV7 loaderClient = {
{
7, // version
page, // clientInfo
},
didStartProvisionalLoadForFrame,
didReceiveServerRedirectForProvisionalLoadForFrame,
0, // didFailProvisionalLoadWithErrorForFrame
Expand Down Expand Up @@ -348,11 +350,13 @@ WebKitWebPage* webkitWebPageCreate(WebPage* webPage)
0, // willLoadDataRequest
willDestroyFrame
};
WKBundlePageSetPageLoaderClient(toAPI(webPage), &loaderClient);
WKBundlePageSetPageLoaderClient(toAPI(webPage), &loaderClient.base);

WKBundlePageResourceLoadClient resourceLoadClient = {
kWKBundlePageResourceLoadClientCurrentVersion,
page,
WKBundlePageResourceLoadClientV1 resourceLoadClient = {
{
1, // version
page, // clientInfo
},
didInitiateLoadForResource,
willSendRequestForFrame,
didReceiveResponseForResource,
Expand All @@ -362,7 +366,7 @@ WebKitWebPage* webkitWebPageCreate(WebPage* webPage)
0, // shouldCacheResponse
0 // shouldUseCredentialStorage
};
WKBundlePageSetResourceLoadClient(toAPI(webPage), &resourceLoadClient);
WKBundlePageSetResourceLoadClient(toAPI(webPage), &resourceLoadClient.base);

return page;
}
Expand Down

0 comments on commit 4434d76

Please sign in to comment.