[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

kov at webkit.org kov at webkit.org
Fri Jan 21 14:53:27 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit d8c7dac062cb2f91282eb0a0c91c07043f791366
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 3 21:20:13 2011 +0000

    WebKit/gtk
    
    2011-01-03  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
    
            Reviewed by Martin Robinson.
    
            [GTK] Split webkitprivate.{cpp,h} in more manageable chunks
            https://bugs.webkit.org/show_bug.cgi?id=50698
    
            Final patch, removing webkitprivate.{cpp,h}, and adding a
            webkitglobals module to hold non-object-specific functions and
            definitions that do not make sense on their own.
    
            * GNUmakefile.am:
            * WebCoreSupport/ChromeClientGtk.cpp:
            (WebKit::ChromeClient::createWindow):
            * WebCoreSupport/ContextMenuClientGtk.cpp:
            * WebCoreSupport/DocumentLoaderGtk.cpp:
            (WebKit::DocumentLoader::attachToFrame):
            * WebCoreSupport/DragClientGtk.cpp:
            * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
            * WebCoreSupport/EditorClientGtk.cpp:
            (WebKit::EditorClient::ignoreWordInSpellDocument):
            (WebKit::EditorClient::learnWord):
            (WebKit::EditorClient::checkSpellingOfString):
            (WebKit::EditorClient::getGuessesForWord):
            * WebCoreSupport/FrameLoaderClientGtk.cpp:
            (WebKit::FrameLoaderClient::createDocumentLoader):
            * WebCoreSupport/InspectorClientGtk.cpp:
            * webkit/webkit.h:
            * webkit/webkitapplicationcache.cpp:
            (webkit_application_cache_set_maximum_size):
            * webkit/webkitdownload.cpp:
            (webkit_download_class_init):
            * webkit/webkitgeolocationpolicydecision.cpp:
            * webkit/webkitglobals.cpp: Added.
            (webkit_get_default_session):
            (webkit_set_cache_model):
            (webkit_get_cache_model):
            (webkit_get_web_plugin_database):
            (currentToplevelCallback):
            (closeIconDatabaseOnExit):
            (webkitInit):
            (WebKit::pasteboardHelperInstance):
            * webkit/webkitglobals.h: Added.
            * webkit/webkitglobalsprivate.h: Copied from WebKit/gtk/webkit/webkitwebsettingsprivate.h.
            * webkit/webkithittestresult.cpp:
            (webkit_hit_test_result_class_init):
            * webkit/webkitnetworkrequest.cpp:
            (webkit_network_request_class_init):
            * webkit/webkitnetworkresponse.cpp:
            (webkit_network_response_class_init):
            * webkit/webkitprivate.cpp: Removed.
            * webkit/webkitprivate.h: Removed.
            * webkit/webkitsecurityorigin.cpp:
            * webkit/webkitviewportattributes.cpp:
            * webkit/webkitwebbackforwardlist.cpp:
            (webkit_web_back_forward_list_class_init):
            * webkit/webkitwebdatabase.cpp:
            * webkit/webkitwebdatasource.cpp:
            (webkit_web_data_source_class_init):
            (webkit_web_data_source_new_with_request):
            (WebKit::kitNew):
            * webkit/webkitwebframe.cpp:
            (webkit_web_frame_class_init):
            * webkit/webkitwebframeprivate.h:
            * webkit/webkitwebhistoryitem.cpp:
            (webkit_web_history_item_class_init):
            * webkit/webkitwebinspector.cpp:
            * webkit/webkitwebnavigationaction.cpp:
            * webkit/webkitwebplugin.cpp:
            (webkit_web_plugin_class_init):
            * webkit/webkitwebplugindatabase.cpp:
            (webkit_web_plugin_database_class_init):
            * webkit/webkitwebpluginprivate.h:
            * webkit/webkitwebpolicydecision.cpp:
            * webkit/webkitwebresource.cpp:
            * webkit/webkitwebsettings.cpp:
            (webkit_web_settings_class_init):
            (webkitWebViewGetEnchantDicts):
            (WebKit::core):
            * webkit/webkitwebsettingsprivate.h:
            * webkit/webkitwebview.cpp:
            (webkit_web_view_class_init):
            (webkit_web_view_update_settings):
            (webkit_web_view_settings_notify):
            * webkit/webkitwebview.h:
            * webkit/webkitwebwindowfeatures.cpp:
            (webkit_web_window_features_class_init):
            (WebKit::kitNew):
    
    WebCore
    
    2011-01-03  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
    
            Reviewed by Martin Robinson.
    
            [GTK] Split webkitprivate.{cpp,h} in more manageable chunks
            https://bugs.webkit.org/show_bug.cgi?id=50698
    
            Fix DOM bindings generation to no longer include the now-gone
            webkitprivate.h header, including the appropriate replacements
            instead.
    
            * bindings/scripts/CodeGeneratorGObject.pm:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 245405a..5163266 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2011-01-03  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Split webkitprivate.{cpp,h} in more manageable chunks
+        https://bugs.webkit.org/show_bug.cgi?id=50698
+
+        Fix DOM bindings generation to no longer include the now-gone
+        webkitprivate.h header, including the appropriate replacements
+        instead.
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+
 2011-01-03  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index e2773b8..1863d8f 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -1333,8 +1333,9 @@ sub Generate {
     @cPrefix = split("\r", $licenceTemplate);
     push(@cPrefix, "\n");
 
+    $implIncludes{"webkitdefines.h"} = 1;
+    $implIncludes{"webkitglobalsprivate.h"} = 1;
     $implIncludes{"webkitmarshal.h"} = 1;
-    $implIncludes{"webkitprivate.h"} = 1;
     $implIncludes{"DOMObjectCache.h"} = 1;
     $implIncludes{"WebKitDOMBinding.h"} = 1;
     $implIncludes{"gobject/ConvertToUTF8String.h"} = 1;
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index 0d7f5b1..e943c6e 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,92 @@
+2011-01-03  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Split webkitprivate.{cpp,h} in more manageable chunks
+        https://bugs.webkit.org/show_bug.cgi?id=50698
+
+        Final patch, removing webkitprivate.{cpp,h}, and adding a
+        webkitglobals module to hold non-object-specific functions and
+        definitions that do not make sense on their own.
+
+        * GNUmakefile.am:
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::createWindow):
+        * WebCoreSupport/ContextMenuClientGtk.cpp:
+        * WebCoreSupport/DocumentLoaderGtk.cpp:
+        (WebKit::DocumentLoader::attachToFrame):
+        * WebCoreSupport/DragClientGtk.cpp:
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::EditorClient::ignoreWordInSpellDocument):
+        (WebKit::EditorClient::learnWord):
+        (WebKit::EditorClient::checkSpellingOfString):
+        (WebKit::EditorClient::getGuessesForWord):
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::createDocumentLoader):
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        * webkit/webkit.h:
+        * webkit/webkitapplicationcache.cpp:
+        (webkit_application_cache_set_maximum_size):
+        * webkit/webkitdownload.cpp:
+        (webkit_download_class_init):
+        * webkit/webkitgeolocationpolicydecision.cpp:
+        * webkit/webkitglobals.cpp: Added.
+        (webkit_get_default_session):
+        (webkit_set_cache_model):
+        (webkit_get_cache_model):
+        (webkit_get_web_plugin_database):
+        (currentToplevelCallback):
+        (closeIconDatabaseOnExit):
+        (webkitInit):
+        (WebKit::pasteboardHelperInstance):
+        * webkit/webkitglobals.h: Added.
+        * webkit/webkitglobalsprivate.h: Copied from WebKit/gtk/webkit/webkitwebsettingsprivate.h.
+        * webkit/webkithittestresult.cpp:
+        (webkit_hit_test_result_class_init):
+        * webkit/webkitnetworkrequest.cpp:
+        (webkit_network_request_class_init):
+        * webkit/webkitnetworkresponse.cpp:
+        (webkit_network_response_class_init):
+        * webkit/webkitprivate.cpp: Removed.
+        * webkit/webkitprivate.h: Removed.
+        * webkit/webkitsecurityorigin.cpp:
+        * webkit/webkitviewportattributes.cpp:
+        * webkit/webkitwebbackforwardlist.cpp:
+        (webkit_web_back_forward_list_class_init):
+        * webkit/webkitwebdatabase.cpp:
+        * webkit/webkitwebdatasource.cpp:
+        (webkit_web_data_source_class_init):
+        (webkit_web_data_source_new_with_request):
+        (WebKit::kitNew):
+        * webkit/webkitwebframe.cpp:
+        (webkit_web_frame_class_init):
+        * webkit/webkitwebframeprivate.h:
+        * webkit/webkitwebhistoryitem.cpp:
+        (webkit_web_history_item_class_init):
+        * webkit/webkitwebinspector.cpp:
+        * webkit/webkitwebnavigationaction.cpp:
+        * webkit/webkitwebplugin.cpp:
+        (webkit_web_plugin_class_init):
+        * webkit/webkitwebplugindatabase.cpp:
+        (webkit_web_plugin_database_class_init):
+        * webkit/webkitwebpluginprivate.h:
+        * webkit/webkitwebpolicydecision.cpp:
+        * webkit/webkitwebresource.cpp:
+        * webkit/webkitwebsettings.cpp:
+        (webkit_web_settings_class_init):
+        (webkitWebViewGetEnchantDicts):
+        (WebKit::core):
+        * webkit/webkitwebsettingsprivate.h:
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_class_init):
+        (webkit_web_view_update_settings):
+        (webkit_web_view_settings_notify):
+        * webkit/webkitwebview.h:
+        * webkit/webkitwebwindowfeatures.cpp:
+        (webkit_web_window_features_class_init):
+        (WebKit::kitNew):
+
 2011-01-02  Xan Lopez  <xlopez at igalia.com>
 
         Fix GTK+ build.
