diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
commit | 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch) | |
tree | 8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp | |
parent | 33b26980cb24288b5a9f2590ccf32a949281bb79 (diff) | |
download | qtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz |
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1
widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're
working on completing the entire split as part of
https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp | 68 |
1 files changed, 21 insertions, 47 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp index 44d9a10ab..458b1c169 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp @@ -28,7 +28,6 @@ #include "Arguments.h" #include "ImmutableArray.h" -#include "InjectedBundleMessageKinds.h" #include "InjectedBundleScriptWorld.h" #include "InjectedBundleUserMessageCoders.h" #include "LayerTreeHost.h" @@ -61,6 +60,7 @@ #include <WebCore/PageVisibilityState.h> #include <WebCore/PrintContext.h> #include <WebCore/ResourceHandle.h> +#include <WebCore/ResourceLoadScheduler.h> #include <WebCore/ScriptController.h> #include <WebCore/SecurityOrigin.h> #include <WebCore/SecurityPolicy.h> @@ -426,23 +426,24 @@ bool InjectedBundle::isProcessingUserGesture() return ScriptController::processingUserGesture(); } -static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns) +static Vector<String> toStringVector(ImmutableArray* patterns) { + Vector<String> patternsVector; + if (!patterns) - return nullptr; + return patternsVector; - size_t size = patterns->size(); + size_t size = patterns->size(); if (!size) - return nullptr; + return patternsVector; - OwnPtr<Vector<String> > patternsVector = adoptPtr(new Vector<String>); - patternsVector->reserveInitialCapacity(size); + patternsVector.reserveInitialCapacity(size); for (size_t i = 0; i < size; ++i) { WebString* entry = patterns->at<WebString>(i); if (entry) - patternsVector->uncheckedAppend(entry->string()); + patternsVector.uncheckedAppend(entry->string()); } - return patternsVector.release(); + return patternsVector; } void InjectedBundle::addUserScript(WebPageGroupProxy* pageGroup, InjectedBundleScriptWorld* scriptWorld, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime injectionTime, WebCore::UserContentInjectedFrames injectedFrames) @@ -540,46 +541,9 @@ void InjectedBundle::didReceiveMessageToPage(WebPage* page, const String& messag m_client.didReceiveMessageToPage(this, page, messageName, messageBody); } -void InjectedBundle::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) -{ - switch (messageID.get<InjectedBundleMessage::Kind>()) { - case InjectedBundleMessage::PostMessage: { - String messageName; - RefPtr<APIObject> messageBody; - InjectedBundleUserMessageDecoder messageDecoder(messageBody); - if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder))) - return; - - didReceiveMessage(messageName, messageBody.get()); - return; - } - - case InjectedBundleMessage::PostMessageToPage: { - uint64_t pageID = arguments->destinationID(); - if (!pageID) - return; - - WebPage* page = WebProcess::shared().webPage(pageID); - if (!page) - return; - - String messageName; - RefPtr<APIObject> messageBody; - InjectedBundleUserMessageDecoder messageDecoder(messageBody); - if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder))) - return; - - didReceiveMessageToPage(page, messageName, messageBody.get()); - return; - } - } - - ASSERT_NOT_REACHED(); -} - void InjectedBundle::setPageVisibilityState(WebPage* page, int state, bool isInitialState) { -#if ENABLE(PAGE_VISIBILITY_API) +#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING) page->corePage()->setVisibilityState(static_cast<PageVisibilityState>(state), isInitialState); #endif } @@ -646,4 +610,14 @@ void InjectedBundle::setTabKeyCyclesThroughElements(WebPage* page, bool enabled) page->corePage()->setTabKeyCyclesThroughElements(enabled); } +void InjectedBundle::setSerialLoadingEnabled(bool enabled) +{ + resourceLoadScheduler()->setSerialLoadingEnabled(enabled); +} + +void InjectedBundle::dispatchPendingLoadRequests() +{ + resourceLoadScheduler()->servePendingRequests(); +} + } // namespace WebKit |