2018-06-19 Don Olmstead <don.olmstead@sony.com>
+ Use getCurrentProcessID over getpid
+ https://bugs.webkit.org/show_bug.cgi?id=186813
+
+ Reviewed by Alex Christensen.
+
+ * Shared/WebMemorySampler.cpp:
+ (WebKit::WebMemorySampler::initializeTimers):
+ (WebKit::WebMemorySampler::stop):
+ (WebKit::WebMemorySampler::writeHeaders):
+ * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+ (WebKit::WebSWContextManagerConnection::installServiceWorker):
+
+2018-06-19 Don Olmstead <don.olmstead@sony.com>
+
WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when Service Workers disabled
https://bugs.webkit.org/show_bug.cgi?id=186809
#if ENABLE(MEMORY_SAMPLER)
#include <stdio.h>
-#include <unistd.h>
+#include <wtf/ProcessID.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
void WebMemorySampler::initializeTimers(double interval)
{
m_sampleTimer.startRepeating(1_s);
- printf("Started memory sampler for process %s %d", processName().utf8().data(), getpid());
+ printf("Started memory sampler for process %s %d", processName().utf8().data(), getCurrentProcessID());
if (interval > 0) {
m_stopTimer.startOneShot(1_s * interval);
printf(" for a interval of %g seconds", interval);
m_sampleTimer.stop();
FileSystem::closeFile(m_sampleLogFile);
- printf("Stopped memory sampler for process %s %d\n", processName().utf8().data(), getpid());
+ printf("Stopped memory sampler for process %s %d\n", processName().utf8().data(), getCurrentProcessID());
// Flush stdout buffer so python script can be guaranteed to read up to this point.
fflush(stdout);
m_isRunning = false;
void WebMemorySampler::writeHeaders()
{
- String processDetails = String::format("Process: %s Pid: %d\n", processName().utf8().data(), getpid());
+ String processDetails = String::format("Process: %s Pid: %d\n", processName().utf8().data(), getCurrentProcessID());
CString utf8String = processDetails.utf8();
FileSystem::writeToFile(m_sampleLogFile, utf8String.data(), utf8String.length());
#include <WebCore/ServiceWorkerJobDataIdentifier.h>
#include <WebCore/UserAgent.h>
#include <pal/SessionID.h>
+#include <wtf/ProcessID.h>
#if USE(QUICK_LOOK)
#include <WebCore/PreviewLoaderClient.h>
auto serviceWorkerThreadProxy = ServiceWorkerThreadProxy::create(WTFMove(pageConfiguration), data, sessionID, String { m_userAgent }, WebProcess::singleton().cacheStorageProvider(), m_storageBlockingPolicy);
SWContextManager::singleton().registerServiceWorkerThreadForInstall(WTFMove(serviceWorkerThreadProxy));
- LOG(ServiceWorker, "Context process PID: %i created worker thread\n", getpid());
+ LOG(ServiceWorker, "Context process PID: %i created worker thread\n", getCurrentProcessID());
}
void WebSWContextManagerConnection::setUserAgent(String&& userAgent)