diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
tree | f6256640b6c46d7da221435803cae65326817ba2 /Source/WebKit2/WebProcess/WebPage/WebFrame.cpp | |
parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebFrame.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebFrame.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp index f36fc0238..fd6f4c8d2 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp @@ -63,6 +63,8 @@ #include "IntentData.h" #include <WebCore/DOMWindowIntents.h> #include <WebCore/DeliveredIntent.h> +#include <WebCore/Intent.h> +#include <WebCore/PlatformMessagePortChannel.h> #endif #if PLATFORM(MAC) || PLATFORM(WIN) @@ -246,12 +248,38 @@ void WebFrame::convertHandleToDownload(ResourceHandle* handle, const ResourceReq void WebFrame::deliverIntent(const IntentData& intentData) { OwnPtr<DeliveredIntentClient> dummyClient; - OwnPtr<MessagePortArray> dummyPorts; Vector<uint8_t> dataCopy = intentData.data; + + OwnPtr<WebCore::MessagePortChannelArray> channels; + if (!intentData.messagePorts.isEmpty()) { + channels = adoptPtr(new WebCore::MessagePortChannelArray(intentData.messagePorts.size())); + for (size_t i = 0; i < intentData.messagePorts.size(); ++i) + (*channels)[i] = MessagePortChannel::create(WebProcess::shared().messagePortChannel(intentData.messagePorts.at(i))); + } + OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release()); + RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intentData.action, intentData.type, - SerializedScriptValue::adopt(dataCopy), dummyPorts.release(), + SerializedScriptValue::adopt(dataCopy), messagePorts.release(), intentData.extras); - WebCore::DOMWindowIntents::from(m_coreFrame->domWindow())->deliver(deliveredIntent.release()); + WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release()); +} + +void WebFrame::deliverIntent(WebCore::Intent* intent) +{ + OwnPtr<DeliveredIntentClient> dummyClient; + + OwnPtr<WebCore::MessagePortChannelArray> channels; + WebCore::MessagePortChannelArray* origChannels = intent->messagePorts(); + if (origChannels && origChannels->size()) { + channels = adoptPtr(new WebCore::MessagePortChannelArray(origChannels->size())); + for (size_t i = 0; i < origChannels->size(); ++i) + (*channels)[i] = origChannels->at(i).release(); + } + OwnPtr<WebCore::MessagePortArray> messagePorts = WebCore::MessagePort::entanglePorts(*m_coreFrame->document()->domWindow()->scriptExecutionContext(), channels.release()); + + RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intent->action(), intent->type(), + intent->data(), messagePorts.release(), intent->extras()); + WebCore::DOMWindowIntents::from(m_coreFrame->document()->domWindow())->deliver(deliveredIntent.release()); } #endif @@ -493,7 +521,7 @@ unsigned WebFrame::pendingUnloadCount() const if (!m_coreFrame) return 0; - return m_coreFrame->domWindow()->pendingUnloadEventListeners(); + return m_coreFrame->document()->domWindow()->pendingUnloadEventListeners(); } bool WebFrame::allowsFollowingLink(const WebCore::KURL& url) const |