diff --git a/WebKit/gtk/GNUmakefile.am b/WebKit/gtk/GNUmakefile.am
index 5e184a7..5ec08e7 100644
--- a/WebKit/gtk/GNUmakefile.am
+++ b/WebKit/gtk/GNUmakefile.am
@@ -191,18 +191,20 @@ webkitgtk_sources += \
 	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
 	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
 	WebKit/gtk/webkit/webkitapplicationcache.cpp \
+	WebKit/gtk/webkit/webkitapplicationcacheprivate.h \
 	WebKit/gtk/webkit/webkitdownload.cpp \
 	WebKit/gtk/webkit/webkitdownloadprivate.h \
 	WebKit/gtk/webkit/webkiterror.cpp \
 	WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
+	WebKit/gtk/webkit/webkitglobals.cpp \
+	WebKit/gtk/webkit/webkitglobals.h \
+	WebKit/gtk/webkit/webkitglobalsprivate.h \
 	WebKit/gtk/webkit/webkithittestresult.cpp \
 	WebKit/gtk/webkit/webkithittestresultprivate.h \
 	WebKit/gtk/webkit/webkitnetworkrequest.cpp \
 	WebKit/gtk/webkit/webkitnetworkrequestprivate.h \
 	WebKit/gtk/webkit/webkitnetworkresponse.cpp \
 	WebKit/gtk/webkit/webkitnetworkresponseprivate.h \
-	WebKit/gtk/webkit/webkitprivate.cpp \
-	WebKit/gtk/webkit/webkitprivate.h \
 	WebKit/gtk/webkit/webkitsecurityorigin.cpp \
 	WebKit/gtk/webkit/webkitsecurityoriginprivate.h \
 	WebKit/gtk/webkit/webkitsoupauthdialog.c \
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 7910c7a..6df5980 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -48,13 +48,14 @@
 #include "SecurityOrigin.h"
 #include "WindowFeatures.h"
 #include "webkitgeolocationpolicydecision.h"
+#include "webkitgeolocationpolicydecisionprivate.h"
 #include "webkitnetworkrequest.h"
-#include "webkitprivate.h"
 #include "webkitsecurityoriginprivate.h"
 #include "webkitviewportattributesprivate.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebview.h"
 #include "webkitwebviewprivate.h"
+#include "webkitwebwindowfeaturesprivate.h"
 #include <glib.h>
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
@@ -156,9 +157,8 @@ Page* ChromeClient::createWindow(Frame* frame, const FrameLoadRequest& frameLoad
     if (!webView)
         return 0;
 
-    WebKitWebWindowFeatures* webWindowFeatures = webkit_web_window_features_new_from_core_features(coreFeatures);
-    g_object_set(webView, "window-features", webWindowFeatures, NULL);
-    g_object_unref(webWindowFeatures);
+    PlatformRefPtr<WebKitWebWindowFeatures> webWindowFeatures(adoptPlatformRef(kitNew(coreFeatures)));
+    g_object_set(webView, "window-features", webWindowFeatures.get(), NULL);
 
     if (!frameLoadRequest.isEmpty())
         webkit_web_view_open(webView, frameLoadRequest.resourceRequest().url().string().utf8().data());
diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
index 137f9ab..d9c59d0 100644
--- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
@@ -26,7 +26,6 @@
 #include "KURL.h"
 #include "NotImplemented.h"
 #include "Page.h"
-#include "webkitprivate.h"
 #include "webkitwebviewprivate.h"
 #include <glib-object.h>
 #include <glib/gi18n-lib.h>
diff --git a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
index 2b355cb..bedb129 100644
--- a/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp
@@ -30,8 +30,9 @@
 #include "config.h"
 #include "DocumentLoaderGtk.h"
 
-#include "webkitprivate.h"
+#include "GRefPtr.h"
 #include "webkitwebdatasource.h"
+#include "webkitwebdatasourceprivate.h"
 
 using namespace WebCore;
 
@@ -68,9 +69,8 @@ void DocumentLoader::attachToFrame()
 
     // We may get to here without having a datasource, when the data
     // is coming from the page cache.
-    WebKitWebDataSource* dataSource = webkit_web_data_source_new_with_loader(this);
-    setDataSource(dataSource);
-    g_object_unref(dataSource);
+    PlatformRefPtr<WebKitWebDataSource> dataSource(adoptPlatformRef(kitNew(this)));
+    setDataSource(dataSource.get());
 }
 
 void DocumentLoader::detachFromFrame()
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index 5f391ec..dbe7ddd 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -32,7 +32,6 @@
 #include "NotImplemented.h"
 #include "PasteboardHelper.h"
 #include "RenderObject.h"
-#include "webkitprivate.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebviewprivate.h"
 #include "webkitwebview.h"
diff --git a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
index a751c77..5d8e400 100644
--- a/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -21,15 +21,16 @@
 #include "config.h"
 #include "DumpRenderTreeSupportGtk.h"
 
-#include "AccessibilityObjectWrapperAtk.h"
-#include "AnimationController.h"
 #include "APICast.h"
 #include "AXObjectCache.h"
+#include "AccessibilityObjectWrapperAtk.h"
+#include "AnimationController.h"
+#include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "FocusController.h"
 #include "FrameLoaderClientGtk.h"
-#include "FrameView.h"
 #include "FrameTree.h"
+#include "FrameView.h"
 #include "GCController.h"
 #include "GraphicsContext.h"
 #include "JSDOMWindow.h"
@@ -43,21 +44,20 @@
 #include "PlatformString.h"
 #include "PrintContext.h"
 #include "RenderListItem.h"
-#include "RenderView.h"
 #include "RenderTreeAsText.h"
+#include "RenderView.h"
 #include "SecurityOrigin.h"
-#if ENABLE(SVG)
-#include "SVGSMILElement.h"
-#endif
 #include "WorkerThread.h"
-#include "webkitprivate.h"
+#include "webkitwebframe.h"
 #include "webkitwebframeprivate.h"
-#include "webkitwebviewprivate.h"
 #include "webkitwebview.h"
-#include "webkitwebframe.h"
-#include "DOMWrapperWorld.h"
+#include "webkitwebviewprivate.h"
 #include <JavaScriptCore/APICast.h>
 
+#if ENABLE(SVG)
+#include "SVGSMILElement.h"
+#endif
+
 using namespace JSC;
 using namespace WebCore;
 using namespace WebKit;
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index 3f55cca..1d80cbe 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -44,8 +44,8 @@
 #include "WebKitDOMNodePrivate.h"
 #include "WebKitDOMRangePrivate.h"
 #include "WindowsKeyboardCodes.h"
+#include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
-#include "webkitprivate.h"
 #include "webkitwebsettingsprivate.h"
 #include "webkitwebviewprivate.h"
 #include <wtf/text/CString.h>
