summaryrefslogtreecommitdiffstats
path: root/WebKit/gtk/webkit/webkitprivate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/gtk/webkit/webkitprivate.cpp')
-rw-r--r--WebKit/gtk/webkit/webkitprivate.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp
index c80160c..be88bb5 100644
--- a/WebKit/gtk/webkit/webkitprivate.cpp
+++ b/WebKit/gtk/webkit/webkitprivate.cpp
@@ -23,6 +23,7 @@
#include "webkitsoupauthdialog.h"
#include "webkitprivate.h"
#include "ApplicationCacheStorage.h"
+#include "Chrome.h"
#include "ChromeClientGtk.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -42,6 +43,7 @@
#include <runtime/InitializeThreading.h>
#include "SecurityOrigin.h"
#include <stdlib.h>
+#include "TextEncodingRegistry.h"
#include "webkitnetworkresponse.h"
#if ENABLE(DATABASE)
@@ -221,7 +223,11 @@ static GtkWidget* currentToplevelCallback(WebKitSoupAuthDialog* feature, SoupMes
return NULL;
GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(frame->page()->chrome()->platformPageClient()));
+#if GTK_CHECK_VERSION(2, 18, 0)
+ if (gtk_widget_is_toplevel(toplevel))
+#else
if (GTK_WIDGET_TOPLEVEL(toplevel))
+#endif
return toplevel;
else
return NULL;
@@ -245,10 +251,14 @@ void webkit_init()
JSC::initializeThreading();
WebCore::InitializeLoggingChannelsIfNecessary();
+ // We make sure the text codecs have been initialized, because
+ // that may only be done by the main thread.
+ atomicCanonicalTextEncodingName("UTF-8");
+
// 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);
+ webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER);
#if ENABLE(DATABASE)
gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
@@ -280,6 +290,8 @@ void webkit_init()
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);
}
void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains)