diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebKit2/UIProcess/Network | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebKit2/UIProcess/Network')
6 files changed, 77 insertions, 2 deletions
diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp index 00f16f457..4340da394 100644 --- a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp +++ b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.cpp @@ -28,6 +28,8 @@ #include "NetworkProcessProxy.h" +#if ENABLE(NETWORK_PROCESS) + namespace WebKit { NetworkProcessManager& NetworkProcessManager::shared() @@ -68,3 +70,5 @@ void NetworkProcessManager::removeNetworkProcessProxy(NetworkProcessProxy* netwo } // namespace WebKit + +#endif // ENABLE(NETWORK_PROCESS) diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h index 08d422b25..957e45f3e 100644 --- a/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h +++ b/Source/WebKit2/UIProcess/Network/NetworkProcessManager.h @@ -26,6 +26,8 @@ #ifndef NetworkProcessManager_h #define NetworkProcessManager_h +#if ENABLE(NETWORK_PROCESS) + #include "Connection.h" #include "WebProcessProxyMessages.h" #include <wtf/RefCounted.h> @@ -48,6 +50,10 @@ public: void removeNetworkProcessProxy(NetworkProcessProxy*); +#if PLATFORM(MAC) + void setApplicationIsOccluded(bool); +#endif + private: NetworkProcessManager(); @@ -56,4 +62,6 @@ private: } // namespace WebKit +#endif // ENABLE(NETWORK_PROCESS) + #endif // NetworkProcessManager_h diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp index d1a0135f5..1f9ce89ed 100644 --- a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp @@ -112,7 +112,7 @@ void NetworkProcessProxy::didClose(CoreIPC::Connection*) networkProcessCrashedOrFailedToLaunch(); } -void NetworkProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID) +void NetworkProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference, CoreIPC::StringReference) { } @@ -162,6 +162,11 @@ void NetworkProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connecti m_connection->send(Messages::NetworkProcess::CreateNetworkConnectionToWebProcess(), 0); m_numPendingConnectionRequests = 0; + +#if PLATFORM(MAC) + if (WebContext::applicationIsOccluded()) + m_connection->send(Messages::NetworkProcess::SetApplicationIsOccluded(true), 0); +#endif } } // namespace WebKit diff --git a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h index 1840a8e91..13fdfd89a 100644 --- a/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h +++ b/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h @@ -45,6 +45,12 @@ public: void getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>); + bool isValid() const { return m_connection; } + +#if PLATFORM(MAC) + void setApplicationIsOccluded(bool); +#endif + private: NetworkProcessProxy(NetworkProcessManager*); @@ -55,7 +61,7 @@ private: // CoreIPC::Connection::Client virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&); virtual void didClose(CoreIPC::Connection*); - virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID); + virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference messageReceiverName, CoreIPC::StringReference messageName); virtual void syncMessageSendTimedOut(CoreIPC::Connection*); // Message handlers diff --git a/Source/WebKit2/UIProcess/Network/mac/NetworkProcessManagerMac.mm b/Source/WebKit2/UIProcess/Network/mac/NetworkProcessManagerMac.mm new file mode 100644 index 000000000..eaf9888a5 --- /dev/null +++ b/Source/WebKit2/UIProcess/Network/mac/NetworkProcessManagerMac.mm @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2012 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#import "NetworkProcessManager.h" + +#if ENABLE(NETWORK_PROCESS) + +#import "NetworkProcessProxy.h" + +namespace WebKit { + +void NetworkProcessManager::setApplicationIsOccluded(bool applicationIsOccluded) +{ + if (m_networkProcess) + return m_networkProcess->setApplicationIsOccluded(applicationIsOccluded); +} + +} // namespace WebKit + +#endif // ENABLE(NETWORK_PROCESS) diff --git a/Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm b/Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm index 440cc429f..02534e9b9 100644 --- a/Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm +++ b/Source/WebKit2/UIProcess/Network/mac/NetworkProcessProxyMac.mm @@ -27,6 +27,7 @@ #import "NetworkProcessProxy.h" #import "NetworkProcessCreationParameters.h" +#import "NetworkProcessMessages.h" #if ENABLE(NETWORK_PROCESS) @@ -39,6 +40,14 @@ void NetworkProcessProxy::platformInitializeNetworkProcess(NetworkProcessCreatio parameters.parentProcessName = [[NSProcessInfo processInfo] processName]; } +void NetworkProcessProxy::setApplicationIsOccluded(bool applicationIsOccluded) +{ + if (!isValid()) + return; + + m_connection->send(Messages::NetworkProcess::SetApplicationIsOccluded(applicationIsOccluded), 0); +} + } // namespace WebKit #endif // ENABLE(NETWORK_PROCESS) |