WebProcessPoolWin.cpp [plain text]
#include "config.h"
#include "WebProcessPool.h"
#include "WebProcessCreationParameters.h"
#include <WebCore/NotImplemented.h>
#if ENABLE(REMOTE_INSPECTOR)
#include <JavaScriptCore/RemoteInspectorServer.h>
#include <WebCore/WebCoreBundleWin.h>
#endif
namespace WebKit {
#if ENABLE(REMOTE_INSPECTOR)
static String backendCommandsPath()
{
RetainPtr<CFURLRef> urlRef = adoptCF(CFBundleCopyResourceURL(WebCore::webKitBundle(), CFSTR("InspectorBackendCommands"), CFSTR("js"), CFSTR("WebInspectorUI\\Protocol")));
if (!urlRef)
return { };
char path[MAX_PATH];
if (!CFURLGetFileSystemRepresentation(urlRef.get(), false, reinterpret_cast<UInt8*>(path), MAX_PATH))
return { };
return path;
}
static void initializeRemoteInspectorServer(StringView address)
{
if (Inspector::RemoteInspectorServer::singleton().isRunning())
return;
auto pos = address.find(':');
if (pos == notFound)
return;
auto host = address.substring(0, pos);
auto port = address.substring(pos + 1).toUInt64Strict();
if (!port)
return;
Inspector::RemoteInspector::singleton().setBackendCommandsPath(backendCommandsPath());
Inspector::RemoteInspectorServer::singleton().start(host.utf8().data(), port.value());
}
#endif
void WebProcessPool::platformInitialize()
{
#if ENABLE(REMOTE_INSPECTOR)
if (const char* address = getenv("WEBKIT_INSPECTOR_SERVER"))
initializeRemoteInspectorServer(address);
#endif
}
void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters&)
{
notImplemented();
}
void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy&, WebProcessCreationParameters&)
{
notImplemented();
}
void WebProcessPool::platformInvalidateContext()
{
notImplemented();
}
void WebProcessPool::platformResolvePathsForSandboxExtensions()
{
}
}