[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:21:51 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit fe7e9fdf2d13383aff7b6413e3ad2a210da74270
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Mar 13 18:17:04 2010 +0000

    2010-03-13  Leandro Pereira  <leandro at profusion.mobi>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Add EFL port files to efl/ewk.
            http://webkit.org/b/35928
    
            * efl/ewk/ewk_main.cpp: Added.
            * efl/ewk/ewk_main.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index e51a505..1593404 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -3,6 +3,16 @@
         Reviewed by Kenneth Rohde Christiansen.
 
         Add EFL port files to efl/ewk.
+        http://webkit.org/b/35928
+
+        * efl/ewk/ewk_main.cpp: Added.
+        * efl/ewk/ewk_main.h: Added.
+
+2010-03-13  Leandro Pereira  <leandro at profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Add EFL port files to efl/ewk.
         http://webkit.org/b/35924
 
         * efl/ewk/ewk_frame.cpp: Added.
diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp
new file mode 100644
index 0000000..2c69b36
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_main.cpp
@@ -0,0 +1,152 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "ewk_main.h"
+
+#include "EWebKit.h"
+#include "Logging.h"
+#include "PageCache.h"
+#include "PageGroup.h"
+#include "ewk_private.h"
+#include "runtime/InitializeThreading.h"
+
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Edje.h>
+#include <Eina.h>
+#include <Evas.h>
+
+#ifdef ENABLE_GLIB_SUPPORT
+#include <glib-object.h>
+#include <glib.h>
+
+#ifdef ENABLE_GTK_PLUGINS_SUPPORT
+#include <gtk/gtk.h>
+#endif
+
+#endif
+
+// REMOVE-ME: see todo below
+#include "ResourceHandle.h"
+#include <libsoup/soup.h>
+
+static int _ewk_init_count = 0;
+int _ewk_log_dom = -1;
+
+int ewk_init(void)
+{
+    if (_ewk_init_count)
+        return ++_ewk_init_count;
+
+    if (!eina_init())
+        goto error_eina;
+
+    _ewk_log_dom = eina_log_domain_register("ewebkit", EINA_COLOR_ORANGE);
+    if (_ewk_log_dom < 0) {
+        EINA_LOG_CRIT("could not register log domain 'ewebkit'");
+        goto error_log_domain;
+    }
+
+    if (!evas_init()) {
+        CRITICAL("could not init evas.");
+        goto error_evas;
+    }
+
+    if (!ecore_init()) {
+        CRITICAL("could not init ecore.");
+        goto error_ecore;
+    }
+
+    if (!ecore_evas_init()) {
+        CRITICAL("could not init ecore_evas.");
+        goto error_ecore_evas;
+    }
+
+    if (!edje_init()) {
+        CRITICAL("could not init edje.");
+        goto error_edje;
+    }
+
+#ifdef ENABLE_GLIB_SUPPORT
+    g_type_init();
+
+    if (!g_thread_supported())
+        g_thread_init(0);
+
+#ifdef ENABLE_GTK_PLUGINS_SUPPORT
+    gdk_threads_init();
+    if (!gtk_init_check(0, 0))
+        WRN("Could not initialize GTK support.");
+#endif
+
+    if (!ecore_main_loop_glib_integrate())
+        WRN("Ecore was not compiled with GLib support, some plugins will not "
+            "work (ie: Adobe Flash)");
+#endif
+
+    JSC::initializeThreading();
+    WebCore::InitializeLoggingChannelsIfNecessary();
+
+    // Page cache capacity (in pages). Comment from Mac port:
+    // (Research indicates that value / page drops substantially after 3 pages.)
+    // FIXME: Expose this with an API and/or calculate based on available resources
+    WebCore::pageCache()->setCapacity(3);
+    WebCore::PageGroup::setShouldTrackVisitedLinks(true);
+
+    // TODO: this should move to WebCore, already reported to webkit-gtk folks:
+    if (1) {
+        SoupSession* session = WebCore::ResourceHandle::defaultSession();
+        soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_SNIFFER);
+    }
+
+    return ++_ewk_init_count;
+
+error_edje:
+    ecore_evas_shutdown();
+error_ecore_evas:
+    ecore_shutdown();
+error_ecore:
+    evas_shutdown();
+error_evas:
+    eina_log_domain_unregister(_ewk_log_dom);
+    _ewk_log_dom = -1;
+error_log_domain:
+    eina_shutdown();
+error_eina:
+    return 0;
+}
+
+int ewk_shutdown(void)
+{
+    _ewk_init_count--;
+    if (_ewk_init_count)
+        return _ewk_init_count;
+
+    ecore_evas_shutdown();
+    ecore_shutdown();
+    evas_shutdown();
+    eina_log_domain_unregister(_ewk_log_dom);
+    _ewk_log_dom = -1;
+    eina_shutdown();
+
+    return 0;
+}
+
diff --git a/WebKit/efl/ewk/ewk_main.h b/WebKit/efl/ewk/ewk_main.h
new file mode 100644
index 0000000..3730e88
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_main.h
@@ -0,0 +1,36 @@
+/*
+    Copyright (C) 2009-2010 ProFUSION embedded systems
+    Copyright (C) 2009-2010 Samsung Electronics
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef ewk_main_h
+#define ewk_main_h
+
+#include "ewk_eapi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EAPI int ewk_init(void);
+EAPI int ewk_shutdown(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_main_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list