summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp')
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp68
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