Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[EFL] Do not pass context to EwkViewCreate
https://bugs.webkit.org/show_bug.cgi?id=156461

Reviewed by Darin Adler.

Source/WebKit2:

EWKViewCreate already has pageConfiguration which contains context.
So, this patch removes context argument from EWKViewCreate.

* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/CoordinatedGraphics/WKView.h:
* UIProcess/API/efl/ewk_view.cpp:
(EWKViewCreate): Call WebView::Create instead of WKViewCreate not to use WK API.
(ewk_view_smart_add):
(ewk_view_add_with_configuration):
(ewk_view_add_with_context):
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::create):
(WebKit::WebView::WebView):
* UIProcess/efl/WebView.h:

Tools:

* TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp:
(TestWebKitAPI::TEST): Removed context argument from EwkViewCreate calls.
* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView): Ditto.
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView): Ditto.


Canonical link: https://commits.webkit.org/174590@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Ryuan Choi committed Apr 12, 2016
1 parent dde3247 commit 6c41e48
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 22 deletions.
26 changes: 26 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,29 @@
2016-04-11 Ryuan Choi <ryuan.choi@navercorp.com>

[EFL] Do not pass context to EwkViewCreate
https://bugs.webkit.org/show_bug.cgi?id=156461

Reviewed by Darin Adler.

EWKViewCreate already has pageConfiguration which contains context.
So, this patch removes context argument from EWKViewCreate.

* UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/CoordinatedGraphics/WKView.h:
* UIProcess/API/efl/ewk_view.cpp:
(EWKViewCreate): Call WebView::Create instead of WKViewCreate not to use WK API.
(ewk_view_smart_add):
(ewk_view_add_with_configuration):
(ewk_view_add_with_context):
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::create):
(WebKit::WebView::WebView):
* UIProcess/efl/WebView.h:

2016-04-11 Darin Adler <darin@apple.com>

Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/API/C/CoordinatedGraphics/WKView.cpp
Expand Up @@ -30,9 +30,9 @@
using namespace WebCore;
using namespace WebKit;

WKViewRef WKViewCreate(WKContextRef context, WKPageConfigurationRef pageConfiguration)
WKViewRef WKViewCreate(WKPageConfigurationRef pageConfiguration)
{
RefPtr<WebView> webView = WebView::create(toImpl(context), *toImpl(pageConfiguration));
RefPtr<WebView> webView = WebView::create(*toImpl(pageConfiguration));
return toAPI(webView.release().leakRef());
}

Expand Down
Expand Up @@ -64,7 +64,7 @@ typedef struct WKViewClientV0 {
WKViewDoneWithTouchEventCallback doneWithTouchEvent;
} WKViewClientV0;

WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageConfigurationRef pageConfiguration);
WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef pageConfiguration);

WK_EXPORT WKSize WKViewGetSize(WKViewRef);
WK_EXPORT void WKViewSetSize(WKViewRef, WKSize size);
Expand Down
15 changes: 8 additions & 7 deletions Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Expand Up @@ -20,15 +20,16 @@

#include "config.h"
#include "ewk_view.h"
#include "ewk_view_private.h"

#include "APIPageConfiguration.h"
#include "EwkView.h"
#include "WebInspectorProxy.h"
#include "ewk_back_forward_list_private.h"
#include "ewk_context_private.h"
#include "ewk_main_private.h"
#include "ewk_page_group_private.h"
#include "ewk_view_configuration_private.h"
#include "ewk_view_private.h"
#include <JavaScriptCore/JSRetainPtr.h>
#include <WebKit/WKAPICast.h>
#include <WebKit/WKData.h>
Expand Down Expand Up @@ -78,15 +79,15 @@ Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
return EwkView::initSmartClassInterface(*api);
}