@@ -889,7 +889,7 @@ void EditorClient::textDidChangeInTextArea(Element*)
 
 void EditorClient::ignoreWordInSpellDocument(const String& text)
 {
-    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
+    GSList* dicts = webkitWebViewGetEnchantDicts(m_webView);
 
     for (; dicts; dicts = dicts->next) {
         EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
@@ -900,7 +900,7 @@ void EditorClient::ignoreWordInSpellDocument(const String& text)
 
 void EditorClient::learnWord(const String& text)
 {
-    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
+    GSList* dicts = webkitWebViewGetEnchantDicts(m_webView);
 
     for (; dicts; dicts = dicts->next) {
         EnchantDict* dict = static_cast<EnchantDict*>(dicts->data);
@@ -911,7 +911,7 @@ void EditorClient::learnWord(const String& text)
 
 void EditorClient::checkSpellingOfString(const UChar* text, int length, int* misspellingLocation, int* misspellingLength)
 {
-    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
+    GSList* dicts = webkitWebViewGetEnchantDicts(m_webView);
     if (!dicts)
         return;
 
@@ -1004,7 +1004,7 @@ bool EditorClient::spellingUIIsShowing()
 
 void EditorClient::getGuessesForWord(const String& word, const String& context, WTF::Vector<String>& guesses)
 {
-    GSList* dicts = webkit_web_settings_get_enchant_dicts(m_webView);
+    GSList* dicts = webkitWebViewGetEnchantDicts(m_webView);
     guesses.clear();
 
     for (; dicts; dicts = dicts->next) {
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 895e64e..5302257 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -58,14 +58,17 @@
 #include "ResourceHandle.h"
 #include "ResourceRequest.h"
 #include "ScriptController.h"
+#include "Settings.h"
 #include "webkiterror.h"
+#include "webkitglobals.h"
+#include "webkitglobalsprivate.h"
 #include "webkitnetworkrequest.h"
 #include "webkitnetworkrequestprivate.h"
 #include "webkitnetworkresponse.h"
 #include "webkitnetworkresponseprivate.h"
-#include "webkitprivate.h"
 #include "webkitviewportattributes.h"
 #include "webkitviewportattributesprivate.h"
+#include "webkitwebdatasourceprivate.h"
 #include "webkitwebframe.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebnavigationaction.h"
@@ -74,6 +77,7 @@
 #include "webkitwebpolicydecisionprivate.h"
 #include "webkitwebresource.h"
 #include "webkitwebresourceprivate.h"
+#include "webkitwebsettingsprivate.h"
 #include "webkitwebview.h"
 #include "webkitwebviewprivate.h"
 #include <JavaScriptCore/APICast.h>
@@ -240,9 +244,8 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClient::createDocumentLoader
 {
     RefPtr<WebKit::DocumentLoader> loader = WebKit::DocumentLoader::create(request, substituteData);
 
-    WebKitWebDataSource* webDataSource = webkit_web_data_source_new_with_loader(loader.get());
-    loader->setDataSource(webDataSource);
-    g_object_unref(webDataSource);
+    PlatformRefPtr<WebKitWebDataSource> webDataSource(adoptPlatformRef(kitNew(loader.get())));
+    loader->setDataSource(webDataSource.get());
 
     return loader.release();
 }
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index c269078..d39302f 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -24,7 +24,6 @@
 #include "InspectorController.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
-#include "webkitprivate.h"
 #include "webkitversion.h"
 #include "webkitwebinspector.h"
 #include "webkitwebinspectorprivate.h"
diff --git a/WebKit/gtk/webkit/webkit.h b/WebKit/gtk/webkit/webkit.h
index c0d0e31..d93fae1 100644
--- a/WebKit/gtk/webkit/webkit.h
+++ b/WebKit/gtk/webkit/webkit.h
@@ -26,6 +26,7 @@
 #include <webkit/webkitdom.h>
 #include <webkit/webkitdownload.h>
 #include <webkit/webkitgeolocationpolicydecision.h>
+#include <webkit/webkitglobals.h>
 #include <webkit/webkithittestresult.h>
 #include <webkit/webkitnetworkrequest.h>
 #include <webkit/webkitnetworkresponse.h>
diff --git a/WebKit/gtk/webkit/webkitapplicationcache.cpp b/WebKit/gtk/webkit/webkitapplicationcache.cpp
index e967d34..87f3ab5 100644
--- a/WebKit/gtk/webkit/webkitapplicationcache.cpp
+++ b/WebKit/gtk/webkit/webkitapplicationcache.cpp
@@ -18,15 +18,14 @@
  */
 
 #include "config.h"
-#include "webkitprivate.h"
-
-#include <wtf/UnusedParam.h>
 
 #include "ApplicationCacheStorage.h"
+#include "webkitapplicationcacheprivate.h"
+#include <wtf/UnusedParam.h>
 
 void webkit_application_cache_set_maximum_size(unsigned long long size)
 {
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)   
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     WebCore::cacheStorage().empty();
     WebCore::cacheStorage().vacuumDatabaseFile();
     WebCore::cacheStorage().setMaximumSize(size);
diff --git a/WebKit/gtk/webkit/webkitdownload.cpp b/WebKit/gtk/webkit/webkitdownload.cpp
index 6be591c..61e9380 100644
--- a/WebKit/gtk/webkit/webkitdownload.cpp
+++ b/WebKit/gtk/webkit/webkitdownload.cpp
@@ -19,8 +19,8 @@
  */
 
 #include "config.h"
+#include "webkitdownload.h"
 
-#include <glib/gi18n-lib.h>
 #include "GRefPtr.h"
 #include "Noncopyable.h"
 #include "NotImplemented.h"
@@ -28,17 +28,17 @@
 #include "ResourceHandleInternal.h"
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
-#include "webkitdownload.h"
 #include "webkitdownloadprivate.h"
 #include "webkitenumtypes.h"
+#include "webkitglobals.h"
+#include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
 #include "webkitnetworkrequestprivate.h"
 #include "webkitnetworkresponse.h"
 #include "webkitnetworkresponseprivate.h"
-#include "webkitprivate.h"
-#include <wtf/text/CString.h>
-
+#include <glib/gi18n-lib.h>
 #include <glib/gstdio.h>
+#include <wtf/text/CString.h>
 
 #ifdef ERROR
 #undef ERROR
@@ -230,7 +230,7 @@ static void webkit_download_class_init(WebKitDownloadClass* downloadClass)
     objectClass->get_property = webkit_download_get_property;
     objectClass->set_property = webkit_download_set_property;
 
-    webkit_init();
+    webkitInit();
 
     /**
      * WebKitDownload::error:
diff --git a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
index cb023d6..2523c9b 100644
--- a/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
+++ b/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp
@@ -20,10 +20,9 @@
 #include "config.h"
 #include "webkitgeolocationpolicydecision.h"
 
-#include "webkitprivate.h"
 #include "Geolocation.h"
+#include "webkitgeolocationpolicydecisionprivate.h"
 
-using namespace WebKit;
 using namespace WebCore;
 
 /**
diff --git a/WebKit/gtk/webkit/webkitglobals.cpp b/WebKit/gtk/webkit/webkitglobals.cpp
new file mode 100644
index 0000000..6b57533
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitglobals.cpp
@@ -0,0 +1,282 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008, 2010 Collabora Ltd.
+ *
+ * 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 "webkitglobals.h"
+
+#include "ApplicationCacheStorage.h"
+#include "Chrome.h"
+#include "FrameNetworkingContextGtk.h"
+#include "GOwnPtr.h"
+#include "IconDatabase.h"
+#include "Logging.h"
+#include "MemoryCache.h"
+#include "Page.h"
+#include "PageCache.h"
+#include "PageGroup.h"
+#include "TextEncodingRegistry.h"
+#include "Pasteboard.h"
+#include "PasteboardHelperGtk.h"
+#include "ResourceHandle.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
+#include "ResourceResponse.h"
+#include "webkitglobalsprivate.h"
+#include "webkitsoupauthdialog.h"
+#include "webkitwebdatabase.h"
+#include "webkitwebplugindatabaseprivate.h"
+#include <libintl.h>
+#include <runtime/InitializeThreading.h>
+#include <stdlib.h>
+#include <wtf/Threading.h>
+
+static WebKitCacheModel cacheModel = WEBKIT_CACHE_MODEL_DEFAULT;
+
+using namespace WebCore;
+
+/**
+ * SECTION:webkit
+ * @short_description: Global functions controlling WebKit
+ *
+ * WebKit manages many resources which are not related to specific
+ * views. These functions relate to cross-view limits, such as cache
+ * sizes, database quotas, and the HTTP session management.
+ */
+
+/**
+ * webkit_get_default_session:
+ *
+ * Retrieves the default #SoupSession used by all web views.
+ * Note that the session features are added by WebKit on demand,
+ * so if you insert your own #SoupCookieJar before any network
+ * traffic occurs, WebKit will use it instead of the default.
+ *
+ * Return value: (transfer none): the default #SoupSession
+ *
+ * Since: 1.1.1
+ */
+SoupSession* webkit_get_default_session ()
+{
+    webkitInit();
+    return ResourceHandle::defaultSession();
+}
+
+/**
+ * webkit_set_cache_model:
+ * @cache_model: a #WebKitCacheModel
+ *
+ * Specifies a usage model for WebViews, which WebKit will use to
+ * determine its caching behavior. All web views follow the cache
+ * model. This cache model determines the RAM and disk space to use
+ * for caching previously viewed content .
+ *
+ * Research indicates that users tend to browse within clusters of
+ * documents that hold resources in common, and to revisit previously
+ * visited documents. WebKit and the frameworks below it include
+ * built-in caches that take advantage of these patterns,
+ * substantially improving document load speed in browsing
+ * situations. The WebKit cache model controls the behaviors of all of
+ * these caches, including various WebCore caches.
+ *
+ * Browsers can improve document load speed substantially by
+ * specifying WEBKIT_CACHE_MODEL_WEB_BROWSER. Applications without a
+ * browsing interface can reduce memory usage substantially by
+ * specifying WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. Default value is
+ * WEBKIT_CACHE_MODEL_WEB_BROWSER.
+ *
+ * Since: 1.1.18
+ */
+void webkit_set_cache_model(WebKitCacheModel model)
+{
+    webkitInit();
+
+    if (cacheModel == model)
+        return;
+
+    // FIXME: Add disk cache handling when soup has the API
+    guint cacheTotalCapacity;
+    guint cacheMinDeadCapacity;
+    guint cacheMaxDeadCapacity;
+    gdouble deadDecodedDataDeletionInterval;
+    guint pageCacheCapacity;
+
+    switch (model) {
+    case WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER:
+        pageCacheCapacity = 0;
+        cacheTotalCapacity = 0;
+        cacheMinDeadCapacity = 0;
+        cacheMaxDeadCapacity = 0;
+        deadDecodedDataDeletionInterval = 0;
+        break;
+    case WEBKIT_CACHE_MODEL_WEB_BROWSER:
+        // Page cache capacity (in pages). Comment from Mac port:
+        // (Research indicates that value / page drops substantially after 3 pages.)
+        pageCacheCapacity = 3;
+        cacheTotalCapacity = 32 * 1024 * 1024;
+        cacheMinDeadCapacity = cacheTotalCapacity / 4;
+        cacheMaxDeadCapacity = cacheTotalCapacity / 2;
+        deadDecodedDataDeletionInterval = 60;
+        break;
+    default:
+        g_return_if_reached();
+    }
+
+    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    pageCache()->setCapacity(pageCacheCapacity);
+    cacheModel = model;
+}
+
+/**
+ * webkit_get_cache_model:
+ *
+ * Returns the current cache model. For more information about this
+ * value check the documentation of the function
+ * webkit_set_cache_model().
+ *
+ * Return value: the current #WebKitCacheModel
+ *
+ * Since: 1.1.18
+ */
+WebKitCacheModel webkit_get_cache_model()
+{
+    webkitInit();
+    return cacheModel;
+}
+
+/**
+ * webkit_get_web_plugin_database:
+ *
+ * Returns the current #WebKitWebPluginDatabase with information about
+ * all the plugins WebKit knows about in this instance.
+ *
+ * Return value: (transfer none): the current #WebKitWebPluginDatabase
+ *
+ * Since: 1.3.8
+ */
+WebKitWebPluginDatabase* webkit_get_web_plugin_database()
+{
+    static WebKitWebPluginDatabase* database = 0;
+
+    webkitInit();
+
+    if (!database)
+        database = webkit_web_plugin_database_new();
+
+    return database;
+}
+
+
+static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMessage* message, gpointer userData)
+{
+    gpointer messageData = g_object_get_data(G_OBJECT(message), "resourceHandle");
+    if (!messageData)
+        return NULL;
+
+    ResourceHandle* handle = static_cast<ResourceHandle*>(messageData);
+    if (!handle)
+        return NULL;
+
+    ResourceHandleInternal* d = handle->getInternal();
+    if (!d)
+        return NULL;
+
+    WebKit::FrameNetworkingContextGtk* context = static_cast<WebKit::FrameNetworkingContextGtk*>(d->m_context.get());
+    if (!context)
+        return NULL;
+
+    if (!context->coreFrame())
+        return NULL;
+
+    GtkWidget* toplevel =  gtk_widget_get_toplevel(GTK_WIDGET(context->coreFrame()->page()->chrome()->platformPageClient()));
+    if (gtk_widget_is_toplevel(toplevel))
+        return toplevel;
+    else
+        return NULL;
+}
+
+static void closeIconDatabaseOnExit()
+{
+    iconDatabase()->close();
+}
+
+void webkitInit()
+{
+    static bool isInitialized = false;
+    if (isInitialized)
+        return;
+    isInitialized = true;
+
+    bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+    bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+
+    JSC::initializeThreading();
+    WTF::initializeMainThread();
+
+    WebCore::InitializeLoggingChannelsIfNecessary();
+
+    // We make sure the text codecs have been initialized, because
+    // that may only be done by the main thread.
+    atomicCanonicalTextEncodingName("UTF-8");
+
+    gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
+    webkit_set_web_database_directory_path(databaseDirectory);
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    // FIXME: It should be possible for client applications to override the default appcache location
+    WebCore::cacheStorage().setCacheDirectory(databaseDirectory);
+#endif
+    g_free(databaseDirectory);
+
+    PageGroup::setShouldTrackVisitedLinks(true);
+
+    Pasteboard::generalPasteboard()->setHelper(WebKit::pasteboardHelperInstance());
+
+    iconDatabase()->setEnabled(true);
+
+    GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL));
+    iconDatabase()->open(iconDatabasePath.get());
+
+    atexit(closeIconDatabaseOnExit);
+
+    SoupSession* session = webkit_get_default_session();
+
+    SoupSessionFeature* authDialog = static_cast<SoupSessionFeature*>(g_object_new(WEBKIT_TYPE_SOUP_AUTH_DIALOG, NULL));
+    g_signal_connect(authDialog, "current-toplevel", G_CALLBACK(currentToplevelCallback), NULL);
+    soup_session_add_feature(session, authDialog);
+    g_object_unref(authDialog);
+
+    SoupSessionFeature* sniffer = static_cast<SoupSessionFeature*>(g_object_new(SOUP_TYPE_CONTENT_SNIFFER, NULL));
+    soup_session_add_feature(session, sniffer);
+    g_object_unref(sniffer);
+
+    soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER);
+}
+
+namespace WebKit {
+
+PasteboardHelperGtk* pasteboardHelperInstance()
+{
+    static PasteboardHelperGtk* helper = new PasteboardHelperGtk();
+    return helper;
+}
+
+} /** end namespace WebKit */
+
diff --git a/WebKit/gtk/webkit/webkitglobals.h b/WebKit/gtk/webkit/webkitglobals.h
new file mode 100644
index 0000000..6d144fc
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitglobals.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Jan Michael C. Alonzo
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * 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 webkitglobals_h
+#define webkitglobals_h
+
+#include "webkitdefines.h"
+#include <glib.h>
+#include <libsoup/soup.h>
+
+G_BEGIN_DECLS
+
+/*
+ * WebKitCacheModel:
+ * @WEBKIT_CACHE_MODEL_DEFAULT: The default cache model. This is
+ *   WEBKIT_CACHE_MODEL_WEB_BROWSER.
+ * @WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER: Disable the cache completely, which
+ *   substantially reduces memory usage. Useful for applications that only
+ *   access local files.
+ * @WEBKIT_CACHE_MODEL_WEB_BROWSER: Improve document load speed substantially
+ *   by caching previously viewed content.
+ *
+ * Enum values used for determining the webview cache model.
+ */
+typedef enum {
+    WEBKIT_CACHE_MODEL_DEFAULT,
+    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
+    WEBKIT_CACHE_MODEL_WEB_BROWSER
+} WebKitCacheModel;
+
+WEBKIT_API SoupSession*
+webkit_get_default_session                      (void);
+
+WEBKIT_API WebKitWebPluginDatabase *
+webkit_get_web_plugin_database                  (void);
+
+WEBKIT_API void
+webkit_set_cache_model                          (WebKitCacheModel     cache_model);
+
+WEBKIT_API WebKitCacheModel
+webkit_get_cache_model                          (void);
+
+G_END_DECLS
+
+#endif
diff --git a/WebKit/gtk/webkit/webkitglobalsprivate.h b/WebKit/gtk/webkit/webkitglobalsprivate.h
new file mode 100644
index 0000000..5923f2e
--- /dev/null
+++ b/WebKit/gtk/webkit/webkitglobalsprivate.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2007, 2008, 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Jan Michael C. Alonzo
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2010 Igalia S.L.
+ *
+ * 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 webkitglobalsprivate_h
+#define webkitglobalsprivate_h
+
+#include <glib.h>
+
+#define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
+#define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
+
+namespace WebKit {
+
+class PasteboardHelperGtk;
+PasteboardHelperGtk* pasteboardHelperInstance();
+
+}
+
+extern "C" {
+
+void webkitInit();
+
+}
+
+#endif
diff --git a/WebKit/gtk/webkit/webkithittestresult.cpp b/WebKit/gtk/webkit/webkithittestresult.cpp
index fa0b40b..9632493 100644
--- a/WebKit/gtk/webkit/webkithittestresult.cpp
+++ b/WebKit/gtk/webkit/webkithittestresult.cpp
@@ -23,13 +23,14 @@
 
 #include "GOwnPtr.h"
 #include "HitTestResult.h"
+#include "KURL.h"
 #include "WebKitDOMBinding.h"
 #include "WebKitDOMNode.h"
 #include "webkitenumtypes.h"
-#include "webkitprivate.h"
-#include <wtf/text/CString.h>
-
+#include "webkitglobals.h"
+#include "webkitglobalsprivate.h"
 #include <glib/gi18n-lib.h>
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkithittestresult
@@ -142,7 +143,7 @@ static void webkit_hit_test_result_class_init(WebKitHitTestResultClass* webHitTe
     objectClass->get_property = webkit_hit_test_result_get_property;
     objectClass->set_property = webkit_hit_test_result_set_property;
 
-    webkit_init();
+    webkitInit();
 
     /**
      * WebKitHitTestResult:context:
diff --git a/WebKit/gtk/webkit/webkitnetworkrequest.cpp b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
index 23f22a3..8dffe77 100644
--- a/WebKit/gtk/webkit/webkitnetworkrequest.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkrequest.cpp
@@ -21,11 +21,11 @@
 #include "config.h"
 #include "webkitnetworkrequest.h"
 
+#include "GRefPtr.h"
 #include "ResourceRequest.h"
-#include "webkitprivate.h"
-#include <wtf/text/CString.h>
-
+#include "webkitglobalsprivate.h"
 #include <glib/gi18n-lib.h>
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkitnetworkrequest
@@ -120,7 +120,7 @@ static void webkit_network_request_class_init(WebKitNetworkRequestClass* request
     objectClass->get_property = webkit_network_request_get_property;
     objectClass->set_property = webkit_network_request_set_property;
 
-    webkit_init();
+    webkitInit();
 
     /**
      * WebKitNetworkRequest:uri:
diff --git a/WebKit/gtk/webkit/webkitnetworkresponse.cpp b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
index da29212..23cf9d2 100644
--- a/WebKit/gtk/webkit/webkitnetworkresponse.cpp
+++ b/WebKit/gtk/webkit/webkitnetworkresponse.cpp
@@ -24,9 +24,9 @@
 
 #include "GRefPtr.h"
 #include "ResourceResponse.h"
-#include "webkitprivate.h"
-
+#include "webkitglobalsprivate.h"
 #include <glib/gi18n-lib.h>
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkitnetworkresponse
@@ -120,7 +120,7 @@ static void webkit_network_response_class_init(WebKitNetworkResponseClass* respo
     objectClass->get_property = webkit_network_response_get_property;
     objectClass->set_property = webkit_network_response_set_property;
 
-    webkit_init();
+    webkitInit();
 
     /**
      * WebKitNetworkResponse:uri:
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
deleted file mode 100644
index 3e1ad36..0000000
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2008 Collabora Ltd.
- *
- * 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 "webkitprivate.h"
-
-#include "ApplicationCacheStorage.h"
-#include "Chrome.h"
-#include "ChromeClientGtk.h"
-#include "Element.h"
-#include "Frame.h"
-#include "FrameLoader.h"
-#include "FrameLoaderClientGtk.h"
-#include "FrameNetworkingContextGtk.h"
-#include "GtkVersioning.h"
-#include "HTMLMediaElement.h"
-#include "HTMLNames.h"
-#include "HitTestResult.h"
-#include "IconDatabase.h"
-#include "Logging.h"
-#include "PageCache.h"
-#include "PageGroup.h"
-#include "Pasteboard.h"
-#include "PasteboardHelperGtk.h"
-#include "ResourceHandle.h"
-#include "ResourceHandleClient.h"
-#include "ResourceHandleInternal.h"
-#include "ResourceResponse.h"
-#include "TextEncodingRegistry.h"
-#include "webkitnetworkresponse.h"
-#include "webkitsoupauthdialog.h"
-#include "webkitversion.h"
-#include <libintl.h>
-#include <runtime/InitializeThreading.h>
-#include <stdlib.h>
-#include <wtf/Threading.h>
-
-#if ENABLE(VIDEO)
-#include "FullscreenVideoController.h"
-#endif
-
-#if ENABLE(DATABASE)
-#include "DatabaseTracker.h"
-#endif
-
-using namespace WebCore;
-
-namespace WebKit {
-
-WebCore::EditingBehaviorType core(WebKitEditingBehavior type)
-{
-    return (WebCore::EditingBehaviorType)type;
-}
-
-PasteboardHelperGtk* pasteboardHelperInstance()
-{
-    static PasteboardHelperGtk* helper = new PasteboardHelperGtk();
-    return helper;
-}
-
-} /** end namespace WebKit */
-
-static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMessage* message, gpointer userData)
-{
-    gpointer messageData = g_object_get_data(G_OBJECT(message), "resourceHandle");
-    if (!messageData)
-        return NULL;
-
-    ResourceHandle* handle = static_cast<ResourceHandle*>(messageData);
-    if (!handle)
-        return NULL;
-
-    ResourceHandleInternal* d = handle->getInternal();
-    if (!d)
-        return NULL;
-
-    WebKit::FrameNetworkingContextGtk* context = static_cast<WebKit::FrameNetworkingContextGtk*>(d->m_context.get());
-    if (!context)
-        return NULL;
-
-    if (!context->coreFrame())
-        return NULL;
-
-    GtkWidget* toplevel =  gtk_widget_get_toplevel(GTK_WIDGET(context->coreFrame()->page()->chrome()->platformPageClient()));
-    if (gtk_widget_is_toplevel(toplevel))
-        return toplevel;
-    else
-        return NULL;
-}
-
-static void closeIconDatabaseOnExit()
-{
-    iconDatabase()->close();
-}
-
-void webkit_init()
-{
-    static bool isInitialized = false;
-    if (isInitialized)
-        return;
-    isInitialized = true;
-
-    bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
-    bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
-
-    JSC::initializeThreading();
-    WTF::initializeMainThread();
-
-    WebCore::InitializeLoggingChannelsIfNecessary();
-
-    // We make sure the text codecs have been initialized, because
-    // that may only be done by the main thread.
-    atomicCanonicalTextEncodingName("UTF-8");
-
-    gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
-    webkit_set_web_database_directory_path(databaseDirectory);
-
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-    // FIXME: It should be possible for client applications to override the default appcache location
-    WebCore::cacheStorage().setCacheDirectory(databaseDirectory);
-#endif
-    g_free(databaseDirectory);
-
-    PageGroup::setShouldTrackVisitedLinks(true);
-
-    Pasteboard::generalPasteboard()->setHelper(WebKit::pasteboardHelperInstance());
-
-    iconDatabase()->setEnabled(true);
-
-    GOwnPtr<gchar> iconDatabasePath(g_build_filename(g_get_user_data_dir(), "webkit", "icondatabase", NULL));
-    iconDatabase()->open(iconDatabasePath.get());
-
-    atexit(closeIconDatabaseOnExit);
-
-    SoupSession* session = webkit_get_default_session();
-
-    SoupSessionFeature* authDialog = static_cast<SoupSessionFeature*>(g_object_new(WEBKIT_TYPE_SOUP_AUTH_DIALOG, NULL));
-    g_signal_connect(authDialog, "current-toplevel", G_CALLBACK(currentToplevelCallback), NULL);
-    soup_session_add_feature(session, authDialog);
-    g_object_unref(authDialog);
-
-    SoupSessionFeature* sniffer = static_cast<SoupSessionFeature*>(g_object_new(SOUP_TYPE_CONTENT_SNIFFER, NULL));
-    soup_session_add_feature(session, sniffer);
-    g_object_unref(sniffer);
-
-    soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER);
-}
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
deleted file mode 100644
index 20a5c50..0000000
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2009 Holger Hans Peter Freyther
- * Copyright (C) 2008 Jan Michael C. Alonzo
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2010 Igalia S.L.
- *
- * 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 webkitprivate_h
-#define webkitprivate_h
-
-/*
- * This file knows the shared secret of WebKitWebView, WebKitWebFrame,
- * and WebKitNetworkRequest.
- * They are using WebCore which musn't be exposed to the outer world.
- */
-
-#include <webkit/webkitdefines.h>
-#include <webkit/webkitnetworkrequest.h>
-#include <webkit/webkitwebview.h>
-#include <webkit/webkitwebdatasource.h>
-#include <webkit/webkitwebframe.h>
-#include <webkit/webkitwebsettings.h>
-#include <webkit/webkitwebwindowfeatures.h>
-#include <webkit/webkitnetworkrequest.h>
-#include <webkit/webkitsecurityorigin.h>
-
-#include "DataObjectGtk.h"
-#include "DragActions.h"
-#include "Frame.h"
-#include "GOwnPtr.h"
-#include "Geolocation.h"
-#include "IntPoint.h"
-#include "IntRect.h"
-#include "FrameLoaderClient.h"
-#include "Node.h"
-#include "Page.h"
-#include "PlatformString.h"
-#include "ResourceHandle.h"
-#include "ResourceRequest.h"
-#include "WindowFeatures.h"
-#include "Settings.h"
-#include <enchant.h>
-#include <wtf/OwnPtr.h>
-#include <wtf/text/CString.h>
-
-namespace WebKit {
-
-    class DocumentLoader;
-    class PasteboardHelperGtk;
-
-    WebCore::EditingBehaviorType core(WebKitEditingBehavior type);
-
-    PasteboardHelperGtk* pasteboardHelperInstance();
-}
-
-extern "C" {
-    void webkit_init();
-
-#define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
-#define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB))
-
-    WTF::String
-    webkitUserAgent();
-
-    WebKitWebWindowFeatures*
-    webkit_web_window_features_new_from_core_features (const WebCore::WindowFeatures& features);
-
-    WebKitGeolocationPolicyDecision*
-    webkit_geolocation_policy_decision_new(WebKitWebFrame*, WebCore::Geolocation*);
-
-    WEBKIT_API void
-    webkit_application_cache_set_maximum_size(unsigned long long size);
-
-    // WebKitWebDataSource private
-    WebKitWebDataSource*
-    webkit_web_data_source_new_with_loader(PassRefPtr<WebKit::DocumentLoader>);
-}
-
-#endif
diff --git a/WebKit/gtk/webkit/webkitsecurityorigin.cpp b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
index 927b76d..5f9afae 100644
--- a/WebKit/gtk/webkit/webkitsecurityorigin.cpp
+++ b/WebKit/gtk/webkit/webkitsecurityorigin.cpp
@@ -22,7 +22,7 @@
 
 #include "DatabaseTracker.h"
 #include "PlatformString.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitsecurityoriginprivate.h"
 #include <glib/gi18n-lib.h>
 #include <wtf/text/CString.h>
diff --git a/WebKit/gtk/webkit/webkitviewportattributes.cpp b/WebKit/gtk/webkit/webkitviewportattributes.cpp
index c2de5c1..9a98e44 100644
--- a/WebKit/gtk/webkit/webkitviewportattributes.cpp
+++ b/WebKit/gtk/webkit/webkitviewportattributes.cpp
@@ -22,7 +22,9 @@
 #include "webkitviewportattributes.h"
 
 #include "Chrome.h"
-#include "webkitprivate.h"
+#include "Frame.h"
+#include "Page.h"
+#include "webkitglobalsprivate.h"
 #include "webkitviewportattributesprivate.h"
 #include "webkitwebviewprivate.h"
 #include <glib/gi18n-lib.h>
diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
index c906ba3..62f7e8c 100644
--- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
+++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp
@@ -23,7 +23,8 @@
 
 #include "BackForwardListImpl.h"
 #include "HistoryItem.h"
-#include "webkitprivate.h"
+#include "Page.h"
+#include "webkitglobalsprivate.h"
 #include "webkitwebbackforwardlistprivate.h"
 #include "webkitwebhistoryitem.h"
 #include "webkitwebhistoryitemprivate.h"
@@ -84,7 +85,7 @@ static void webkit_web_back_forward_list_class_init(WebKitWebBackForwardListClas
 
     object_class->dispose = webkit_web_back_forward_list_dispose;
 
-    webkit_init();
+    webkitInit();
 
     g_type_class_add_private(klass, sizeof(WebKitWebBackForwardListPrivate));
 }
diff --git a/WebKit/gtk/webkit/webkitwebdatabase.cpp b/WebKit/gtk/webkit/webkitwebdatabase.cpp
index db72cde..1291986 100644
--- a/WebKit/gtk/webkit/webkitwebdatabase.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatabase.cpp
@@ -22,7 +22,7 @@
 
 #include "DatabaseDetails.h"
 #include "DatabaseTracker.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitsecurityoriginprivate.h"
 #include <glib/gi18n-lib.h>
 #include <wtf/text/CString.h>
diff --git a/WebKit/gtk/webkit/webkitwebdatasource.cpp b/WebKit/gtk/webkit/webkitwebdatasource.cpp
index 7d967f7..8538665 100644
--- a/WebKit/gtk/webkit/webkitwebdatasource.cpp
+++ b/WebKit/gtk/webkit/webkitwebdatasource.cpp
@@ -30,8 +30,9 @@
 #include "SharedBuffer.h"
 #include "SubstituteData.h"
 #include "runtime/InitializeThreading.h"
+#include "webkitglobalsprivate.h"
 #include "webkitnetworkrequestprivate.h"
-#include "webkitprivate.h"
+#include "webkitwebdatasourceprivate.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebresource.h"
 #include "webkitwebviewprivate.h"
@@ -126,7 +127,7 @@ static void webkit_web_data_source_class_init(WebKitWebDataSourceClass* klass)
     gobject_class->dispose = webkit_web_data_source_dispose;
     gobject_class->finalize = webkit_web_data_source_finalize;
 
-    webkit_init();
+    webkitInit();
 
     g_type_class_add_private(gobject_class, sizeof(WebKitWebDataSourcePrivate));
 }
@@ -136,15 +137,6 @@ static void webkit_web_data_source_init(WebKitWebDataSource* webDataSource)
     webDataSource->priv = G_TYPE_INSTANCE_GET_PRIVATE(webDataSource, WEBKIT_TYPE_WEB_DATA_SOURCE, WebKitWebDataSourcePrivate);
 }
 
