Created
December 10, 2010 14:20
-
-
Save anonymous/736251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog | |
index 6bac927..2bda3c2 100644 | |
--- a/JavaScriptCore/ChangeLog | |
+++ b/JavaScriptCore/ChangeLog | |
@@ -1,3 +1,15 @@ | |
+2010-12-10 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu> | |
+ | |
+ Unreviewed, rolling out r73703, r73705, and r73712. | |
+ http://trac.webkit.org/changeset/73703 | |
+ http://trac.webkit.org/changeset/73705 | |
+ http://trac.webkit.org/changeset/73712 | |
+ https://bugs.webkit.org/show_bug.cgi?id=49658 | |
+ | |
+ Some reason ... | |
+ | |
+ * wtf/PlatformRefPtr.h: | |
+ | |
2010-12-10 Patrick Gansterer <paroga@webkit.org> | |
Reviewed by Eric Seidel. | |
diff --git a/JavaScriptCore/wtf/PlatformRefPtr.h b/JavaScriptCore/wtf/PlatformRefPtr.h | |
index e4f1314..8ac16cb 100644 | |
--- a/JavaScriptCore/wtf/PlatformRefPtr.h | |
+++ b/JavaScriptCore/wtf/PlatformRefPtr.h | |
@@ -74,13 +74,6 @@ public: | |
derefPlatformPtr(ptr); | |
} | |
- T* leakRef() WARN_UNUSED_RETURN | |
- { | |
- T* ptr = m_ptr; | |
- m_ptr = 0; | |
- return ptr; | |
- } | |
- | |
// Hash table deleted values, which are only constructed and never copied or destroyed. | |
PlatformRefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } | |
bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); } | |
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog | |
index cc88e4b..1008a86 100644 | |
--- a/WebCore/ChangeLog | |
+++ b/WebCore/ChangeLog | |
@@ -1,3 +1,38 @@ | |
+2010-12-10 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu> | |
+ | |
+ Unreviewed, rolling out r73703, r73705, and r73712. | |
+ http://trac.webkit.org/changeset/73703 | |
+ http://trac.webkit.org/changeset/73705 | |
+ http://trac.webkit.org/changeset/73712 | |
+ https://bugs.webkit.org/show_bug.cgi?id=49658 | |
+ | |
+ Some reason ... | |
+ | |
+ * platform/ContextMenuItem.h: | |
+ (WebCore::PlatformMenuItemDescription::PlatformMenuItemDescription): | |
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: | |
+ (WebCore::MediaPlayerPrivateGStreamer::startEndPointTimerIfNeeded): | |
+ (WebCore::MediaPlayerPrivateGStreamer::cancelSeek): | |
+ (WebCore::MediaPlayerPrivateGStreamer::endPointTimerFired): | |
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: | |
+ * platform/gtk/ContextMenuGtk.cpp: | |
+ (WebCore::ContextMenu::appendItem): | |
+ * platform/gtk/ContextMenuItemGtk.cpp: | |
+ (WebCore::ContextMenuItem::ContextMenuItem): | |
+ (WebCore::ContextMenuItem::~ContextMenuItem): | |
+ (WebCore::ContextMenuItem::createNativeMenuItem): | |
+ (WebCore::ContextMenuItem::releasePlatformDescription): | |
+ (WebCore::ContextMenuItem::type): | |
+ (WebCore::ContextMenuItem::setType): | |
+ (WebCore::ContextMenuItem::action): | |
+ (WebCore::ContextMenuItem::setAction): | |
+ (WebCore::ContextMenuItem::title): | |
+ (WebCore::ContextMenuItem::setTitle): | |
+ (WebCore::ContextMenuItem::platformSubMenu): | |
+ (WebCore::ContextMenuItem::setSubMenu): | |
+ (WebCore::ContextMenuItem::setChecked): | |
+ (WebCore::ContextMenuItem::setEnabled): | |
+ | |
2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | |
Reviewed by nobody, build fix. | |
diff --git a/WebCore/platform/ContextMenuItem.h b/WebCore/platform/ContextMenuItem.h | |
index e0a008d..e702921 100644 | |
--- a/WebCore/platform/ContextMenuItem.h | |
+++ b/WebCore/platform/ContextMenuItem.h | |
@@ -42,7 +42,6 @@ class NSMenuItem; | |
#elif PLATFORM(WIN) | |
typedef struct tagMENUITEMINFOW* LPMENUITEMINFO; | |
#elif PLATFORM(GTK) | |
-#include <GRefPtr.h> | |
typedef struct _GtkMenuItem GtkMenuItem; | |
#elif PLATFORM(QT) | |
#include <QAction> | |
@@ -186,7 +185,22 @@ namespace WebCore { | |
bool enabled; | |
}; | |
#elif PLATFORM(GTK) | |
- typedef GtkMenuItem* PlatformMenuItemDescription; | |
+ struct PlatformMenuItemDescription { | |
+ PlatformMenuItemDescription() | |
+ : type(ActionType) | |
+ , action(ContextMenuItemTagNoAction) | |
+ , subMenu(0) | |
+ , checked(false) | |
+ , enabled(true) | |
+ {} | |
+ | |
+ ContextMenuItemType type; | |
+ ContextMenuAction action; | |
+ String title; | |
+ GtkMenu* subMenu; | |
+ bool checked; | |
+ bool enabled; | |
+ }; | |
#elif PLATFORM(WX) | |
struct PlatformMenuItemDescription { | |
PlatformMenuItemDescription() | |
@@ -246,7 +260,9 @@ namespace WebCore { | |
ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, bool enabled, bool checked); | |
ContextMenuItem(ContextMenuAction, const String&, bool enabled, bool checked, Vector<ContextMenuItem>& submenuItems); | |
- | |
+#if PLATFORM(GTK) | |
+ ContextMenuItem(GtkMenuItem*); | |
+#endif | |
~ContextMenuItem(); | |
PlatformMenuItemDescription releasePlatformDescription(); | |
@@ -271,12 +287,13 @@ namespace WebCore { | |
bool enabled() const; | |
// FIXME: Do we need a keyboard accelerator here? | |
+#if PLATFORM(GTK) | |
+ static GtkMenuItem* createNativeMenuItem(const PlatformMenuItemDescription&); | |
+#endif | |
private: | |
#if PLATFORM(MAC) | |
RetainPtr<NSMenuItem> m_platformDescription; | |
-#elif PLATFORM(GTK) | |
- PlatformRefPtr<GtkMenuItem> m_platformDescription; | |
#else | |
PlatformMenuItemDescription m_platformDescription; | |
#endif | |
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
index 3cddd2e..7bfdea2 100644 | |
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp | |
@@ -526,6 +526,21 @@ void MediaPlayerPrivateGStreamer::seek(float time) | |
} | |
} | |
+void MediaPlayerPrivateGStreamer::startEndPointTimerIfNeeded() | |
+{ | |
+ notImplemented(); | |
+} | |
+ | |
+void MediaPlayerPrivateGStreamer::cancelSeek() | |
+{ | |
+ notImplemented(); | |
+} | |
+ | |
+void MediaPlayerPrivateGStreamer::endPointTimerFired(Timer<MediaPlayerPrivateGStreamer>*) | |
+{ | |
+ notImplemented(); | |
+} | |
+ | |
bool MediaPlayerPrivateGStreamer::paused() const | |
{ | |
return m_paused; | |
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h | |
index 11eb81b..46943ac 100644 | |
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h | |
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h | |
@@ -147,7 +147,10 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface { | |
void cacheDuration(); | |
void updateStates(); | |
+ void cancelSeek(); | |
+ void endPointTimerFired(Timer<MediaPlayerPrivateGStreamer>*); | |
float maxTimeLoaded() const; | |
+ void startEndPointTimerIfNeeded(); | |
void createGSTPlayBin(); | |
bool changePipelineState(GstState state); | |
diff --git a/WebCore/platform/gtk/ContextMenuGtk.cpp b/WebCore/platform/gtk/ContextMenuGtk.cpp | |
index 423959a..327167e 100644 | |
--- a/WebCore/platform/gtk/ContextMenuGtk.cpp | |
+++ b/WebCore/platform/gtk/ContextMenuGtk.cpp | |
@@ -40,7 +40,7 @@ void ContextMenu::appendItem(ContextMenuItem& item) | |
{ | |
ASSERT(m_platformDescription); | |
- GtkMenuItem* platformItem = item.releasePlatformDescription(); | |
+ GtkMenuItem* platformItem = ContextMenuItem::createNativeMenuItem(item.releasePlatformDescription()); | |
ASSERT(platformItem); | |
gtk_menu_shell_append(GTK_MENU_SHELL(m_platformDescription), GTK_WIDGET(platformItem)); | |
gtk_widget_show(GTK_WIDGET(platformItem)); | |
diff --git a/WebCore/platform/gtk/ContextMenuItemGtk.cpp b/WebCore/platform/gtk/ContextMenuItemGtk.cpp | |
index 37c29b5..68d0a9a 100644 | |
--- a/WebCore/platform/gtk/ContextMenuItemGtk.cpp | |
+++ b/WebCore/platform/gtk/ContextMenuItemGtk.cpp | |
@@ -18,14 +18,13 @@ | |
*/ | |
#include "config.h" | |
-#include "ContextMenuItem.h" | |
- | |
#include "ContextMenu.h" | |
-#include "GOwnPtr.h" | |
+#include "ContextMenuItem.h" | |
#include "NotImplemented.h" | |
-#include <gtk/gtk.h> | |
#include <wtf/text/CString.h> | |
+#include <gtk/gtk.h> | |
+ | |
#define WEBKIT_CONTEXT_MENU_ACTION "webkit-context-menu" | |
namespace WebCore { | |
@@ -115,9 +114,30 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti | |
} | |
// Extract the ActionType from the menu item | |
-ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item) | |
- : m_platformDescription(item) | |
+ContextMenuItem::ContextMenuItem(GtkMenuItem* item) | |
+ : m_platformDescription() | |
{ | |
+ if (GTK_IS_SEPARATOR_MENU_ITEM(item)) | |
+ m_platformDescription.type = SeparatorType; | |
+ else if (gtk_menu_item_get_submenu(item)) | |
+ m_platformDescription.type = SubmenuType; | |
+ else if (GTK_IS_CHECK_MENU_ITEM(item)) { | |
+ m_platformDescription.type = CheckableActionType; | |
+ m_platformDescription.checked = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); | |
+ } else | |
+ m_platformDescription.type = ActionType; | |
+#if GTK_CHECK_VERSION (2, 16, 0) | |
+ m_platformDescription.title = String::fromUTF8(gtk_menu_item_get_label(GTK_MENU_ITEM(item))); | |
+#else | |
+ GtkWidget* label = gtk_bin_get_child(GTK_BIN(item)); | |
+ m_platformDescription.title = String::fromUTF8(gtk_label_get_label(GTK_LABEL(label))); | |
+#endif | |
+ | |
+ m_platformDescription.action = *static_cast<ContextMenuAction*>(g_object_get_data(G_OBJECT(item), WEBKIT_CONTEXT_MENU_ACTION)); | |
+ | |
+ m_platformDescription.subMenu = GTK_MENU(gtk_menu_item_get_submenu(item)); | |
+ if (m_platformDescription.subMenu) | |
+ g_object_ref(m_platformDescription.subMenu); | |
} | |
ContextMenuItem::ContextMenuItem(ContextMenu*) | |
@@ -127,100 +147,114 @@ ContextMenuItem::ContextMenuItem(ContextMenu*) | |
ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, const String& title, ContextMenu* subMenu) | |
{ | |
- if (type == SeparatorType) { | |
- m_platformDescription = GTK_MENU_ITEM(gtk_separator_menu_item_new()); | |
- return; | |
- } | |
+ m_platformDescription.type = type; | |
+ m_platformDescription.action = action; | |
+ m_platformDescription.title = title; | |
+ | |
+ setSubMenu(subMenu); | |
+} | |
- GOwnPtr<char> actionName(g_strdup_printf("context-menu-action-%d", action)); | |
- GtkAction* platformAction = 0; | |
+ContextMenuItem::~ContextMenuItem() | |
+{ | |
+ if (m_platformDescription.subMenu) | |
+ g_object_unref(m_platformDescription.subMenu); | |
+} | |
- if (type == ActionType) | |
- platformAction = gtk_action_new(actionName.get(), title.utf8().data(), 0, gtkStockIDFromContextMenuAction(action)); | |
- else if (type == CheckableActionType) | |
- platformAction = GTK_ACTION(gtk_toggle_action_new(actionName.get(), title.utf8().data(), 0, gtkStockIDFromContextMenuAction(action))); | |
+GtkMenuItem* ContextMenuItem::createNativeMenuItem(const PlatformMenuItemDescription& menu) | |
+{ | |
+ GtkMenuItem* item = 0; | |
+ if (menu.type == SeparatorType) | |
+ item = GTK_MENU_ITEM(gtk_separator_menu_item_new()); | |
+ else { | |
+ if (menu.type == CheckableActionType) { | |
+ item = GTK_MENU_ITEM(gtk_check_menu_item_new_with_mnemonic(menu.title.utf8().data())); | |
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), menu.checked); | |
+ } else { | |
+ if (const gchar* stockID = gtkStockIDFromContextMenuAction(menu.action)) { | |
+ item = GTK_MENU_ITEM(gtk_image_menu_item_new_with_mnemonic(menu.title.utf8().data())); | |
+ GtkWidget* image = gtk_image_new_from_stock(stockID, GTK_ICON_SIZE_MENU); | |
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image); | |
+ } else | |
+ item = GTK_MENU_ITEM(gtk_menu_item_new_with_mnemonic(menu.title.utf8().data())); | |
+ } | |
- m_platformDescription = GTK_MENU_ITEM(gtk_action_create_menu_item(platformAction)); | |
- g_object_unref(platformAction); | |
+ ContextMenuAction* menuAction = static_cast<ContextMenuAction*>(malloc(sizeof(ContextMenuAction*))); | |
+ *menuAction = menu.action; | |
+ g_object_set_data(G_OBJECT(item), WEBKIT_CONTEXT_MENU_ACTION, menuAction); | |
- g_object_set_data(G_OBJECT(m_platformDescription.get()), WEBKIT_CONTEXT_MENU_ACTION, GINT_TO_POINTER(action)); | |
+ gtk_widget_set_sensitive(GTK_WIDGET(item), menu.enabled); | |
- if (subMenu) | |
- setSubMenu(subMenu); | |
-} | |
+ if (menu.subMenu) | |
+ gtk_menu_item_set_submenu(item, GTK_WIDGET(menu.subMenu)); | |
+ } | |
-ContextMenuItem::~ContextMenuItem() | |
-{ | |
+ return item; | |
} | |
PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription() | |
{ | |
- return m_platformDescription.leakRef(); | |
+ PlatformMenuItemDescription description = m_platformDescription; | |
+ m_platformDescription = PlatformMenuItemDescription(); | |
+ return description; | |
} | |
ContextMenuItemType ContextMenuItem::type() const | |
{ | |
- if (GTK_IS_SEPARATOR_MENU_ITEM(m_platformDescription.get())) | |
- return SeparatorType; | |
- if (GTK_IS_CHECK_MENU_ITEM(m_platformDescription.get())) | |
- return CheckableActionType; | |
- if (gtk_menu_item_get_submenu(m_platformDescription.get())) | |
- return SubmenuType; | |
- return ActionType; | |
+ return m_platformDescription.type; | |
} | |
void ContextMenuItem::setType(ContextMenuItemType type) | |
{ | |
- if (type == SeparatorType) | |
- m_platformDescription = GTK_MENU_ITEM(gtk_separator_menu_item_new()); | |
+ m_platformDescription.type = type; | |
} | |
ContextMenuAction ContextMenuItem::action() const | |
{ | |
- return static_cast<ContextMenuAction>(GPOINTER_TO_INT(g_object_get_data(G_OBJECT(m_platformDescription.get()), WEBKIT_CONTEXT_MENU_ACTION))); | |
+ return m_platformDescription.action; | |
} | |
void ContextMenuItem::setAction(ContextMenuAction action) | |
{ | |
- g_object_set_data(G_OBJECT(m_platformDescription.get()), WEBKIT_CONTEXT_MENU_ACTION, GINT_TO_POINTER(action)); | |
+ m_platformDescription.action = action; | |
} | |
String ContextMenuItem::title() const | |
{ | |
- GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(m_platformDescription.get())); | |
- return action ? String(gtk_action_get_label(action)) : String(); | |
+ return m_platformDescription.title; | |
} | |
void ContextMenuItem::setTitle(const String& title) | |
{ | |
- GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(m_platformDescription.get())); | |
- if (action) | |
- gtk_action_set_label(action, title.utf8().data()); | |
+ m_platformDescription.title = title; | |
} | |
PlatformMenuDescription ContextMenuItem::platformSubMenu() const | |
{ | |
- GtkWidget* subMenu = gtk_menu_item_get_submenu(m_platformDescription.get()); | |
- return subMenu ? GTK_MENU(subMenu) : 0; | |
+ return m_platformDescription.subMenu; | |
} | |
void ContextMenuItem::setSubMenu(ContextMenu* menu) | |
{ | |
- gtk_menu_item_set_submenu(m_platformDescription.get(), GTK_WIDGET(menu->platformDescription())); | |
+ if (m_platformDescription.subMenu) | |
+ g_object_unref(m_platformDescription.subMenu); | |
+ | |
+ if (!menu) | |
+ return; | |
+ | |
+ m_platformDescription.subMenu = menu->releasePlatformDescription(); | |
+ m_platformDescription.type = SubmenuType; | |
+ | |
+ g_object_ref_sink(G_OBJECT(m_platformDescription.subMenu)); | |
} | |
void ContextMenuItem::setChecked(bool shouldCheck) | |
{ | |
- GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(m_platformDescription.get())); | |
- if (action && GTK_IS_TOGGLE_ACTION(action)) | |
- gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), shouldCheck); | |
+ m_platformDescription.checked = shouldCheck; | |
} | |
void ContextMenuItem::setEnabled(bool shouldEnable) | |
{ | |
- GtkAction* action = gtk_activatable_get_related_action(GTK_ACTIVATABLE(m_platformDescription.get())); | |
- if (action) | |
- gtk_action_set_sensitive(action, shouldEnable); | |
+ m_platformDescription.enabled = shouldEnable; | |
} | |
} | |
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog | |
index e4fa143..1a00c1f 100644 | |
--- a/WebKitTools/ChangeLog | |
+++ b/WebKitTools/ChangeLog | |
@@ -1,3 +1,22 @@ | |
+2010-12-10 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu> | |
+ | |
+ Unreviewed, rolling out r73703, r73705, and r73712. | |
+ http://trac.webkit.org/changeset/73703 | |
+ http://trac.webkit.org/changeset/73705 | |
+ http://trac.webkit.org/changeset/73712 | |
+ https://bugs.webkit.org/show_bug.cgi?id=49658 | |
+ | |
+ Some reason ... | |
+ | |
+ * QtTestBrowser/launcherwindow.cpp: | |
+ (LauncherWindow::initializeView): | |
+ (LauncherWindow::createChrome): | |
+ * QtTestBrowser/launcherwindow.h: | |
+ (WindowOptions::WindowOptions): | |
+ * QtTestBrowser/webpage.cpp: | |
+ (WebPage::WebPage): | |
+ * QtTestBrowser/webpage.h: | |
+ | |
2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | |
Reviewed by Kenneth Rohde Christiansen. | |
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp | |
index 1a4d28f..7608063 100644 | |
--- a/WebKitTools/QtTestBrowser/launcherwindow.cpp | |
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp | |
@@ -95,7 +95,6 @@ void LauncherWindow::initializeView() | |
QUrl url = page()->mainFrame()->url(); | |
setPage(new WebPage(this)); | |
- page()->setQnamThreaded(m_windowOptions.useThreadedQnam); | |
QSplitter* splitter = static_cast<QSplitter*>(centralWidget()); | |
@@ -235,10 +234,6 @@ void LauncherWindow::createChrome() | |
toggleWebGL->setCheckable(true); | |
toggleWebGL->setChecked(settings->testAttribute(QWebSettings::WebGLEnabled)); | |
- QAction* toggleThreadedQnam = toolsMenu->addAction("Toggle threaded network", this, SLOT(toggleThreadedQnam(bool))); | |
- toggleThreadedQnam->setCheckable(true); | |
- toggleThreadedQnam->setChecked(m_windowOptions.useThreadedQnam); | |
- | |
QAction* spatialNavigationAction = toolsMenu->addAction("Toggle Spatial Navigation", this, SLOT(toggleSpatialNavigation(bool))); | |
spatialNavigationAction->setCheckable(true); | |
spatialNavigationAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_S)); | |
@@ -707,12 +702,6 @@ void LauncherWindow::toggleWebGL(bool toggle) | |
page()->settings()->setAttribute(QWebSettings::WebGLEnabled, toggle); | |
} | |
-void LauncherWindow::toggleThreadedQnam(bool toggle) | |
-{ | |
- m_windowOptions.useThreadedQnam = toggle; | |
- page()->setQnamThreaded(toggle); | |
-} | |
- | |
void LauncherWindow::animatedFlip() | |
{ | |
qobject_cast<WebViewGraphicsBased*>(m_view)->animatedFlip(); | |
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h | |
index e35e7fd..84dedaa 100644 | |
--- a/WebKitTools/QtTestBrowser/launcherwindow.h | |
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h | |
@@ -87,7 +87,6 @@ public: | |
#else | |
, useFrameFlattening(false) | |
#endif | |
- , useThreadedQnam(true) | |
, cacheWebView(false) | |
, showFrameRate(false) | |
, resizesToContents(false) | |
@@ -103,7 +102,6 @@ public: | |
bool useTiledBackingStore; | |
bool useWebGL; | |
bool useFrameFlattening; | |
- bool useThreadedQnam; | |
bool cacheWebView; | |
bool showFrameRate; | |
bool resizesToContents; | |
@@ -155,7 +153,6 @@ protected slots: | |
void toggleTiledBackingStore(bool toggle); | |
void toggleResizesToContents(bool toggle); | |
void toggleWebGL(bool toggle); | |
- void toggleThreadedQnam(bool toggle); | |
void toggleSpatialNavigation(bool b); | |
void toggleFullScreenMode(bool enable); | |
void toggleFrameFlattening(bool toggle); | |
diff --git a/WebKitTools/QtTestBrowser/webpage.cpp b/WebKitTools/QtTestBrowser/webpage.cpp | |
index 15f6db0..b6caf67 100644 | |
--- a/WebKitTools/QtTestBrowser/webpage.cpp | |
+++ b/WebKitTools/QtTestBrowser/webpage.cpp | |
@@ -48,6 +48,8 @@ WebPage::WebPage(QObject* parent) | |
{ | |
applyProxy(); | |
+ connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), | |
+ this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); | |
connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); | |
connect(this, SIGNAL(featurePermissionRequestCanceled(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequestCanceled(QWebFrame*, QWebPage::Feature))); | |
} | |
@@ -119,28 +121,6 @@ QString WebPage::userAgentForUrl(const QUrl& url) const | |
return QWebPage::userAgentForUrl(url); | |
} | |
-void WebPage::setQnamThreaded(bool threaded) | |
-{ | |
- bool alreadyThreaded = networkAccessManager()->thread() != thread(); | |
- if (threaded == alreadyThreaded) | |
- return; | |
- | |
- if (threaded) { | |
- m_qnamThread.reset(new QtNAMThread); | |
- m_qnamThread->start(); | |
- setNetworkAccessManager(m_qnamThread->networkAccessManager()); | |
- } else { | |
- setNetworkAccessManager(0); | |
- m_qnamThread.reset(); | |
- } | |
- | |
- Qt::ConnectionType connectionType = threaded ? Qt::BlockingQueuedConnection : Qt::DirectConnection; | |
- connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), | |
- this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)), | |
- connectionType); | |
- applyProxy(); | |
-} | |
- | |
bool WebPage::shouldInterruptJavaScript() | |
{ | |
if (!m_interruptingJavaScriptEnabled) | |
diff --git a/WebKitTools/QtTestBrowser/webpage.h b/WebKitTools/QtTestBrowser/webpage.h | |
index e62402b..01f3f6a 100644 | |
--- a/WebKitTools/QtTestBrowser/webpage.h | |
+++ b/WebKitTools/QtTestBrowser/webpage.h | |
@@ -33,14 +33,9 @@ | |
#ifndef webpage_h | |
#define webpage_h | |
-#include <QFuture> | |
-#include <QScopedPointer> | |
-#include <QThread> | |
#include <qwebframe.h> | |
#include <qwebpage.h> | |
-class QtNAMThread; | |
- | |
class WebPage : public QWebPage { | |
Q_OBJECT | |
@@ -56,7 +51,6 @@ public: | |
QString userAgentForUrl(const QUrl& url) const; | |
void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; } | |
- void setQnamThreaded(bool threaded); | |
public slots: | |
void openUrlInDefaultBrowser(const QUrl& url = QUrl()); | |
@@ -70,36 +64,6 @@ private: | |
void applyProxy(); | |
QString m_userAgent; | |
bool m_interruptingJavaScriptEnabled; | |
- QScopedPointer<QtNAMThread> m_qnamThread; | |
-}; | |
- | |
- | |
-class QtNAMThread : public QThread { | |
-public: | |
- QtNAMThread() | |
- { | |
- m_qnamFuture.reportStarted(); | |
- } | |
- ~QtNAMThread() | |
- { | |
- quit(); | |
- wait(); | |
- } | |
- | |
- QFuture<QNetworkAccessManager*> networkAccessManager() | |
- { | |
- return m_qnamFuture.future(); | |
- } | |
-protected: | |
- void run() | |
- { | |
- QNetworkAccessManager qnam; | |
- m_qnamFuture.reportResult(&qnam); | |
- m_qnamFuture.reportFinished(); | |
- exec(); | |
- } | |
-private: | |
- QFutureInterface<QNetworkAccessManager*> m_qnamFuture; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment