Changeset 129863 in webkit


Ignore:
Timestamp:
Sep 28, 2012 1:56:55 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Refactoring initialization and shutdown codes of EFL libraries.
https://bugs.webkit.org/show_bug.cgi?id=97173

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2012-09-28
Reviewed by Gyuyoung Kim.

Source/WebCore:

Remove codes to initialize and shutdown the EFL libraries from
RunLoopEfl.cpp. Initialization and shutdown will be done in the
ewk_main.cpp for ui process and WebProcessMainEfl.cpp for web
process.

No new tests. This patch doesn't change behavior.

  • platform/efl/RunLoopEfl.cpp:

(WebCore::RunLoop::RunLoop):
(WebCore::RunLoop::~RunLoop):

Source/WebKit2:

Initialize and shutdown the EFL libraries in the ewk_main.cpp for ui
process and WebProcessMainEfl.cpp for web process.
Additionally, initialization and shutdown are done when ewk_context is
created and deleted, so ewk_{init,shutdown} APIs are changed to
internal function and applications don't have to call them.

  • PlatformEfl.cmake:
  • UIProcess/API/efl/EWebKit2.h:
  • UIProcess/API/efl/ewk_context.cpp:

(_Ewk_Context::_Ewk_Context):
(_Ewk_Context::~_Ewk_Context):

  • UIProcess/API/efl/ewk_main.cpp:

(ewk_init):
(ewk_shutdown):

  • UIProcess/API/efl/ewk_main.h: Removed.
  • UIProcess/API/efl/ewk_main_private.h: Added.
  • UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:

(EWK2UnitTest::EWK2UnitTestBase::SetUp):
(EWK2UnitTest::EWK2UnitTestBase::TearDown):

  • WebProcess/efl/WebProcessMainEfl.cpp:

(WebKit::WebProcessMainEfl):

Tools:

The initialization and shutdown are done inside the webkit, so we don't
have to call them out of the webkit.

  • MiniBrowser/efl/main.c:

(quit):
(main):

  • WebKitTestRunner/efl/PlatformWebViewEfl.cpp:

(WTR::initEcoreEvas):
(WTR::PlatformWebView::~PlatformWebView):

  • WebKitTestRunner/efl/main.cpp:

(main):