-WebKitWebDataSource* webkit_web_data_source_new_with_loader(PassRefPtr<WebKit::DocumentLoader> loader)
-{
-    WebKitWebDataSource* webDataSource = WEBKIT_WEB_DATA_SOURCE(g_object_new(WEBKIT_TYPE_WEB_DATA_SOURCE, NULL));
-    WebKitWebDataSourcePrivate* priv = webDataSource->priv;
-    priv->loader = loader.releaseRef();
-
-    return webDataSource;
-}
-
 /**
  * webkit_web_data_source_new:
  *
@@ -182,10 +174,8 @@ WebKitWebDataSource* webkit_web_data_source_new_with_request(WebKitNetworkReques
 
     const gchar* uri = webkit_network_request_get_uri(request);
 
-    WebKitWebDataSource* datasource;
-    datasource = webkit_web_data_source_new_with_loader(
-        WebKit::DocumentLoader::create(ResourceRequest(KURL(KURL(), String::fromUTF8(uri))),
-                                       SubstituteData()));
+    ResourceRequest resourceRequest(ResourceRequest(KURL(KURL(), String::fromUTF8(uri))));
+    WebKitWebDataSource* datasource = kitNew(WebKit::DocumentLoader::create(resourceRequest, SubstituteData()));
 
     WebKitWebDataSourcePrivate* priv = datasource->priv;
     priv->initialRequest = request;
@@ -437,3 +427,16 @@ GList* webkit_web_data_source_get_subresources(WebKitWebDataSource* webDataSourc
 
     return webkit_web_view_get_subresources(webView);
 }
+
+namespace WebKit {
+
+WebKitWebDataSource* kitNew(PassRefPtr<WebKit::DocumentLoader> loader)
+{
+    WebKitWebDataSource* webDataSource = WEBKIT_WEB_DATA_SOURCE(g_object_new(WEBKIT_TYPE_WEB_DATA_SOURCE, NULL));
+    WebKitWebDataSourcePrivate* priv = webDataSource->priv;
+    priv->loader = loader.releaseRef();
+
+    return webDataSource;
+}
+
+}
diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp
index d8d25c0..d0ea875 100644
--- a/WebKit/gtk/webkit/webkitwebframe.cpp
+++ b/WebKit/gtk/webkit/webkitwebframe.cpp
@@ -51,10 +51,10 @@
 #include "ScriptController.h"
 #include "SubstituteData.h"
 #include "webkitenumtypes.h"
+#include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
 #include "webkitnetworkrequestprivate.h"
 #include "webkitnetworkresponseprivate.h"
-#include "webkitprivate.h"
 #include "webkitsecurityoriginprivate.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebview.h"
@@ -181,7 +181,7 @@ static void webkit_web_frame_finalize(GObject* object)
 
 static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
 {
-    webkit_init();
+    webkitInit();
 
     /*
      * signals
diff --git a/WebKit/gtk/webkit/webkitwebframeprivate.h b/WebKit/gtk/webkit/webkitwebframeprivate.h
index 23f1e40..80210d8 100644
--- a/WebKit/gtk/webkit/webkitwebframeprivate.h
+++ b/WebKit/gtk/webkit/webkitwebframeprivate.h
@@ -23,6 +23,9 @@
 #ifndef webkitwebframeprivate_h
 #define webkitwebframeprivate_h
 
+#include "Frame.h"
+#include "webkitwebframe.h"
+
 namespace WebKit {
 
 WebKitWebView* getViewFromFrame(WebKitWebFrame*);
diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
index ac8e57f..eabdc49 100644
--- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
+++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp
@@ -19,12 +19,11 @@
  */
 
 #include "config.h"
