diff options
Diffstat (limited to 'Source/WebKit2/SharedWorkerProcess')
7 files changed, 0 insertions, 444 deletions
diff --git a/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/Info.plist b/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/Info.plist deleted file mode 100644 index 84b19c7b7..000000000 --- a/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleExecutable</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundleGetInfoString</key> - <string>${BUNDLE_VERSION}, Copyright 2003-2013 Apple Inc.</string> - <key>CFBundleIdentifier</key> - <string>com.apple.WebKit.${PRODUCT_NAME}</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleShortVersionString</key> - <string>${SHORT_VERSION_STRING}</string> - <key>CFBundleVersion</key> - <string>${BUNDLE_VERSION}</string> - <key>LSFileQuarantineEnabled</key> - <true/> - <key>LSMinimumSystemVersion</key> - <string>${MACOSX_DEPLOYMENT_TARGET}</string> - <key>LSUIElement</key> - <true/> - <key>NSPrincipalClass</key> - <string>NSApplication</string> - <key>WebKitEntryPoint</key> - <string>SharedWorkerProcessMain</string> -</dict> -</plist> diff --git a/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMain.mm b/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMain.mm deleted file mode 100644 index b890a5ba0..000000000 --- a/Source/WebKit2/SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMain.mm +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2010, 2011, 2012, 2013 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" - -#if ENABLE(SHARED_WORKER_PROCESS) - -#import "ChildProcessEntryPoint.h" -#import "SharedWorkerProcess.h" -#import "WKBase.h" - -using namespace WebKit; - -extern "C" WK_EXPORT int SharedWorkerProcessMain(int argc, char** argv); - -int SharedWorkerProcessMain(int argc, char** argv) -{ - return ChildProcessMain<SharedWorkerProcess, ChildProcessMainDelegate>(argc, argv); -} - -#endif // ENABLE(SHARED_WORKER_PROCESS) diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp deleted file mode 100644 index 36ab1076d..000000000 --- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.cpp +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (C) 2010, 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. - */ - -#include "config.h" -#include "SharedWorkerProcess.h" - -#if ENABLE(SHARED_WORKER_PROCESS) - -#include "ArgumentCoders.h" -#include "Attachment.h" -#include "SharedWorkerProcessCreationParameters.h" -#include "SharedWorkerProcessProxyMessages.h" -#include "WebProcessConnection.h" -#include <WebCore/NotImplemented.h> -#include <WebCore/RunLoop.h> - -#if PLATFORM(MAC) -#include <crt_externs.h> -#endif - -#if USE(UNIX_DOMAIN_SOCKETS) -#include <errno.h> -#include <fcntl.h> -#include <sys/resource.h> -#include <sys/socket.h> -#include <unistd.h> -#include <wtf/UniStdExtras.h> - -#ifdef SOCK_SEQPACKET -#define SOCKET_TYPE SOCK_SEQPACKET -#else -#if PLATFORM(GTK) -#define SOCKET_TYPE SOCK_STREAM -#else -#define SOCKET_TYPE SOCK_DGRAM -#endif -#endif // SOCK_SEQPACKET -#endif // USE(UNIX_DOMAIN_SOCKETS) - -using namespace WebCore; - -namespace WebKit { - -SharedWorkerProcess& SharedWorkerProcess::shared() -{ - DEFINE_STATIC_LOCAL(SharedWorkerProcess, process, ()); - return process; -} - -SharedWorkerProcess::SharedWorkerProcess() - : m_minimumLifetimeTimer(RunLoop::main(), this, &SharedWorkerProcess::minimumLifetimeTimerFired) -{ -} - -SharedWorkerProcess::~SharedWorkerProcess() -{ -} - -void SharedWorkerProcess::removeWebProcessConnection(WebProcessConnection* webProcessConnection) -{ - size_t vectorIndex = m_webProcessConnections.find(webProcessConnection); - ASSERT(vectorIndex != notFound); - - m_webProcessConnections.remove(vectorIndex); - - enableTermination(); -} - -bool SharedWorkerProcess::shouldTerminate() -{ - ASSERT(m_webProcessConnections.isEmpty()); - - return true; -} - -void SharedWorkerProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder) -{ - didReceiveSharedWorkerProcessMessage(connection, decoder); -} - -void SharedWorkerProcess::didClose(CoreIPC::Connection*) -{ - // The UI process has crashed, just go ahead and quit. - RunLoop::current()->stop(); -} - -void SharedWorkerProcess::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference, CoreIPC::StringReference) -{ -} - -void SharedWorkerProcess::initializeSharedWorkerProcess(const SharedWorkerProcessCreationParameters& parameters) -{ - setMinimumLifetime(parameters.minimumLifetime); - setTerminationTimeout(parameters.terminationTimeout); -} - -void SharedWorkerProcess::createWebProcessConnection() -{ -#if PLATFORM(MAC) - // Create the listening port. - mach_port_t listeningPort; - mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort); - - // Create a listening connection. - RefPtr<WebProcessConnection> connection = WebProcessConnection::create(CoreIPC::Connection::Identifier(listeningPort)); - m_webProcessConnections.append(connection.release()); - - CoreIPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); - parentProcessConnection()->send(Messages::SharedWorkerProcessProxy::DidCreateWebProcessConnection(clientPort), 0); -#elif USE(UNIX_DOMAIN_SOCKETS) - int sockets[2]; - if (socketpair(AF_UNIX, SOCKET_TYPE, 0, sockets) == -1) { - ASSERT_NOT_REACHED(); - return; - } - - // Don't expose the shared worker process socket to the web process. - while (fcntl(sockets[1], F_SETFD, FD_CLOEXEC) == -1) { - if (errno != EINTR) { - ASSERT_NOT_REACHED(); - closeWithRetry(sockets[0]); - closeWithRetry(sockets[1]); - return; - } - } - - // Don't expose the shared worker process socket to possible future web processes. - while (fcntl(sockets[0], F_SETFD, FD_CLOEXEC) == -1) { - if (errno != EINTR) { - ASSERT_NOT_REACHED(); - closeWithRetry(sockets[0]); - closeWithRetry(sockets[1]); - return; - } - } - - RefPtr<WebProcessConnection> connection = WebProcessConnection::create(sockets[1]); - m_webProcessConnections.append(connection.release()); - - CoreIPC::Attachment clientSocket(sockets[0]); - parentProcessConnection()->send(Messages::SharedWorkerProcessProxy::DidCreateWebProcessConnection(clientSocket), 0); -#else - notImplemented(); -#endif - - disableTermination(); -} - -void SharedWorkerProcess::setMinimumLifetime(double lifetime) -{ - if (lifetime <= 0.0) - return; - - disableTermination(); - - m_minimumLifetimeTimer.startOneShot(lifetime); -} - -void SharedWorkerProcess::minimumLifetimeTimerFired() -{ - enableTermination(); -} - -#if !PLATFORM(MAC) -void SharedWorkerProcess::initializeProcess(const ChildProcessInitializationParameters&) -{ -} - -void SharedWorkerProcess::initializeProcessName(const ChildProcessInitializationParameters&) -{ -} -#endif - -} // namespace WebKit - -#endif // ENABLE(SHARED_WORKER_PROCESS) diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h deleted file mode 100644 index 82c59c061..000000000 --- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2010, 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. - */ - -#ifndef SharedWorkerProcess_h -#define SharedWorkerProcess_h - -#if ENABLE(SHARED_WORKER_PROCESS) - -#include "ChildProcess.h" -#include <wtf/Forward.h> - -namespace WebKit { - -class WebProcessConnection; -struct SharedWorkerProcessCreationParameters; - -class SharedWorkerProcess : public ChildProcess { - WTF_MAKE_NONCOPYABLE(SharedWorkerProcess); -public: - static SharedWorkerProcess& shared(); - - void removeWebProcessConnection(WebProcessConnection*); - -private: - SharedWorkerProcess(); - ~SharedWorkerProcess(); - - // ChildProcess - virtual void initializeProcess(const ChildProcessInitializationParameters&) OVERRIDE; - virtual void initializeProcessName(const ChildProcessInitializationParameters&) OVERRIDE; - virtual bool shouldTerminate() OVERRIDE; - - // CoreIPC::Connection::Client - virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&); - virtual void didClose(CoreIPC::Connection*); - virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference messageReceiverName, CoreIPC::StringReference messageName) OVERRIDE; - - // Message handlers. - void didReceiveSharedWorkerProcessMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&); - void initializeSharedWorkerProcess(const SharedWorkerProcessCreationParameters&); - void createWebProcessConnection(); - - void setMinimumLifetime(double); - void minimumLifetimeTimerFired(); - - // Our web process connections. - Vector<RefPtr<WebProcessConnection>> m_webProcessConnections; - - WebCore::RunLoop::Timer<SharedWorkerProcess> m_minimumLifetimeTimer; -}; - -} // namespace WebKit - -#endif // ENABLE(SHARED_WORKER_PROCESS) - -#endif // SharedWorkerProcess_h diff --git a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in b/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in deleted file mode 100644 index ad7423df9..000000000 --- a/Source/WebKit2/SharedWorkerProcess/SharedWorkerProcess.messages.in +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2010, 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. - -#if ENABLE(SHARED_WORKER_PROCESS) - -messages -> SharedWorkerProcess LegacyReceiver { - # Initializes the shared worker process. - InitializeSharedWorkerProcess(WebKit::SharedWorkerProcessCreationParameters processCreationParameters) - - # Creates a web process connection. When the connection has been created, - # The shared worker process sends back a DidCreateWebProcessConnection message with - # a connection identifier. - CreateWebProcessConnection() - -#if PLATFORM(MAC) - SetProcessSuppressionEnabled(bool flag) -#endif -} - -#endif // ENABLE(SHARED_WORKER_PROCESS) diff --git a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm b/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm deleted file mode 100644 index 275c41bec..000000000 --- a/Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMac.mm +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2010, 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 "SharedWorkerProcess.h" - -#if ENABLE(SHARED_WORKER_PROCESS) - -#import <WebCore/LocalizedStrings.h> -#import <WebKitSystemInterface.h> - -namespace WebKit { - -void SharedWorkerProcess::initializeProcess(const ChildProcessInitializationParameters&) -{ - // Having a window server connection in this process would result in spin logs (<rdar://problem/13239119>). - setApplicationIsDaemon(); -} - -void SharedWorkerProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters) -{ - NSString *applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ Shared Worker", "Visible name of the shared worker process. The argument is the application name."), (NSString *)parameters.uiProcessName]; - WKSetVisibleApplicationName((CFStringRef)applicationName); -} - -} // namespace WebKit - -#endif // ENABLE(SHARED_WORKER_PROCESS) diff --git a/Source/WebKit2/SharedWorkerProcess/mac/com.apple.WebKit.SharedWorkerProcess.sb b/Source/WebKit2/SharedWorkerProcess/mac/com.apple.WebKit.SharedWorkerProcess.sb deleted file mode 100644 index 02afb45b4..000000000 --- a/Source/WebKit2/SharedWorkerProcess/mac/com.apple.WebKit.SharedWorkerProcess.sb +++ /dev/null @@ -1,4 +0,0 @@ -(version 1) -(deny default (with partial-symbolication)) - -(import "system.sb") |