diff options
Diffstat (limited to 'Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h')
-rw-r--r-- | Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h index 6996bfe64..399506948 100644 --- a/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h +++ b/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h @@ -23,14 +23,13 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebProcessLauncher_h -#define WebProcessLauncher_h +#pragma once #include "Connection.h" -#include "PlatformProcessIdentifier.h" #include <wtf/HashMap.h> #include <wtf/RefPtr.h> #include <wtf/Threading.h> +#include <wtf/WeakPtr.h> #include <wtf/text/StringHash.h> #include <wtf/text/WTFString.h> @@ -45,64 +44,56 @@ public: virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) = 0; }; - enum ProcessType { - WebProcess, + enum class ProcessType { + Web, #if ENABLE(NETSCAPE_PLUGIN_API) - PluginProcess, -#endif -#if ENABLE(NETWORK_PROCESS) - NetworkProcess, + Plugin32, + Plugin64, #endif + Network, #if ENABLE(DATABASE_PROCESS) - DatabaseProcess, + Database, #endif }; struct LaunchOptions { ProcessType processType; HashMap<String, String> extraInitializationData; -#if PLATFORM(MAC) - static const cpu_type_t MatchCurrentArchitecture = 0; - cpu_type_t architecture; - bool executableHeap; - bool useXPC; -#endif -#if PLATFORM(EFL) || PLATFORM(GTK) -#ifndef NDEBUG + +#if ENABLE(DEVELOPER_MODE) && PLATFORM(GTK) String processCmdPrefix; #endif -#endif }; - static PassRefPtr<ProcessLauncher> create(Client* client, const LaunchOptions& launchOptions) + static Ref<ProcessLauncher> create(Client* client, const LaunchOptions& launchOptions) { - return adoptRef(new ProcessLauncher(client, launchOptions)); + return adoptRef(*new ProcessLauncher(client, launchOptions)); } bool isLaunching() const { return m_isLaunching; } - PlatformProcessIdentifier processIdentifier() const { return m_processIdentifier; } + pid_t processIdentifier() const { return m_processIdentifier; } void terminateProcess(); void invalidate(); - static bool getProcessTypeFromString(const char*, ProcessType&); - static const char* processTypeAsString(ProcessType); - private: ProcessLauncher(Client*, const LaunchOptions& launchOptions); void launchProcess(); - void didFinishLaunchingProcess(PlatformProcessIdentifier, IPC::Connection::Identifier); + void didFinishLaunchingProcess(pid_t, IPC::Connection::Identifier); void platformInvalidate(); Client* m_client; +#if PLATFORM(COCOA) + OSObjectPtr<xpc_connection_t> m_xpcConnection; +#endif + + WeakPtrFactory<ProcessLauncher> m_weakPtrFactory; const LaunchOptions m_launchOptions; bool m_isLaunching; - PlatformProcessIdentifier m_processIdentifier; + pid_t m_processIdentifier; }; } // namespace WebKit - -#endif // WebProcessLauncher_h |