-
 #include "webkitwebhistoryitem.h"
-#include "webkitprivate.h"
 
 #include "HistoryItem.h"
 #include "PlatformString.h"
+#include "webkitglobalsprivate.h"
 #include "webkitwebhistoryitemprivate.h"
 #include <glib.h>
 #include <glib/gi18n-lib.h>
@@ -128,7 +127,7 @@ static void webkit_web_history_item_class_init(WebKitWebHistoryItemClass* klass)
     gobject_class->set_property = webkit_web_history_item_set_property;
     gobject_class->get_property = webkit_web_history_item_get_property;
 
-    webkit_init();
+    webkitInit();
 
     /**
     * WebKitWebHistoryItem:title:
diff --git a/WebKit/gtk/webkit/webkitwebinspector.cpp b/WebKit/gtk/webkit/webkitwebinspector.cpp
index 514085b..1fa2fad 100644
--- a/WebKit/gtk/webkit/webkitwebinspector.cpp
+++ b/WebKit/gtk/webkit/webkitwebinspector.cpp
@@ -33,8 +33,8 @@
 #include "RenderLayer.h"
 #include "RenderView.h"
 #include "webkit/WebKitDOMNodePrivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
-#include "webkitprivate.h"
 #include "webkitwebinspectorprivate.h"
 #include <glib/gi18n-lib.h>
 
diff --git a/WebKit/gtk/webkit/webkitwebnavigationaction.cpp b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
index b12279e..9f13f28 100644
--- a/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
+++ b/WebKit/gtk/webkit/webkitwebnavigationaction.cpp
@@ -18,16 +18,14 @@
  */
 
 #include "config.h"
