[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