Location:
trunk
Files:
1 added
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r129862 r129863  
     12012-09-28  Eunmi Lee  <eunmi15.lee@samsung.com>
     2
     3        [EFL][WK2] Refactoring initialization and shutdown codes of EFL libraries.
     4        https://bugs.webkit.org/show_bug.cgi?id=97173
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Remove codes to initialize and shutdown the EFL libraries from
     9        RunLoopEfl.cpp. Initialization and shutdown will be done in the
     10        ewk_main.cpp for ui process and WebProcessMainEfl.cpp for web
     11        process.
     12
     13        No new tests. This patch doesn't change behavior.
     14
     15        * platform/efl/RunLoopEfl.cpp:
     16        (WebCore::RunLoop::RunLoop):
     17        (WebCore::RunLoop::~RunLoop):
     18
    1192012-09-19  Vsevolod Vlasov  <vsevik@chromium.org>
    220
  • trunk/Source/WebCore/platform/efl/RunLoopEfl.cpp

    r112353 r129863  
    2929
    3030#include <Ecore.h>
    31 #include <Ecore_Evas.h>
    32 #include <Ecore_File.h>
    33 #include <Edje.h>
    3431#include <wtf/OwnPtr.h>
    3532#include <wtf/PassOwnPtr.h>
     
    4340    : m_initEfl(false)
    4441{
    45     if (!ecore_init()) {
    46         LOG_ERROR("could not init ecore.");
    47         return;
    48     }
    49 
    50     if (!ecore_evas_init()) {
    51         LOG_ERROR("could not init ecore_evas.");
    52         goto errorEcoreEvas;
    53     }
    54 
    55     if (!ecore_file_init()) {
    56         LOG_ERROR("could not init ecore_file.");
    57         goto errorEcoreFile;
    58     }
    59 
    60     if (!edje_init()) {
    61         LOG_ERROR("could not init edje.");
    62         goto errorEdje;
    63     }
    64 
    6542    m_pipe = adoptPtr(ecore_pipe_add(wakeUpEvent, this));
    6643    m_initEfl = true;
    67 
    68     return;
    69 
    70 errorEdje:
    71     ecore_file_shutdown();
    72 errorEcoreFile:
    73     ecore_evas_shutdown();
    74 errorEcoreEvas:
    75     ecore_shutdown();
    7644}
    7745
    7846RunLoop::~RunLoop()
    7947{
    80     if (m_initEfl) {
    81         edje_shutdown();
    82         ecore_file_shutdown();
    83         ecore_evas_shutdown();
    84         ecore_shutdown();
    85     }
    8648}
    8749
  • trunk/Source/WebKit2/ChangeLog

    r129810 r129863  
     12012-09-28  Eunmi Lee  <eunmi15.lee@samsung.com>
     2
     3        [EFL][WK2] Refactoring initialization and shutdown codes of EFL libraries.
     4        https://bugs.webkit.org/show_bug.cgi?id=97173
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Initialize and shutdown the EFL libraries in the ewk_main.cpp for ui
     9        process and WebProcessMainEfl.cpp for web process.
     10        Additionally, initialization and shutdown are done when ewk_context is
     11        created and deleted, so ewk_{init,shutdown} APIs are changed to
     12        internal function and applications don't have to call them.
     13
     14        * PlatformEfl.cmake:
     15        * UIProcess/API/efl/EWebKit2.h:
     16        * UIProcess/API/efl/ewk_context.cpp:
     17        (_Ewk_Context::_Ewk_Context):
     18        (_Ewk_Context::~_Ewk_Context):
     19        * UIProcess/API/efl/ewk_main.cpp:
     20        (ewk_init):
     21        (ewk_shutdown):
     22        * UIProcess/API/efl/ewk_main.h: Removed.
     23        * UIProcess/API/efl/ewk_main_private.h: Added.
     24        * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
     25        (EWK2UnitTest::EWK2UnitTestBase::SetUp):
     26        (EWK2UnitTest::EWK2UnitTestBase::TearDown):
     27        * WebProcess/efl/WebProcessMainEfl.cpp:
     28        (WebKit::WebProcessMainEfl):
     29
    1302012-09-27  Beth Dakin  <bdakin@apple.com>
    231
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r129451 r129863  
    221221    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_intent.h"
    222222    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_intent_service.h"
    223     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_main.h"
    224223    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_navigation_policy_decision.h"
    225224    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h"
  • trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h

    r129196 r129863  
    3737#include "ewk_intent.h"
    3838#include "ewk_intent_service.h"
    39 #include "ewk_main.h"
    4039#include "ewk_navigation_policy_decision.h"
    4140#include "ewk_popup_menu_item.h"
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp

    r129134 r129863  
    3636#include "ewk_download_job.h"
    3737#include "ewk_download_job_private.h"
     38#include "ewk_main_private.h"
    3839#include <WebCore/FileSystem.h>
    3940#include <wtf/HashMap.h>
     
    8283        , requestManager(WKContextGetSoupRequestManager(contextRef.get()))
    8384    {
     85        ewk_init();
     86
    8487#if ENABLE(BATTERY_STATUS)
    8588        WKBatteryManagerRef wkBatteryManager = WKContextGetBatteryManager(contextRef.get());
     
    115118        for ( ; it != end; ++it)
    116119            ewk_download_job_unref(it->second);
     120
     121        ewk_shutdown();
    117122    }
    118123};
  • trunk/Source/WebKit2/UIProcess/API/efl/ewk_main.cpp

    r129101 r129863  
    2121
    2222#include "config.h"
    23 #include "ewk_main.h"
    2423
    2524#include "ewk_private.h"
     
    4039int _ewk_log_dom = -1;
    4140
     41/**
     42 * @internal
     43 * Initializes WebKit's instance.
     44 * - initializes components needed by EFL,
     45 * - increases a reference count of WebKit's instance.
     46 * Returns a reference count of WebKit's instance on success or 0 on failure
     47 */
    4248int ewk_init(void)
    4349{
     
    6975    }
    7076
     77    if (!edje_init()) {
     78        CRITICAL("could not init edje.");
     79        goto error_edje;
     80    }
     81
    7182    g_type_init();
    7283
     
    7889    return ++_ewkInitCount;
    7990
     91error_edje:
     92    ecore_evas_shutdown();
    8093error_ecore_evas:
    8194    ecore_shutdown();
     
    91104}
    92105
     106/**
     107 * @internal
     108 * Decreases a reference count of WebKit's instance, possibly destroying it.
     109 * If the reference count reaches 0, WebKit's instance is destroyed.
     110 * Returns a reference count of WebKit's instance
     111 */
    93112int ewk_shutdown(void)
    94113{
     
    96115        return _ewkInitCount;
    97116
     117    edje_shutdown();
    98118    ecore_evas_shutdown();
    99119    ecore_shutdown();
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp

    r129765 r129863  
    4646void EWK2UnitTestBase::SetUp()
    4747{
    48     ewk_init();
     48    ASSERT_GT(ecore_evas_init(), 0);
    4949
    5050    unsigned int width = environment->defaultWidth();
     
    7272    evas_object_del(m_webView);
    7373    ecore_evas_free(m_ecoreEvas);
    74     ewk_shutdown();
     74    ecore_evas_shutdown();
    7575}
    7676
  • trunk/Source/WebKit2/WebProcess/efl/WebProcessMainEfl.cpp

    r129541 r129863  
    3232#include "WKBase.h"
    3333#include <Ecore.h>
     34#include <Ecore_Evas.h>
     35#include <Edje.h>
    3436#include <Efreet.h>
    3537#include <WebCore/ResourceHandle.h>
     
    6163    if (!ecore_init()) {
    6264        // Could not init ecore.
     65        eina_shutdown();
     66        return 1;
     67    }
     68
     69    if (!ecore_evas_init()) {
     70        ecore_shutdown();
     71        eina_shutdown();
     72        return 1;
     73    }
     74
     75    if (!edje_init()) {
     76        ecore_evas_shutdown();
     77        ecore_shutdown();
    6378        eina_shutdown();
    6479        return 1;
     
    106121    g_object_unref(soupCache);
    107122
     123    edje_shutdown();
     124    ecore_evas_shutdown();
     125    ecore_shutdown();
     126    eina_shutdown();
     127
    108128    return 0;
    109129
  • trunk/Tools/ChangeLog

    r129826 r129863  
     12012-09-28  Eunmi Lee  <eunmi15.lee@samsung.com>
     2
     3        [EFL][WK2] Refactoring initialization and shutdown codes of EFL libraries.
     4        https://bugs.webkit.org/show_bug.cgi?id=97173
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        The initialization and shutdown are done inside the webkit, so we don't
     9        have to call them out of the webkit.
     10
     11        * MiniBrowser/efl/main.c:
     12        (quit):
     13        (main):
     14        * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
     15        (WTR::initEcoreEvas):
     16        (WTR::PlatformWebView::~PlatformWebView):
     17        * WebKitTestRunner/efl/main.cpp:
     18        (main):
     19
    1202012-09-27  Alexandre Elias  <aelias@chromium.org>
    221
  • trunk/Tools/MiniBrowser/efl/main.c

    r128876 r129863  
    201201quit(Eina_Bool success, const char *msg)
    202202{
    203     ewk_shutdown();
     203    ecore_evas_shutdown();
    204204
    205205    if (msg)
     
    269269    };
    270270
    271     if (!ewk_init())
     271    if (!ecore_evas_init())
    272272        return EXIT_FAILURE;
    273273
  • trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp

    r127793 r129863  
    3333static Ecore_Evas* initEcoreEvas()
    3434{
     35    if (!ecore_evas_init())
     36        return 0;
     37
    3538    Ecore_Evas* ecoreEvas = useX11Window ? ecore_evas_new(0, 0, 0, 800, 600, 0) : ecore_evas_buffer_new(800, 600);
    3639    if (!ecoreEvas)
     
    5861    evas_object_del(m_view);
    5962    ecore_evas_free(m_window);
     63    ecore_evas_shutdown();
    6064}
    6165
  • trunk/Tools/WebKitTestRunner/efl/main.cpp

    r124445 r129863  
    3333    WTFInstallReportBacktraceOnCrashHook();
    3434
    35     if (!ewk_init())
    36         return 1;
    37 
    3835#ifdef HAVE_ECORE_X
    3936    const char* display = getenv("DISPLAY");
    40     int intialized = 0;
     37    int initialized = 0;
    4138    if (display) {
    42         intialized = ecore_x_init(0);
    43         if (!intialized) {
    44             ewk_shutdown();
     39        initialized = ecore_x_init(0);
     40        if (!initialized)
    4541            return 1;
    46         }
    4742    }
    4843#endif
     
    5247
    5348#ifdef HAVE_ECORE_X
    54     if (intialized)
     49    if (initialized)
    5550        ecore_x_shutdown();
    5651#endif
    57 
    58     ewk_shutdown();
    5952
    6053    return 0;
Note: See TracChangeset for help on using the changeset viewer.