+#include "webkitwebnavigationaction.h"
 
-#include <wtf/Assertions.h>
 #include "FrameLoaderTypes.h"
-
-#include <glib/gi18n-lib.h>
-#include "webkitwebnavigationaction.h"
-#include "webkitprivate.h"
 #include "webkitenumtypes.h"
-
+#include "webkitglobalsprivate.h"
+#include <glib/gi18n-lib.h>
 #include <string.h>
+#include <wtf/Assertions.h>
 
 static void webkit_web_navigation_action_set_target_frame(WebKitWebNavigationAction* navigationAction, const gchar* targetFrame);
 
diff --git a/WebKit/gtk/webkit/webkitwebplugin.cpp b/WebKit/gtk/webkit/webkitwebplugin.cpp
index 0b06416..52d5965 100644
--- a/WebKit/gtk/webkit/webkitwebplugin.cpp
+++ b/WebKit/gtk/webkit/webkitwebplugin.cpp
@@ -20,7 +20,7 @@
 #include "webkitwebplugin.h"
 
 #include "PluginPackage.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitwebpluginprivate.h"
 #include <glib/gi18n-lib.h>
 
@@ -98,7 +98,7 @@ static void webkit_web_plugin_set_property(GObject* object, guint prop_id, const
 
 static void webkit_web_plugin_class_init(WebKitWebPluginClass* klass)
 {
-    webkit_init();
+    webkitInit();
 
     GObjectClass* gobjectClass = reinterpret_cast<GObjectClass*>(klass);
 
diff --git a/WebKit/gtk/webkit/webkitwebplugindatabase.cpp b/WebKit/gtk/webkit/webkitwebplugindatabase.cpp
index 08328a0..2d36115 100644
--- a/WebKit/gtk/webkit/webkitwebplugindatabase.cpp
+++ b/WebKit/gtk/webkit/webkitwebplugindatabase.cpp
@@ -20,7 +20,7 @@
 #include "webkitwebplugindatabase.h"
 
 #include "PluginDatabase.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitwebplugindatabaseprivate.h"
 #include "webkitwebpluginprivate.h"
 
@@ -47,7 +47,7 @@ static void webkit_web_plugin_database_dispose(GObject* object)
 
 static void webkit_web_plugin_database_class_init(WebKitWebPluginDatabaseClass* klass)
 {
-    webkit_init();
+    webkitInit();
 
     GObjectClass* gobjectClass = reinterpret_cast<GObjectClass*>(klass);
 
diff --git a/WebKit/gtk/webkit/webkitwebpluginprivate.h b/WebKit/gtk/webkit/webkitwebpluginprivate.h
index 885313e..4ae204b 100644
--- a/WebKit/gtk/webkit/webkitwebpluginprivate.h
+++ b/WebKit/gtk/webkit/webkitwebpluginprivate.h
@@ -21,6 +21,7 @@
 
 #include "webkitwebplugin.h"
 #include <glib-object.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 class PluginPackage;
diff --git a/WebKit/gtk/webkit/webkitwebpolicydecision.cpp b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp
index 06c1fcb..624ff9a 100644
--- a/WebKit/gtk/webkit/webkitwebpolicydecision.cpp
+++ b/WebKit/gtk/webkit/webkitwebpolicydecision.cpp
@@ -20,8 +20,8 @@
 #include "config.h"
 #include "webkitwebpolicydecision.h"
 
+#include "FrameLoaderClient.h"
 #include "FrameLoaderTypes.h"
-#include "webkitprivate.h"
 #include "webkitwebframeprivate.h"
 #include "webkitwebpolicydecisionprivate.h"
 
diff --git a/WebKit/gtk/webkit/webkitwebresource.cpp b/WebKit/gtk/webkit/webkitwebresource.cpp
index c2f3a15..b7f4036 100644
--- a/WebKit/gtk/webkit/webkitwebresource.cpp
+++ b/WebKit/gtk/webkit/webkitwebresource.cpp
@@ -25,14 +25,13 @@
 #include "PlatformString.h"
 #include "SharedBuffer.h"
 #include "webkitenumtypes.h"
+#include "webkitglobalsprivate.h"
 #include "webkitmarshal.h"
-#include "webkitprivate.h"
 #include "webkitwebresourceprivate.h"
-#include <wtf/Assertions.h>
-#include <wtf/text/CString.h>
-
 #include <glib.h>
 #include <glib/gi18n-lib.h>
+#include <wtf/Assertions.h>
+#include <wtf/text/CString.h>
 
 /**
  * SECTION:webkitwebresource
@@ -44,7 +43,6 @@
  */
 
 using namespace WebCore;
-using namespace WebKit;
 
 enum {
     PROP_0,
diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp
index 92370d7..3deae30 100644
--- a/WebKit/gtk/webkit/webkitwebsettings.cpp
+++ b/WebKit/gtk/webkit/webkitwebsettings.cpp
@@ -26,16 +26,19 @@
 #include "config.h"
 #include "webkitwebsettings.h"
 
+#include "EditingBehavior.h"
 #include "FileSystem.h"
 #include "Language.h"
 #include "PluginDatabase.h"
 #include "webkitenumtypes.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
 #include "webkitversion.h"
 #include "webkitwebsettingsprivate.h"
+#include <enchant.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/StringConcatenate.h>
 #include <glib/gi18n-lib.h>
+
 #if OS(UNIX)
 #include <sys/utsname.h>
 #endif
@@ -241,7 +244,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass)
     gobject_class->set_property = webkit_web_settings_set_property;
     gobject_class->get_property = webkit_web_settings_get_property;
 
-    webkit_init();
+    webkitInit();
 
     GParamFlags flags = (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
@@ -1404,24 +1407,6 @@ void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* webView, cons
 }
 
 /**
- * webkit_web_settings_get_enchant_dicts:
- * @web_view: a #WebKitWebView
- *
- * Internal use only. Retrieves a GSList of EnchantDicts from the
- * #WebKitWebSettings of @web_view.
- *
- * Since: 1.1.22
- */
-GSList* webkit_web_settings_get_enchant_dicts(WebKitWebView* webView)
-{
-    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
-
-    WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
-
-    return settings->priv->enchant_dicts;
-}
-
-/**
  * webkit_web_settings_get_user_agent:
  * @web_settings: a #WebKitWebSettings
  *
@@ -1438,3 +1423,21 @@ G_CONST_RETURN gchar* webkit_web_settings_get_user_agent(WebKitWebSettings* webS
 
     return priv->user_agent;
 }
+
+GSList* webkitWebViewGetEnchantDicts(WebKitWebView* webView)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
+
+    WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
+
+    return settings->priv->enchant_dicts;
+}
+
+namespace WebKit {
+
+WebCore::EditingBehaviorType core(WebKitEditingBehavior type)
+{
+    return (WebCore::EditingBehaviorType)type;
+}
+
+}
diff --git a/WebKit/gtk/webkit/webkitwebsettingsprivate.h b/WebKit/gtk/webkit/webkitwebsettingsprivate.h
index e848a08..9700ba5 100644
--- a/WebKit/gtk/webkit/webkitwebsettingsprivate.h
+++ b/WebKit/gtk/webkit/webkitwebsettingsprivate.h
@@ -29,7 +29,9 @@ extern "C" {
 
 WEBKIT_API void webkit_web_settings_add_extra_plugin_directory(WebKitWebView*, const gchar* directory);
 
-GSList* webkit_web_settings_get_enchant_dicts(WebKitWebView*);
+GSList* webkitWebViewGetEnchantDicts(WebKitWebView*);
+
+WTF::String webkitUserAgent();
 
 }
 
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index c814474..b7ea21e 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -76,16 +76,17 @@
 #include "ResourceHandle.h"
 #include "ScriptValue.h"
 #include "Scrollbar.h"
+#include "Settings.h"
 #include "webkit/WebKitDOMDocumentPrivate.h"
 #include "webkitdownload.h"
 #include "webkitdownloadprivate.h"
 #include "webkitenumtypes.h"
 #include "webkitgeolocationpolicydecision.h"
+#include "webkitglobalsprivate.h"
 #include "webkithittestresultprivate.h"
 #include "webkitmarshal.h"
 #include "webkitnetworkrequest.h"
 #include "webkitnetworkresponse.h"
-#include "webkitprivate.h"
 #include "webkitviewportattributes.h"
 #include "webkitviewportattributesprivate.h"
 #include "webkitwebbackforwardlist.h"
@@ -96,7 +97,9 @@
 #include "webkitwebinspectorprivate.h"
 #include "webkitwebpolicydecision.h"
 #include "webkitwebresource.h"
+#include "webkitwebsettingsprivate.h"
 #include "webkitwebplugindatabaseprivate.h"
+#include "webkitwebwindowfeatures.h"
 #include "webkitwebviewprivate.h"
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
@@ -137,7 +140,6 @@
  */
 
 static const double defaultDPI = 96.0;
-static WebKitCacheModel cacheModel = WEBKIT_CACHE_MODEL_DEFAULT;
 static IntPoint globalPointForClientPoint(GdkWindow* window, const IntPoint& clientPoint);
 
 using namespace WebKit;
@@ -1757,7 +1759,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
 {
     GtkBindingSet* binding_set;
 
-    webkit_init();
+    webkitInit();
 
     /*
      * Signals
@@ -3330,7 +3332,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
     settings->setJavaScriptCanOpenWindowsAutomatically(javascriptCanOpenWindows);
     settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
     settings->setOfflineWebApplicationCacheEnabled(enableOfflineWebAppCache);
-    settings->setEditingBehaviorType(core(editingBehavior));
+    settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(editingBehavior));
     settings->setAllowUniversalAccessFromFileURLs(enableUniversalAccessFromFileURI);
     settings->setAllowFileAccessFromFileURLs(enableFileAccessFromFileURI);
     settings->setDOMPasteAllowed(enableDOMPaste);
@@ -3436,7 +3438,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
     else if (name == g_intern_string("enable-offline-web-application-cache"))
         settings->setOfflineWebApplicationCacheEnabled(g_value_get_boolean(&value));
     else if (name == g_intern_string("editing-behavior"))
-        settings->setEditingBehaviorType(core(static_cast<WebKitEditingBehavior>(g_value_get_enum(&value))));
+        settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(g_value_get_enum(&value)));
     else if (name == g_intern_string("enable-universal-access-from-file-uris"))
         settings->setAllowUniversalAccessFromFileURLs(g_value_get_boolean(&value));
     else if (name == g_intern_string("enable-file-access-from-file-uris"))
@@ -5050,138 +5052,6 @@ webkit_web_view_get_dom_document(WebKitWebView* webView)
     return kit(doc);
 }
 
-/**
- * SECTION:webkit
- * @short_description: Global functions controlling WebKit
- *
- * WebKit manages many resources which are not related to specific
- * views. These functions relate to cross-view limits, such as cache
- * sizes, database quotas, and the HTTP session management.
- */
-
-/**
- * webkit_get_default_session:
- *
- * Retrieves the default #SoupSession used by all web views.
- * Note that the session features are added by WebKit on demand,
- * so if you insert your own #SoupCookieJar before any network
- * traffic occurs, WebKit will use it instead of the default.
- *
- * Return value: (transfer none): the default #SoupSession
- *
- * Since: 1.1.1
- */
-SoupSession* webkit_get_default_session ()
-{
-    webkit_init();
-    return ResourceHandle::defaultSession();
-}
-
-/**
- * webkit_set_cache_model:
- * @cache_model: a #WebKitCacheModel
- *
- * Specifies a usage model for WebViews, which WebKit will use to
- * determine its caching behavior. All web views follow the cache
- * model. This cache model determines the RAM and disk space to use
- * for caching previously viewed content .
- *
- * Research indicates that users tend to browse within clusters of
- * documents that hold resources in common, and to revisit previously
- * visited documents. WebKit and the frameworks below it include
- * built-in caches that take advantage of these patterns,
- * substantially improving document load speed in browsing
- * situations. The WebKit cache model controls the behaviors of all of
- * these caches, including various WebCore caches.
- *
- * Browsers can improve document load speed substantially by
- * specifying WEBKIT_CACHE_MODEL_WEB_BROWSER. Applications without a
- * browsing interface can reduce memory usage substantially by
- * specifying WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER. Default value is
- * WEBKIT_CACHE_MODEL_WEB_BROWSER.
- *
- * Since: 1.1.18
- */
-void webkit_set_cache_model(WebKitCacheModel model)
-{
-    webkit_init();
-
-    if (cacheModel == model)
-        return;
-
-    // FIXME: Add disk cache handling when soup has the API
-    guint cacheTotalCapacity;
-    guint cacheMinDeadCapacity;
-    guint cacheMaxDeadCapacity;
-    gdouble deadDecodedDataDeletionInterval;
-    guint pageCacheCapacity;
-
-    switch (model) {
-    case WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER:
-        pageCacheCapacity = 0;
-        cacheTotalCapacity = 0;
-        cacheMinDeadCapacity = 0;
-        cacheMaxDeadCapacity = 0;
-        deadDecodedDataDeletionInterval = 0;
-        break;
-    case WEBKIT_CACHE_MODEL_WEB_BROWSER:
-        // Page cache capacity (in pages). Comment from Mac port:
-        // (Research indicates that value / page drops substantially after 3 pages.)
-        pageCacheCapacity = 3;
-        cacheTotalCapacity = 32 * 1024 * 1024;
-        cacheMinDeadCapacity = cacheTotalCapacity / 4;
-        cacheMaxDeadCapacity = cacheTotalCapacity / 2;
-        deadDecodedDataDeletionInterval = 60;
-        break;
-    default:
-        g_return_if_reached();
-    }
-
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
-    pageCache()->setCapacity(pageCacheCapacity);
-    cacheModel = model;
-}
-
-/**
- * webkit_get_cache_model:
- *
- * Returns the current cache model. For more information about this
- * value check the documentation of the function
- * webkit_set_cache_model().
- *
- * Return value: the current #WebKitCacheModel
- *
- * Since: 1.1.18
- */
-WebKitCacheModel webkit_get_cache_model()
-{
-    webkit_init();
-    return cacheModel;
-}
-
-/**
- * webkit_get_web_plugin_database:
- *
- * Returns the current #WebKitWebPluginDatabase with information about
- * all the plugins WebKit knows about in this instance.
- *
- * Return value: (transfer none): the current #WebKitWebPluginDatabase
- *
- * Since: 1.3.8
- */
-WebKitWebPluginDatabase* webkit_get_web_plugin_database()
-{
-    static WebKitWebPluginDatabase* database = 0;
-
-    webkit_init();
-
-    if (!database)
-        database = webkit_web_plugin_database_new();
-
-    return database;
-}
-
 GtkMenu* webkit_web_view_get_context_menu(WebKitWebView* webView)
 {
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
diff --git a/WebKit/gtk/webkit/webkitwebview.h b/WebKit/gtk/webkit/webkitwebview.h
index 9abfef6..1838bfe 100644
--- a/WebKit/gtk/webkit/webkitwebview.h
+++ b/WebKit/gtk/webkit/webkitwebview.h
@@ -50,24 +50,6 @@ typedef enum {
     WEBKIT_NAVIGATION_RESPONSE_DOWNLOAD
 } WebKitNavigationResponse;
 
-/*  
- * WebKitCacheModel:
- * @WEBKIT_CACHE_MODEL_DEFAULT: The default cache model. This is
- *   WEBKIT_CACHE_MODEL_WEB_BROWSER.
- * @WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER: Disable the cache completely, which 
- *   substantially reduces memory usage. Useful for applications that only
- *   access local files.
- * @WEBKIT_CACHE_MODEL_WEB_BROWSER: Improve document load speed substantially
- *   by caching previously viewed content.
- * 
- * Enum values used for determining the webview cache model.
- */
-typedef enum {
-    WEBKIT_CACHE_MODEL_DEFAULT,
-    WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER,
-    WEBKIT_CACHE_MODEL_WEB_BROWSER
-} WebKitCacheModel;
-
 typedef enum
 {
     WEBKIT_WEB_VIEW_TARGET_INFO_HTML,
@@ -361,12 +343,6 @@ WEBKIT_API void
 webkit_web_view_set_full_content_zoom           (WebKitWebView        *webView,
                                                  gboolean              full_content_zoom);
 
-WEBKIT_API SoupSession*
-webkit_get_default_session                      (void);
-
-WEBKIT_API WebKitWebPluginDatabase *
-webkit_get_web_plugin_database                  (void);
-
 WEBKIT_API const gchar*
 webkit_web_view_get_encoding                    (WebKitWebView        * webView);
 
@@ -421,12 +397,6 @@ webkit_web_view_get_hit_test_result             (WebKitWebView        *webView,
 WEBKIT_API G_CONST_RETURN gchar *
 webkit_web_view_get_icon_uri                    (WebKitWebView        *webView);
 
-WEBKIT_API void
-webkit_set_cache_model                          (WebKitCacheModel     cache_model);
-
-WEBKIT_API WebKitCacheModel
-webkit_get_cache_model                          (void);
-
 WEBKIT_API WebKitDOMDocument *
 webkit_web_view_get_dom_document                (WebKitWebView        *webView);
 
diff --git a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
index ddc657d..93e08ac 100644
--- a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
+++ b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
@@ -19,10 +19,11 @@
  */
 
 #include "config.h"
+#include "webkitwebwindowfeatures.h"
 
 #include "WindowFeatures.h"
-#include "webkitwebwindowfeatures.h"
-#include "webkitprivate.h"
+#include "webkitglobalsprivate.h"
+#include "webkitwebwindowfeaturesprivate.h"
 
 /**
  * SECTION:webkitwebwindowfeatures
@@ -100,7 +101,7 @@ static void webkit_web_window_features_class_init(WebKitWebWindowFeaturesClass*
 
     GParamFlags flags = (GParamFlags)(WEBKIT_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 
-    webkit_init();
+    webkitInit();
 
     /**
      * WebKitWebWindowFeatures:x:
@@ -378,35 +379,6 @@ WebKitWebWindowFeatures* webkit_web_window_features_new()
     return WEBKIT_WEB_WINDOW_FEATURES(g_object_new(WEBKIT_TYPE_WEB_WINDOW_FEATURES, NULL));
 }
 
-// for internal use only
-WebKitWebWindowFeatures* webkit_web_window_features_new_from_core_features(const WebCore::WindowFeatures& features)
-{
-    WebKitWebWindowFeatures *webWindowFeatures = webkit_web_window_features_new();
-
-    if(features.xSet)
-        g_object_set(webWindowFeatures, "x", static_cast<int>(features.x), NULL);
-
-    if(features.ySet)
-        g_object_set(webWindowFeatures, "y", static_cast<int>(features.y), NULL);
-
-    if(features.widthSet)
-        g_object_set(webWindowFeatures, "width", static_cast<int>(features.width), NULL);
-
-    if(features.heightSet)
-        g_object_set(webWindowFeatures, "height", static_cast<int>(features.height), NULL);
-
-    g_object_set(webWindowFeatures,
-                 "toolbar-visible", features.toolBarVisible,
-                 "statusbar-visible", features.statusBarVisible,
-                 "scrollbar-visible", features.scrollbarsVisible,
-                 "menubar-visible", features.menuBarVisible,
-                 "locationbar-visible", features.locationBarVisible,
-                 "fullscreen", features.fullscreen,
-                 NULL);
-
-    return webWindowFeatures;
-}
-
 /**
  * webkit_web_window_features_equal:
  * @features1: a #WebKitWebWindowFeatures instance
@@ -443,3 +415,35 @@ gboolean webkit_web_window_features_equal(WebKitWebWindowFeatures* features1, We
         return TRUE;
     return FALSE;
 }
+
+namespace WebKit {
+
+WebKitWebWindowFeatures* kitNew(const WebCore::WindowFeatures& features)
+{
+    WebKitWebWindowFeatures *webWindowFeatures = webkit_web_window_features_new();
+
+    if(features.xSet)
+        g_object_set(webWindowFeatures, "x", static_cast<int>(features.x), NULL);
+
+    if(features.ySet)
+        g_object_set(webWindowFeatures, "y", static_cast<int>(features.y), NULL);
+
+    if(features.widthSet)
+        g_object_set(webWindowFeatures, "width", static_cast<int>(features.width), NULL);
+
+    if(features.heightSet)
+        g_object_set(webWindowFeatures, "height", static_cast<int>(features.height), NULL);
+
+    g_object_set(webWindowFeatures,
+                 "toolbar-visible", features.toolBarVisible,
+                 "statusbar-visible", features.statusBarVisible,
+                 "scrollbar-visible", features.scrollbarsVisible,
+                 "menubar-visible", features.menuBarVisible,
+                 "locationbar-visible", features.locationBarVisible,
+                 "fullscreen", features.fullscreen,
+                 NULL);
+
+    return webWindowFeatures;
+}
+
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list