diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-12 09:27:39 +0200 |
commit | 3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch) | |
tree | 73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit2/UIProcess/WebProcessProxy.cpp | |
parent | b32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff) | |
download | qtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz |
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit2/UIProcess/WebProcessProxy.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/WebProcessProxy.cpp | 109 |
1 files changed, 80 insertions, 29 deletions
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp index e3cdc8809..d90355c4e 100644 --- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp +++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp @@ -46,6 +46,7 @@ using namespace WebCore; using namespace std; +#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, connection()) #define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(checkURLReceivedFromWebProcess(url), connection()) namespace WebKit { @@ -87,36 +88,30 @@ WebProcessProxy::~WebProcessProxy() m_processLauncher->invalidate(); m_processLauncher = 0; } - - if (m_threadLauncher) { - m_threadLauncher->invalidate(); - m_threadLauncher = 0; - } } void WebProcessProxy::connect() { - if (m_context->processModel() == ProcessModelSharedSecondaryThread) { - ASSERT(!m_threadLauncher); - m_threadLauncher = ThreadLauncher::create(this); - } else { - ASSERT(!m_processLauncher); + ASSERT(!m_processLauncher); - ProcessLauncher::LaunchOptions launchOptions; - launchOptions.processType = ProcessLauncher::WebProcess; + ProcessLauncher::LaunchOptions launchOptions; + launchOptions.processType = ProcessLauncher::WebProcess; #if PLATFORM(MAC) - // We want the web process to match the architecture of the UI process. - launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture; - launchOptions.executableHeap = false; + // We want the web process to match the architecture of the UI process. + launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture; + launchOptions.executableHeap = false; +#if HAVE(XPC) + launchOptions.useXPC = getenv("WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS"); +#endif #endif #ifndef NDEBUG - const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX"); - if (webProcessCmdPrefix && *webProcessCmdPrefix) - launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix); + const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX"); + if (webProcessCmdPrefix && *webProcessCmdPrefix) + launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix); #endif - m_processLauncher = ProcessLauncher::create(this, launchOptions); - } + + m_processLauncher = ProcessLauncher::create(this, launchOptions); } void WebProcessProxy::disconnect() @@ -159,8 +154,6 @@ bool WebProcessProxy::isLaunching() const { if (m_processLauncher) return m_processLauncher->isLaunching(); - if (m_threadLauncher) - return m_threadLauncher->isLaunching(); return false; } @@ -332,7 +325,7 @@ void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC || messageID.is<CoreIPC::MessageClassWebVibrationProxy>() #endif || messageID.is<CoreIPC::MessageClassWebResourceCacheManagerProxy>()) { - m_context->didReceiveMessage(connection, messageID, arguments); + m_context->didReceiveMessage(this, messageID, arguments); return; } @@ -359,7 +352,7 @@ void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, Cor || messageID.is<CoreIPC::MessageClassWebNetworkInfoManagerProxy>() #endif || messageID.is<CoreIPC::MessageClassDownloadProxy>() || messageID.is<CoreIPC::MessageClassWebIconDatabase>()) { - m_context->didReceiveSyncMessage(connection, messageID, arguments, reply); + m_context->didReceiveSyncMessage(this, messageID, arguments, reply); return; } @@ -436,11 +429,6 @@ void WebProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connection:: didFinishLaunching(connectionIdentifier); } -void WebProcessProxy::didFinishLaunching(ThreadLauncher*, CoreIPC::Connection::Identifier connectionIdentifier) -{ - didFinishLaunching(connectionIdentifier); -} - void WebProcessProxy::didFinishLaunching(CoreIPC::Connection::Identifier connectionIdentifier) { ASSERT(!m_connection); @@ -527,4 +515,67 @@ void WebProcessProxy::updateTextCheckerState() send(Messages::WebProcess::SetTextCheckerState(TextChecker::state()), 0); } +void WebProcessProxy::didNavigateWithNavigationData(uint64_t pageID, const WebNavigationDataStore& store, uint64_t frameID) +{ + WebPageProxy* page = webPage(pageID); + if (!page) + return; + + WebFrameProxy* frame = webFrame(frameID); + MESSAGE_CHECK(frame); + MESSAGE_CHECK(frame->page() == page); + + m_context->historyClient().didNavigateWithNavigationData(m_context.get(), page, store, frame); +} + +void WebProcessProxy::didPerformClientRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID) +{ + WebPageProxy* page = webPage(pageID); + if (!page) + return; + + if (sourceURLString.isEmpty() || destinationURLString.isEmpty()) + return; + + WebFrameProxy* frame = webFrame(frameID); + MESSAGE_CHECK(frame); + MESSAGE_CHECK(frame->page() == page); + MESSAGE_CHECK_URL(sourceURLString); + MESSAGE_CHECK_URL(destinationURLString); + + m_context->historyClient().didPerformClientRedirect(m_context.get(), page, sourceURLString, destinationURLString, frame); +} + +void WebProcessProxy::didPerformServerRedirect(uint64_t pageID, const String& sourceURLString, const String& destinationURLString, uint64_t frameID) +{ + WebPageProxy* page = webPage(pageID); + if (!page) + return; + + if (sourceURLString.isEmpty() || destinationURLString.isEmpty()) + return; + + WebFrameProxy* frame = webFrame(frameID); + MESSAGE_CHECK(frame); + MESSAGE_CHECK(frame->page() == page); + MESSAGE_CHECK_URL(sourceURLString); + MESSAGE_CHECK_URL(destinationURLString); + + m_context->historyClient().didPerformServerRedirect(m_context.get(), page, sourceURLString, destinationURLString, frame); +} + +void WebProcessProxy::didUpdateHistoryTitle(uint64_t pageID, const String& title, const String& url, uint64_t frameID) +{ + WebPageProxy* page = webPage(pageID); + if (!page) + return; + + WebFrameProxy* frame = webFrame(frameID); + MESSAGE_CHECK(frame); + MESSAGE_CHECK(frame->page() == page); + MESSAGE_CHECK_URL(url); + + m_context->historyClient().didUpdateHistoryTitle(m_context.get(), page, title, url, frame); +} + } // namespace WebKit |