Make the application PID available to WebCore
https://bugs.webkit.org/show_bug.cgi?id=172133
Reviewed by Andreas Kling.
Source/WebCore:
* CMakeLists.txt:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/RuntimeApplicationChecks.cpp: Added.
(WebCore::presentingApplicationPIDOverride):
(WebCore::presentingApplicationPID): Returns the override PID if set, or getCurrentProcessID()
otherwise.
(WebCore::setPresentingApplicationPID):
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm: Renamed from Source/WebCore/platform/RuntimeApplicationChecks.mm.
Source/WebKit2:
Added uiProcessPID to Web and Networking process creation parameters. The UI process
initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID()
at initialization time.
This replaces presenterApplicationPid.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::createNewWebProcess):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformInitialize):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::presenterApplicationPid): Deleted.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@216903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/RuntimeApplicationChecks.h b/Source/WebCore/platform/RuntimeApplicationChecks.h
index 0e42b0c..ab88e67 100644
--- a/Source/WebCore/platform/RuntimeApplicationChecks.h
+++ b/Source/WebCore/platform/RuntimeApplicationChecks.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,14 +23,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RuntimeApplicationChecks_h
-#define RuntimeApplicationChecks_h
+#pragma once
-#if PLATFORM(COCOA)
#include <wtf/Forward.h>
namespace WebCore {
+WEBCORE_EXPORT void setPresentingApplicationPID(int);
+WEBCORE_EXPORT int presentingApplicationPID();
+
+#if PLATFORM(COCOA)
+
WEBCORE_EXPORT void setApplicationBundleIdentifier(const String&);
String applicationBundleIdentifier();
@@ -81,8 +84,6 @@
#endif // PLATFORM(IOS)
-} // namespace WebCore
-
#endif // PLATFORM(COCOA)
-#endif // RuntimeApplicationChecks_h
+} // namespace WebCore