Evas_Object* EWKViewCreate(WKContextRef context, WKPageConfigurationRef pageConfiguration, Evas* canvas, Evas_Smart* smart)
Evas_Object* EWKViewCreate(WKPageConfigurationRef pageConfiguration, Evas* canvas, Evas_Smart* smart)
{
if (!EwkMain::singleton().isInitialized()) {
EINA_LOG_CRIT("EWebKit has not been initialized. You must call ewk_init() before creating view.");
return nullptr;
}

WKRetainPtr<WKViewRef> wkView = adoptWK(WKViewCreate(context, pageConfiguration));
if (EwkView* ewkView = EwkView::create(toImpl(wkView.get()), canvas, smart))
RefPtr<WebView> webView = WebView::create(*toImpl(pageConfiguration));
if (EwkView* ewkView = EwkView::create(webView.get(), canvas, smart))
return ewkView->evasObject();

return nullptr;
Expand All @@ -113,7 +114,7 @@ Evas_Object* ewk_view_smart_add(Evas* canvas, Evas_Smart* smart, Ewk_Context* co
WKPageConfigurationSetContext(pageConfiguration.get(), ewkContext->wkContext());
WKPageConfigurationSetPageGroup(pageConfiguration.get(), ewkPageGroup->wkPageGroup());

return EWKViewCreate(ewkContext->wkContext(), pageConfiguration.get(), canvas, smart);
return EWKViewCreate(pageConfiguration.get(), canvas, smart);
}

Evas_Object* ewk_view_add_with_configuration(Evas* canvas, Evas_Smart* smart, Ewk_View_Configuration* configuration)
Expand All @@ -130,7 +131,7 @@ Evas_Object* ewk_view_add_with_configuration(Evas* canvas, Evas_Smart* smart, Ew
WKPageConfigurationSetContext(ewkViewConfiguration->wkPageConfiguration(), context);
}

return EWKViewCreate(context, ewkViewConfiguration->wkPageConfiguration(), canvas, smart);
return EWKViewCreate(ewkViewConfiguration->wkPageConfiguration(), canvas, smart);
}

Evas_Object* ewk_view_add(Evas* canvas)
Expand All @@ -147,7 +148,7 @@ Evas_Object* ewk_view_add_with_context(Evas* canvas, Ewk_Context* context)
WKRetainPtr<WKPageConfigurationRef> pageConfiguration = adoptWK(WKPageConfigurationCreate());
WKPageConfigurationSetContext(pageConfiguration.get(), ewkContext->wkContext());

return EWKViewCreate(ewkContext->wkContext(), pageConfiguration.get(), canvas, 0);
return EWKViewCreate(pageConfiguration.get(), canvas, 0);
}

void ewk_view_try_close(Evas_Object* ewkView)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/API/efl/ewk_view_private.h
Expand Up @@ -33,7 +33,7 @@
extern "C" {
#endif

EAPI Evas_Object* EWKViewCreate(WKContextRef, WKPageConfigurationRef, Evas*, Evas_Smart*);
EAPI Evas_Object* EWKViewCreate(WKPageConfigurationRef, Evas*, Evas_Smart*);
EAPI WKViewRef EWKViewGetWKView(Evas_Object*);

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
Expand Up @@ -114,7 +114,7 @@ WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
WKPageConfigurationSetContext(wkPageConfiguration.get(), wkContext);
WKPageConfigurationSetPageGroup(wkPageConfiguration.get(), wkPageGroup);

m_inspectorView = EWKViewCreate(wkContext, wkPageConfiguration.get(), ecore_evas_get(m_inspectorWindow), /* smart */ 0);
m_inspectorView = EWKViewCreate(wkPageConfiguration.get(), ecore_evas_get(m_inspectorWindow), /* smart */ 0);
WKViewRef wkView = EWKViewGetWKView(m_inspectorView);

WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(DEFAULT_THEME_DIR "/default.edj"));
Expand Down
8 changes: 4 additions & 4 deletions Source/WebKit2/UIProcess/efl/WebView.cpp
Expand Up @@ -64,20 +64,20 @@ using namespace WebCore;

namespace WebKit {

Ref<WebView> WebView::create(WebProcessPool* processPool, API::PageConfiguration& pageConfiuration)
Ref<WebView> WebView::create(API::PageConfiguration& pageConfiuration)
{
return adoptRef(*new WebView(processPool, pageConfiuration));
return adoptRef(*new WebView(pageConfiuration));
}

WebView::WebView(WebProcessPool* context, API::PageConfiguration& pageConfiguration)
WebView::WebView(API::PageConfiguration& pageConfiguration)
: m_ewkView(0)
, m_focused(false)
, m_visible(false)
, m_hasRequestedFullScreen(false)
, m_opacity(1.0)
{
// Need to call createWebPage after other data members, specifically m_visible, are initialized.
m_page = context->createWebPage(*this, pageConfiguration.copy());
m_page = pageConfiguration.processPool()->createWebPage(*this, pageConfiguration.copy());
m_page->initializeWebPage();

m_page->pageGroup().preferences().setAcceleratedCompositingEnabled(true);
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/efl/WebView.h
Expand Up @@ -62,7 +62,7 @@ class WebView : public API::ObjectImpl<API::Object::Type::View>, public PageClie
public:
virtual ~WebView();

static Ref<WebView> create(WebProcessPool*, API::PageConfiguration&);
static Ref<WebView> create(API::PageConfiguration&);

void setSize(const WebCore::IntSize&);
const WebCore::IntSize& size() const { return m_size; }
Expand Down Expand Up @@ -144,7 +144,7 @@ class WebView : public API::ObjectImpl<API::Object::Type::View>, public PageClie
WebCore::Color viewBackgroundColor();

private:
WebView(WebProcessPool*, API::PageConfiguration&);
WebView(API::PageConfiguration&);

CoordinatedGraphicsScene* coordinatedGraphicsScene();

Expand Down
14 changes: 14 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,17 @@
2016-04-11 Ryuan Choi <ryuan.choi@navercorp.com>

[EFL] Do not pass context to EwkViewCreate
https://bugs.webkit.org/show_bug.cgi?id=156461

Reviewed by Darin Adler.

* TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp:
(TestWebKitAPI::TEST): Removed context argument from EwkViewCreate calls.
* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView): Ditto.
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView): Ditto.

2016-04-11 Fujii Hironori <Hironori.Fujii@jp.sony.com>

[CMake] Make FOLDER property INHERITED
Expand Down
Expand Up @@ -41,7 +41,7 @@ TEST(WebKit2, DISABLED_WKViewUserViewportToContents)
WKRetainPtr<WKPageConfigurationRef> configuration(AdoptWK, WKPageConfigurationCreate());
WKPageConfigurationSetContext(configuration.get(), context.get());

WKRetainPtr<WKViewRef> webView(AdoptWK, WKViewCreate(context.get(), configuration.get()));
WKRetainPtr<WKViewRef> webView(AdoptWK, WKViewCreate(configuration.get()));

WKViewSetIsActive(webView.get(), true);
WKPageSetUseFixedLayout(WKViewGetPage(webView.get()), false);
Expand Down
3 changes: 2 additions & 1 deletion Tools/TestWebKitAPI/efl/PlatformWebView.cpp
Expand Up @@ -31,6 +31,7 @@
#include "PlatformWebView.h"
#include "EWebKit2.h"
#include <WebKit/WKAPICast.h>
#include <WebKit/WKPageConfigurationRef.h>
#include <WebKit/WKRetainPtr.h>
#include <WebKit/WKViewEfl.h>
#include <Ecore_Evas.h>
Expand Down Expand Up @@ -72,7 +73,7 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
WKPageConfigurationSetContext(pageConfiguration.get(), contextRef);
WKPageConfigurationSetPageGroup(pageConfiguration.get(), pageGroupRef);

m_view = EWKViewCreate(contextRef, pageConfiguration.get(), ecore_evas_get(m_window), /* smart */ 0);
m_view = EWKViewCreate(pageConfiguration.get(), ecore_evas_get(m_window), /* smart */ 0);

WKRetainPtr<WKStringRef> wkTheme = adoptWK(WKStringCreateWithUTF8CString(DEFAULT_THEME_DIR "/default.edj"));
WKViewSetThemePath(EWKViewGetWKView(m_view), wkTheme.get());
Expand Down
3 changes: 1 addition & 2 deletions Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
Expand Up @@ -61,8 +61,7 @@ PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const Tes

m_window = initEcoreEvas();

WKContextRef context = WKPageConfigurationGetContext(configuration);
m_view = EWKViewCreate(context, configuration, ecore_evas_get(m_window), /* smart */ 0);
m_view = EWKViewCreate(configuration, ecore_evas_get(m_window), /* smart */ 0);

WKPageSetUseFixedLayout(WKViewGetPage(EWKViewGetWKView(m_view)), m_usingFixedLayout);

Expand Down

0 comments on commit 6c41e48

Please sign in to comment.