[EFL] Prevent the client from creating ewk_view when EWebkit is not initialized
authorg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 07:42:54 +0000 (07:42 +0000)
committerg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Aug 2014 07:42:54 +0000 (07:42 +0000)
commiteb40a1986c6a89542a107207a798f199de3d164b
tree580e5bd5afcb311e592f29b4629ddacc2998b9c3
parent9c3fcf789739a38d72ddd40234ebb67f37b67130
[EFL] Prevent the client from creating ewk_view when EWebkit is not initialized
https://bugs.webkit.org/show_bug.cgi?id=135606

Reviewed by Gyuyoung Kim.

Source/WebKit2:

Similarly to EFL modules (eina, evas etc.), application using EWebKit
has to initialize it using ewk_init().

Do not allow the client to create ewk_view if ewk_init has not been called.
Add an appropriate logs warning the client about wrong APIs usage.

* UIProcess/API/efl/ewk_main.cpp: Add EwkMain class to control ewk lifetime.
(WebKit::EwkMain::EwkMain):
(WebKit::EwkMain::shared):
(WebKit::EwkMain::~EwkMain): Add logs when the client forgot to destroy EWebkit.
(WebKit::EwkMain::initialize):
(WebKit::EwkMain::finalize):
(WebKit::EwkMain::shutdownInitializedEFLModules):
(ewk_init):
(ewk_shutdown):
* UIProcess/API/efl/ewk_main_private.h: Added.
(WebKit::EwkMain::isInitialized):
(WebKit::EwkMain::logDomainId):
* UIProcess/API/efl/ewk_private.h:
* UIProcess/API/efl/ewk_view.cpp:
(EWKViewCreate):
Prevent the client from creating ewk_view when ewk_init() has not been called.

Tools:

TestWebKitAPI does not initialize EWebkit using ewk_init()
which is not recommended.

* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::createEcoreEvas):
Renamed from initEcoreEvas() since it doesn't not initialize
ecore evas.

(TestWebKitAPI::PlatformWebView::PlatformWebView):
Call ewk_init() that initalizes all EFL modules needed by EWebKit
instead of ecore_evas_init() only.

(TestWebKitAPI::PlatformWebView::~PlatformWebView):
Call ewk_shutdown() to finalize EWebkit.
(TestWebKitAPI::initEcoreEvas): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/efl/ewk_main.cpp
Source/WebKit2/UIProcess/API/efl/ewk_main_private.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/efl/ewk_private.h
Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/efl/PlatformWebView.cpp