diff options
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage')
| -rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebInspector.cpp | 6 | ||||
| -rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 6 | ||||
| -rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.h | 1 | ||||
| -rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.messages.in | 10 | ||||
| -rw-r--r-- | Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp | 11 |
5 files changed, 24 insertions, 10 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp index 87573f9ea..68d3b0c41 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp @@ -195,10 +195,8 @@ void WebInspector::setJavaScriptProfilingEnabled(bool enabled) m_page->corePage()->inspectorController()->show(); if (!m_frontendClient) return; - if (enabled) - m_page->corePage()->inspectorController()->enableProfiler(); - else - m_page->corePage()->inspectorController()->disableProfiler(); + + m_page->corePage()->inspectorController()->setProfilerEnabled(enabled); #endif } diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index a07b675f9..6f1827cc1 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -2146,10 +2146,11 @@ void WebPage::performDragControllerAction(uint64_t action, WebCore::DragData dra send(Messages::WebPageProxy::DidPerformDragControllerAction(WebCore::DragSession())); #if PLATFORM(QT) QMimeData* data = const_cast<QMimeData*>(dragData.platformData()); + delete data; #elif PLATFORM(GTK) DataObjectGtk* data = const_cast<DataObjectGtk*>(dragData.platformData()); + data->deref(); #endif - delete data; return; } @@ -2177,10 +2178,11 @@ void WebPage::performDragControllerAction(uint64_t action, WebCore::DragData dra // DragData does not delete its platformData so we need to do that here. #if PLATFORM(QT) QMimeData* data = const_cast<QMimeData*>(dragData.platformData()); + delete data; #elif PLATFORM(GTK) DataObjectGtk* data = const_cast<DataObjectGtk*>(dragData.platformData()); + data->deref(); #endif - delete data; } #else diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 4b2b76c8c..3b7e6e64f 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -523,6 +523,7 @@ public: void registerApplicationScheme(const String& scheme); void applicationSchemeReply(const QtNetworkReplyData&); void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*); + void setUserScripts(const Vector<String>&); #endif void wheelEvent(const WebWheelEvent&); #if ENABLE(GESTURE_EVENTS) diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 4bab8ac42..f14fcb6c9 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -40,6 +40,7 @@ messages -> WebPage { #if ENABLE(TOUCH_EVENTS) TouchEvent(WebKit::WebTouchEvent event) TouchEventSyncForTesting(WebKit::WebTouchEvent event) -> (bool handled) +#endif #if ENABLE(TOUCH_EVENTS) && PLATFORM(QT) HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area) #endif @@ -68,6 +69,7 @@ messages -> WebPage { #if PLATFORM(QT) ApplicationSchemeReply(WebKit::QtNetworkReplyData reply) RegisterApplicationScheme(WTF::String scheme) + SetUserScripts(WTF::Vector<WTF::String> script) #endif StopLoadingFrame(uint64_t frameID) @@ -140,17 +142,17 @@ messages -> WebPage { HideFindUI() CountStringMatches(WTF::String string, uint32_t findOptions, unsigned maxMatchCount) -#if ENABLE(DRAG_SUPPORT) # Drag and drop. -#if PLATFORM(WIN) +#if PLATFORM(WIN) && ENABLE(DRAG_SUPPORT) PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, HashMap<UINT,Vector<String>> dataMap, uint32_t flags) #endif -#if PLATFORM(QT) || PLATFORM(GTK) +#if (PLATFORM(QT) || PLATFORM(GTK)) && ENABLE(DRAG_SUPPORT) PerformDragControllerAction(uint64_t action, WebCore::DragData dragData) #endif -#if !PLATFORM(WIN) && !PLATFORM(QT) && !PLATFORM(GTK) +#if !PLATFORM(WIN) && !PLATFORM(QT) && !PLATFORM(GTK) && ENABLE(DRAG_SUPPORT) PerformDragControllerAction(uint64_t action, WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t draggingSourceOperationMask, WTF::String dragStorageName, uint32_t flags, WebKit::SandboxExtension::Handle sandboxExtensionHandle, WebKit::SandboxExtension::HandleArray sandboxExtensionsForUpload) #endif +#if ENABLE(DRAG_SUPPORT) DragEnded(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition, uint64_t operation) #endif diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp index 40071982b..2e90a7360 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp @@ -32,10 +32,12 @@ #include "WebEvent.h" #include "WebPageProxyMessages.h" #include "WebProcess.h" +#include <WebCore/DOMWrapperWorld.h> #include <WebCore/FocusController.h> #include <WebCore/Frame.h> #include <WebCore/KeyboardEvent.h> #include <WebCore/Page.h> +#include <WebCore/PageGroup.h> #include <WebCore/PlatformKeyboardEvent.h> #include <WebCore/Range.h> #include <WebCore/Settings.h> @@ -411,4 +413,13 @@ void WebPage::applicationSchemeReply(const QtNetworkReplyData& replyData) networkReply->finalize(); } +void WebPage::setUserScripts(const Vector<String>& scripts) +{ + // This works because we keep an unique page group for each Page. + PageGroup* pageGroup = PageGroup::pageGroup(this->pageGroup()->identifier()); + pageGroup->removeUserScriptsFromWorld(mainThreadNormalWorld()); + for (unsigned i = 0; i < scripts.size(); ++i) + pageGroup->addUserScriptToWorld(mainThreadNormalWorld(), scripts.at(i), KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInTopFrameOnly); +} + } // namespace WebKit |
