@@ -0,0 +1,93 @@
/*
* Copyright (C) 2019 Haiku, Inc.
*
* 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 "NetworkProcess.h"

#include "NetworkProcessCreationParameters.h"
#include <WebCore/NetworkStorageSession.h>
#include <WebCore/NotImplemented.h>

namespace WebCore
{
class NetworkStorageSession;
}

namespace WebKit {

using namespace WebCore;

void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters& parameters)
{
notImplemented();
}

void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo& certificateInfo, const String& host)
{
notImplemented();
}

std::unique_ptr<WebCore::NetworkStorageSession> NetworkProcess::platformCreateDefaultStorageSession() const
{
return std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID(), nullptr);
}

void NetworkProcess::platformProcessDidTransitionToForeground()
{
notImplemented();
}

void NetworkProcess::platformProcessDidTransitionToBackground()
{
notImplemented();
}

void NetworkProcess::clearCacheForAllOrigins(uint32_t cachesToClear)
{
notImplemented();
}

void NetworkProcess::platformProcessDidResume()
{
notImplemented();
}

void NetworkProcess::platformTerminate()
{
notImplemented();
}

void NetworkProcess::platformPrepareToSuspend(CompletionHandler<void()>&& completionHandler)
{
notImplemented();
completionHandler();
}

void NetworkProcess::clearDiskCache(WallTime modifiedSince, CompletionHandler<void()>&& completionHandler)
{
notImplemented();
}

} // namespace WebKit
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2019 Haiku, Inc.
*
* 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 THE COPYRIGHT HOLDERS ``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 "NetworkProcessMainUnix.h"

#include "AuxiliaryProcessMain.h"
#include "NetworkProcess.h"

namespace WebKit {

template<>
void initializeAuxiliaryProcess<NetworkProcess>(AuxiliaryProcessInitializationParameters&& parameters)
{
static NeverDestroyed<NetworkProcess> networkProcess(WTFMove(parameters));
}

int NetworkProcessMainUnix(int argc, char** argv)
{
return AuxiliaryProcessMain<NetworkProcess, AuxiliaryProcessMainBase>(argc, argv);
}

} // namespace WebKit
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2019 Haiku, Inc.
*
* 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 "RemoteNetworkingContext.h"

#include "NetworkProcess.h"
#include "NetworkSession.h"
#include "WebsiteDataStoreParameters.h"
#include <WebCore/NetworkStorageSession.h>

namespace WebKit {

using namespace WebCore;

void RemoteNetworkingContext::ensureWebsiteDataStoreSession(NetworkProcess& networkProcess, WebsiteDataStoreParameters&& parameters)
{
auto sessionID = parameters.networkSessionParameters.sessionID;
if (networkProcess.storageSession(sessionID))
return;

networkProcess.ensureSession(sessionID, String::number(sessionID.sessionID()));
networkProcess.setSession(sessionID, NetworkSession::create(networkProcess, WTFMove(parameters.networkSessionParameters)));
}

}
@@ -1,34 +1,68 @@
list(APPEND WebKit_SOURCES
NetworkProcess/cache/NetworkCacheDataHaiku.cpp
NetworkProcess/cache/NetworkCacheIOChannelHaiku.cpp
NetworkProcess/haiku/NetworkProcessHaiku.cpp
NetworkProcess/haiku/NetworkProcessMainHaiku.cpp
NetworkProcess/haiku/RemoteNetworkingContextHaiku.cpp

Platform/IPC/unix/AttachmentUnix.cpp
Platform/IPC/unix/ConnectionUnix.cpp

Platform/haiku/LoggingHaiku.cpp
Platform/haiku/ModuleHaiku.cpp

Platform/unix/SharedMemoryUnix.cpp

PluginProcess/unix/PluginControllerProxyUnix.cpp
PluginProcess/unix/PluginProcessMainUnix.cpp
PluginProcess/unix/PluginProcessUnix.cpp

Shared/WebCoreArgumentCoders.cpp

#Shared/haiku/AuxiliaryProcessMainHaiku.cpp
Shared/unix/AuxiliaryProcessMain.cpp
Shared/haiku/ProcessExecutablePathHaiku.cpp
Shared/haiku/ShareableBitmapHaiku.cpp
Shared/haiku/WebCoreArgumentCodersHaiku.cpp
Shared/haiku/WebMemorySamplerHaiku.cpp

UIProcess/API/C/haiku/WKView.cpp
UIProcess/API/haiku/APIWebsiteDataStoreHaiku.cpp

UIProcess/DefaultUndoController.cpp
UIProcess/DrawingAreaProxyImpl.cpp
UIProcess/BackingStore.cpp
UIProcess/AcceleratedDrawingAreaProxy.cpp

UIProcess/Launcher/haiku/ProcessLauncherHaiku.cpp
UIProcess/LegacySessionStateCodingNone.cpp
UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
UIProcess/WebStorage/StorageManager.cpp
UIProcess/WebsiteData/haiku/WebsiteDataStoreHaiku.cpp
UIProcess/haiku/BackingStoreHaiku.cpp
UIProcess/haiku/TextCheckerHaiku.cpp
UIProcess/haiku/WebInspectorProxyHaiku.cpp
UIProcess/haiku/WebPageProxyHaiku.cpp
UIProcess/haiku/WebPreferencesHaiku.cpp
UIProcess/haiku/WebProcessPoolHaiku.cpp
UIProcess/API/haiku/WebViewBase.cpp
UIProcess/API/haiku/WebView.cpp
UIProcess/API/haiku/PageClientImplHaiku.cpp

WebProcess/Cookies/haiku/WebCookieManagerHaiku.cpp

WebProcess/InjectedBundle/haiku/InjectedBundleHaiku.cpp

WebProcess/InjectedBundle/haiku/InjectedBundleHaiku.cpp
WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp

WebProcess/WebPage/DrawingAreaImpl.cpp

WebProcess/WebCoreSupport/haiku/WebContextMenuClientHaiku.cpp
WebProcess/WebCoreSupport/haiku/WebEditorClientHaiku.cpp
WebProcess/WebCoreSupport/haiku/WebFrameNetworkingContext.cpp
WebProcess/WebCoreSupport/haiku/WebPopupMenuHaiku.cpp
WebProcess/WebPage/AcceleratedDrawingArea.cpp
WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp
WebProcess/WebPage/DrawingAreaImpl.cpp
WebProcess/WebPage/LayerTreeHost.cpp
WebProcess/WebPage/haiku/WebInspectorHaiku.cpp
WebProcess/WebPage/haiku/WebPageHaiku.cpp
WebProcess/haiku/WebProcessHaiku.cpp
WebProcess/haiku/WebProcessMainHaiku.cpp
)

list(APPEND WebKit_INCLUDE_DIRECTORIES
@@ -40,13 +74,14 @@ list(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBKIT_DIR}/Shared/API/c/haiku"
"${WEBKIT_DIR}/Shared/CoordinatedGraphics"
"${WEBKIT_DIR}/Shared/unix"
"${WEBKIT_DIR}/Shared/haiku"
"${WEBKIT_DIR}/UIProcess/API/C/CoordinatedGraphics"
"${WEBKIT_DIR}/UIProcess/API/C/haiku"
"${WEBKIT_DIR}/UIProcess/API/haiku"
"${WEBKIT_DIR}/UIProcess/haiku"
"${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
"${WEBKIT_DIR}/WebProcess/unix"
#"${WEBKIT_DIR}/WebProcess/WebCoreSupport/haiku"
"${WEBKIT_DIR}/WebProcess/WebCoreSupport/haiku"
"${WEBKIT_DIR}/WebProcess/WebPage/CoordinatedGraphics"
${LIBXML2_INCLUDE_DIR}
${LIBXSLT_INCLUDE_DIRS}
@@ -57,15 +92,17 @@ list(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/platform"
"${WEBCORE_DIR}/platform/text"
"${WEBCORE_DIR}/dom"
"${WEBCORE_DIR}/fileapi"
)

list(APPEND WebKit_LOCAL_INCLUDE_DIRECTORIES
set(WebKit_LOCAL_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/css"
"${WEBCORE_DIR}/platform/graphics"
"${WEBCORE_DIR}/platform/graphics/transforms"
"${WEBCORE_DIR}/rendering/shapes"
)

foreach(inc ${WebKitLegacy_LOCAL_INCLUDE_DIRECTORIES})
foreach(inc ${WebKit_LOCAL_INCLUDE_DIRECTORIES})
ADD_DEFINITIONS(-iquote ${inc})
endforeach(inc)

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
* Copyright (C) 2019 Haiku, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,20 +24,17 @@
*/

#include "config.h"
#include "WebProcessProxy.h"
#include "AuxiliaryProcessMain.h"

#include "NotImplemented.h"


namespace WebKit {

void WebProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
bool AuxiliaryProcessMainBase::parseCommandLine(int argc, char** argv)
{
#ifndef NDEBUG
const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
if (webProcessCmdPrefix && *webProcessCmdPrefix)
launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
#else
UNUSED_PARAM(launchOptions);
#endif
notImplemented();
return true;
}

} // namespace WebKit

@@ -39,18 +39,20 @@ namespace WebKit {

static inline RefPtr<StillImage> createSurfaceFromData(void* data, const WebCore::IntSize& size)
{
RefPtr<StillImage> image = StillImage::createForRendering(new BBitmap(
/*RefPtr<StillImage> image = StillImage::createForRendering(adoptRef(new BBitmap(
BRect(B_ORIGIN, size), B_RGBA32,
static_cast<unsigned char*>(data), B_BITMAP_ACCEPTS_VIEWS));
static_cast<unsigned char*>(data), B_BITMAP_ACCEPTS_VIEWS)));*/
NativeImagePtr imageptr;
RefPtr<StillImage> image = StillImage::createForRendering(imageptr);
return image;
}

std::unique_ptr<GraphicsContext> ShareableBitmap::createGraphicsContext()
{
RefPtr<StillImage> image = createBitmapSurface();
BView* v = new BView(image->nativeImageForCurrentFrame()->Bounds(),
BView* v = new BView(image->nativeImageForCurrentFrame(nullptr)->Bounds(),
"Shareable", 0, 0);
image->nativeImageForCurrentFrame()->AddChild(v);
image->nativeImageForCurrentFrame(nullptr)->AddChild(v);
return std::make_unique<GraphicsContext>(v);
}

@@ -63,21 +65,26 @@ void ShareableBitmap::paint(GraphicsContext& context, float scaleFactor, const I
//context.platformContext()->DrawBitmap(surface.get(), destRect, srcRectScaled);
}

PassRefPtr<StillImage> ShareableBitmap::createBitmapSurface()
RefPtr<StillImage> ShareableBitmap::createBitmapSurface()
{
RefPtr<StillImage> image = createSurfaceFromData(data(), m_size);

ref(); // Balanced by deref in releaseSurfaceData.
return image.release();
return image;
}

PassRefPtr<Image> ShareableBitmap::createImage()
RefPtr<Image> ShareableBitmap::createImage()
{
RefPtr<StillImage> surface = createBitmapSurface();
if (!surface)
return 0;

return BitmapImage::create(surface->nativeImageForCurrentFrame());
return BitmapImage::create(surface->nativeImageForCurrentFrame(nullptr));
}

Checked<unsigned, RecordOverflow> ShareableBitmap::calculateBytesPerRow(WebCore::IntSize, const ShareableBitmap::Configuration&)
{
notImplemented();
}

}
@@ -38,47 +38,47 @@ using namespace WebCore;

namespace IPC {

void ArgumentCoder<ResourceRequest>::encodePlatformData(ArgumentEncoder& encoder, const ResourceRequest& resourceRequest)
void ArgumentCoder<ResourceRequest>::encodePlatformData(Encoder& encoder, const ResourceRequest& resourceRequest)
{
notImplemented();
}

bool ArgumentCoder<ResourceRequest>::decodePlatformData(ArgumentDecoder& decoder, ResourceRequest& resourceRequest)
bool ArgumentCoder<ResourceRequest>::decodePlatformData(Decoder& decoder, ResourceRequest& resourceRequest)
{
notImplemented();
return false;
}

void ArgumentCoder<ResourceResponse>::encodePlatformData(ArgumentEncoder& encoder, const ResourceResponse& resourceResponse)
/*void ArgumentCoder<ResourceResponse>::encodePlatformData(Encoder& encoder, const ResourceResponse& resourceResponse)
{
//encoder << static_cast<uint32_t>(resourceResponse.soupMessageFlags());
}
bool ArgumentCoder<ResourceResponse>::decodePlatformData(ArgumentDecoder& decoder, ResourceResponse& resourceResponse)
bool ArgumentCoder<ResourceResponse>::decodePlatformData(Decoder& decoder, ResourceResponse& resourceResponse)
{
/*
uint32_t soupMessageFlags;
if (!decoder.decode(soupMessageFlags))
return false;
resourceResponse.setSoupMessageFlags(static_cast<SoupMessageFlags>(soupMessageFlags));
return true;
*/
//
return false;
}
}*/

void ArgumentCoder<CertificateInfo>::encode(ArgumentEncoder& encoder, const CertificateInfo& certificateInfo)
void ArgumentCoder<CertificateInfo>::encode(Encoder& encoder, const CertificateInfo& certificateInfo)
{
notImplemented();
}

bool ArgumentCoder<CertificateInfo>::decode(ArgumentDecoder& decoder, CertificateInfo& certificateInfo)
bool ArgumentCoder<CertificateInfo>::decode(Decoder& decoder, CertificateInfo& certificateInfo)
{
notImplemented();
return false;
}

void ArgumentCoder<ResourceError>::encodePlatformData(ArgumentEncoder& encoder, const ResourceError& resourceError)
void ArgumentCoder<ResourceError>::encodePlatformData(Encoder& encoder, const ResourceError& resourceError)
{
bool errorIsNull = resourceError.isNull();
encoder << errorIsNull;
@@ -92,32 +92,31 @@ void ArgumentCoder<ResourceError>::encodePlatformData(ArgumentEncoder& encoder,
encoder << resourceError.isCancellation();
encoder << resourceError.isTimeout();

encoder << CertificateInfo(resourceError);
}

bool ArgumentCoder<ResourceError>::decodePlatformData(ArgumentDecoder& decoder, ResourceError& resourceError)
bool ArgumentCoder<ResourceError>::decodePlatformData(Decoder& decoder, ResourceError& resourceError)
{
notImplemented();
return false;
}

void ArgumentCoder<ProtectionSpace>::encodePlatformData(ArgumentEncoder&, const ProtectionSpace&)
void ArgumentCoder<ProtectionSpace>::encodePlatformData(Encoder&, const ProtectionSpace&)
{
ASSERT_NOT_REACHED();
}

bool ArgumentCoder<ProtectionSpace>::decodePlatformData(ArgumentDecoder&, ProtectionSpace&)
bool ArgumentCoder<ProtectionSpace>::decodePlatformData(Decoder&, ProtectionSpace&)
{
ASSERT_NOT_REACHED();
return false;
}

void ArgumentCoder<Credential>::encodePlatformData(ArgumentEncoder&, const Credential&)
void ArgumentCoder<Credential>::encodePlatformData(Encoder&, const Credential&)
{
ASSERT_NOT_REACHED();
}

bool ArgumentCoder<Credential>::decodePlatformData(ArgumentDecoder&, Credential&)
bool ArgumentCoder<Credential>::decodePlatformData(Decoder&, Credential&)
{
ASSERT_NOT_REACHED();
return false;
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2019 Haiku 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 WebEventFactory_h
#define WebEventFactory_h

#include "WebEvent.h"

class BMessage;

namespace WebKit {

class WebEventFactory {
public:
static WebMouseEvent createWebMouseEvent(const BMessage*, int);
static WebWheelEvent createWebWheelEvent(const BMessage*);
static WebKeyboardEvent createWebKeyboardEvent(const BMessage*);
#if ENABLE(TOUCH_EVENTS)
//static WebTouchEvent createWebTouchEvent(const GdkEvent*, Vector<WebPlatformTouchPoint>&&);
#endif
};

} // namespace WebKit

#endif // WebEventFactory_h
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Haiku, Inc.
* Copyright (C) 2014,2019 Haiku, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,10 +27,15 @@

#if ENABLE(MEMORY_SAMPLER)

#include "NotImplemented.h"
#include <JavaScriptCore/JSCInlines.h>
#include <JavaScriptCore/JSLock.h>
#include <JavaScriptCore/MemoryStatistics.h>
#include <WebCore/CommonVM.h>
#include <WebCore/JSDOMWindow.h>
#include <wtf/CurrentTime.h>
#include "NotImplemented.h"
#include <string.h>
#include <wtf/WallTime.h>
#include <wtf/text/WTFString.h>

#include <OS.h>

@@ -84,19 +89,19 @@ WebMemoryStatistics WebMemorySampler::sampleWebKit() const
{
WebMemoryStatistics webKitMemoryStats;

double now = currentTime();
WallTime now = WallTime::now();

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Timestamp"), now);
appendKeyValuePair(webKitMemoryStats, "Timestamp"_s, now.secondsSinceEpoch().seconds());

ApplicationMemoryStats applicationStats = sampleMemoryAllocatedForApplication();

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Total Program Size"), applicationStats.totalProgramSize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("RSS"), applicationStats.residentSetSize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Shared"), applicationStats.sharedSize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Text"), applicationStats.textSize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Library"), applicationStats.librarySize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Data/Stack"), applicationStats.dataStackSize);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Dirty"), applicationStats.dirtyPageSize);
appendKeyValuePair(webKitMemoryStats, "Total Program Size"_s, applicationStats.totalProgramSize);
appendKeyValuePair(webKitMemoryStats, "RSS"_s, applicationStats.residentSetSize);
appendKeyValuePair(webKitMemoryStats, "Shared"_s, applicationStats.sharedSize);
appendKeyValuePair(webKitMemoryStats, "Text"_s, applicationStats.textSize);
appendKeyValuePair(webKitMemoryStats, "Library"_s, applicationStats.librarySize);
appendKeyValuePair(webKitMemoryStats, "Data/Stack"_s, applicationStats.dataStackSize);
appendKeyValuePair(webKitMemoryStats, "Dirty"_s, applicationStats.dirtyPageSize);

size_t totalBytesInUse = 0;
size_t totalBytesCommitted = 0;
@@ -108,36 +113,36 @@ WebMemoryStatistics WebMemorySampler::sampleWebKit() const
totalBytesInUse += fastMallocBytesInUse;
totalBytesCommitted += fastMallocBytesCommitted;

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Fast Malloc In Use"), fastMallocBytesInUse);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Fast Malloc Committed Memory"), fastMallocBytesCommitted);
appendKeyValuePair(webKitMemoryStats, "Fast Malloc In Use"_s, fastMallocBytesInUse);
appendKeyValuePair(webKitMemoryStats, "Fast Malloc Committed Memory"_s, fastMallocBytesCommitted);
#endif

size_t jscHeapBytesInUse = JSDOMWindow::commonVM().heap.size();
size_t jscHeapBytesCommitted = JSDOMWindow::commonVM().heap.capacity();
size_t jscHeapBytesInUse = commonVM().heap.size();
size_t jscHeapBytesCommitted = commonVM().heap.capacity();
totalBytesInUse += jscHeapBytesInUse;
totalBytesCommitted += jscHeapBytesCommitted;

GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
totalBytesInUse += globalMemoryStats.stackBytes + globalMemoryStats.JITBytes;
totalBytesCommitted += globalMemoryStats.stackBytes + globalMemoryStats.JITBytes;

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("JavaScript Heap In Use"), jscHeapBytesInUse);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("JavaScript Heap Commited Memory"), jscHeapBytesCommitted);
appendKeyValuePair(webKitMemoryStats, "JavaScript Heap In Use"_s, jscHeapBytesInUse);
appendKeyValuePair(webKitMemoryStats, "JavaScript Heap Commited Memory"_s, jscHeapBytesCommitted);

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("JavaScript Stack Bytes"), globalMemoryStats.stackBytes);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("JavaScript JIT Bytes"), globalMemoryStats.JITBytes);
appendKeyValuePair(webKitMemoryStats, "JavaScript Stack Bytes"_s, globalMemoryStats.stackBytes);
appendKeyValuePair(webKitMemoryStats, "JavaScript JIT Bytes"_s, globalMemoryStats.JITBytes);

appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Total Memory In Use"), totalBytesInUse);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Total Committed Memory"), totalBytesCommitted);
appendKeyValuePair(webKitMemoryStats, "Total Memory In Use"_s, totalBytesInUse);
appendKeyValuePair(webKitMemoryStats, "Total Committed Memory"_s, totalBytesCommitted);

system_info systemInfo;
if (!get_system_info(&systemInfo)) {
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("System Total Bytes"), systemInfo.max_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Available Bytes"), systemInfo.free_memory);
//appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Shared Bytes"), systemInfo.sharedram);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Buffer Bytes"), systemInfo.block_cache_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Total Swap Bytes"), systemInfo.max_swap_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, ASCIILiteral("Available Swap Bytes"), systemInfo.free_swap_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, "System Total Bytes"_s, systemInfo.max_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, "Available Bytes"_s, systemInfo.free_memory);
//appendKeyValuePair(webKitMemoryStats, "Shared Bytes"_s, systemInfo.sharedram);
appendKeyValuePair(webKitMemoryStats, "Buffer Bytes"_s, systemInfo.block_cache_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, "Total Swap Bytes"_s, systemInfo.max_swap_pages * B_PAGE_SIZE);
appendKeyValuePair(webKitMemoryStats, "Available Swap Bytes"_s, systemInfo.free_swap_pages * B_PAGE_SIZE);
}

return webKitMemoryStats;
@@ -33,10 +33,10 @@ namespace WebKit {

bool AuxiliaryProcessMainBase::parseCommandLine(int argc, char** argv)
{
fprintf(stderr,"\naux:%s\n",argv[1]);
ASSERT(argc >= 3);
if (argc < 3)
return false;

m_parameters.processIdentifier = makeObjectIdentifier<WebCore::ProcessIdentifierType>(atoll(argv[1]));
m_parameters.connectionIdentifier = atoi(argv[2]);
return true;
@@ -56,7 +56,7 @@ int AuxiliaryProcessMain(int argc, char** argv)

if (!auxiliaryMain.platformInitialize())
return EXIT_FAILURE;

InitializeWebKit2();

if (!auxiliaryMain.parseCommandLine(argc, argv))
@@ -65,7 +65,7 @@ int AuxiliaryProcessMain(int argc, char** argv)
initializeAuxiliaryProcess<AuxiliaryProcessType>(auxiliaryMain.takeInitializationParameters());
RunLoop::run();
auxiliaryMain.platformFinalize();

return EXIT_SUCCESS;
}

@@ -31,6 +31,9 @@

#if defined(WIN32) || defined(_WIN32)
typedef int WKProcessID;
#elif PLATFORM(HAIKU)
#include <wtf/ProcessID.h>
typedef WTF::ProcessID WKProcessID;
#else
#include <unistd.h>
typedef pid_t WKProcessID;
@@ -31,6 +31,9 @@

#if defined(WIN32) || defined(_WIN32)
typedef int WKProcessID;
#elif PLATFORM(HAIKU)
#include <wtf/ProcessID.h>
typedef WTF::ProcessID WKProcessID;
#else
#include <unistd.h>
typedef pid_t WKProcessID;
@@ -26,13 +26,13 @@

namespace WebKit {

class WebView;
class WebPopupItemHaiku;
class WebPopupMenuListenerHaiku;
class WebViewBase;
//class WebPopupItemHaiku;
//class WebPopupMenuListenerHaiku;

WK_ADD_API_MAPPING(WKViewRef, WebView)
WK_ADD_API_MAPPING(WKPopupItemRef, WebPopupItemHaiku)
WK_ADD_API_MAPPING(WKPopupMenuListenerRef, WebPopupMenuListenerHaiku)
WK_ADD_API_MAPPING(WKViewRef, WebViewBase)
//WK_ADD_API_MAPPING(WKPopupItemRef, WebPopupItemHaiku)
//WK_ADD_API_MAPPING(WKPopupMenuListenerRef, WebPopupMenuListenerHaiku)

}

@@ -1,6 +1,7 @@
/*
* Copyright (C) 2012 Samsung Electronics
* Copyright (C) 2013 Intel Corporation. All rights reserved.
* Copyright (C) 2019 Haiku, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,21 +22,21 @@
#include "config.h"
#include "WKView.h"

#include <WebView.h>
#include <WebViewPrivate.h>
#include "WKAPICast.h"

#include "APIPageConfiguration.h"
#include "WKAPICast.h"
#include "WebViewBase.h"
using namespace WebCore;
using namespace WebKit;

WKViewRef WKViewCreate(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
WKViewRef WKViewCreate(const char* name,BRect rect,BWindow* parentWindow,
WKPageConfigurationRef pageRef)
{
RefPtr<WebView> webView = WebView::create(toImpl(contextRef), toImpl(pageGroupRef));
return toAPI(webView.release().leakRef());
fprintf(stderr,"\n create page");
return toAPI(WebViewBase::create(name,rect,parentWindow,*toImpl(pageRef)).leakRef());
}

WKPageRef WKViewGetPage(WKViewRef viewRef)
{
return toImpl(viewRef)->pageRef();
}

fprintf(stderr,"\nget page");
return toAPI(toImpl(viewRef)->page());
}
@@ -29,15 +29,14 @@
#define WKView_h

#include <WebKit/WKBase.h>
#include <Window.h>

#ifdef __cplusplus
extern "C" {
#endif

WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageGroupRef pageGroup);

WK_EXPORT WKViewRef WKViewCreate(const char*,BRect,BWindow*,WKPageConfigurationRef pageRef);
WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);

#ifdef __cplusplus
}
#endif
@@ -0,0 +1,156 @@
/*
* Copyright (C) 2019 Haiku Inc.,
*
* 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 "APIWebsiteDataStore.h"

#include <wtf/FileSystem.h>

#include "NotImplemented.h"

namespace API {

String WebsiteDataStore::defaultApplicationCacheDirectory()
{
fprintf(stderr,"error");
notImplemented();
return String();
}

String WebsiteDataStore::defaultCacheStorageDirectory()
{
return String();
}

String WebsiteDataStore::defaultNetworkCacheDirectory()
{
return String();
}

String WebsiteDataStore::defaultIndexedDBDatabaseDirectory()
{
return String();
}

String WebsiteDataStore::defaultServiceWorkerRegistrationDirectory()
{
return String();
}

String WebsiteDataStore::defaultLocalStorageDirectory()
{
return String();
}

String WebsiteDataStore::defaultMediaKeysStorageDirectory()
{
return String();
}

String WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory()
{
return String();
}

String WebsiteDataStore::defaultWebSQLDatabaseDirectory()
{
return String();
}

String WebsiteDataStore::defaultResourceLoadStatisticsDirectory()
{
return String();
}

String WebsiteDataStore::cacheDirectoryFileSystemRepresentation(const String& directoryName)
{
return String();
}

String WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation(const String& directoryName)
{
return String();
}

String WebsiteDataStore::legacyDefaultApplicationCacheDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultNetworkCacheDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultWebSQLDatabaseDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultIndexedDBDatabaseDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultLocalStorageDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultMediaCacheDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultMediaKeysStorageDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory()
{
return String();
}

String WebsiteDataStore::legacyDefaultJavaScriptConfigurationDirectory()
{
return String();
}

Ref<WebKit::WebsiteDataStoreConfiguration> WebsiteDataStore::defaultDataStoreConfiguration()
{
auto configuration = WebKit::WebsiteDataStoreConfiguration::create();

configuration->setApplicationCacheDirectory(defaultApplicationCacheDirectory());
configuration->setNetworkCacheDirectory(defaultNetworkCacheDirectory());
configuration->setWebSQLDatabaseDirectory(defaultWebSQLDatabaseDirectory());
configuration->setLocalStorageDirectory(defaultLocalStorageDirectory());
configuration->setMediaKeysStorageDirectory(defaultMediaKeysStorageDirectory());
configuration->setResourceLoadStatisticsDirectory(defaultResourceLoadStatisticsDirectory());

return configuration;
}

} // namespace API
@@ -0,0 +1,317 @@
/*
* Copyright (C) 2019 Haiku, 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 "PageClientImplHaiku.h"
#include "WebProcessProxy.h"
#include "DrawingAreaProxyImpl.h"
#include "WebViewBase.h"

namespace WebKit
{
using namespace WebCore;

PageClientImpl::PageClientImpl(WebViewBase& view)
:fWebView(view)
{
//fprintf(stderr,"page client called");
}
std::unique_ptr<DrawingAreaProxy> PageClientImpl::createDrawingAreaProxy(
WebProcessProxy& process)
{
//fprintf(stderr,"called drawing area");
return std::make_unique<DrawingAreaProxyImpl>(*fWebView.page(),process);
}
void PageClientImpl::setViewNeedsDisplay(const WebCore::Region& region)
{
fprintf(stderr,"printing");
//fWebView.setViewNeedsDisplay(region);
}

void PageClientImpl::requestScroll(const WebCore::FloatPoint&, const WebCore::IntPoint&, bool)
{
notImplemented();
}

WebCore::FloatPoint PageClientImpl::viewScrollPosition()
{
notImplemented();
return { };
}

WebCore::IntSize PageClientImpl::viewSize()
{
notImplemented();
/*if (fWebView.drawingArea())
return fWebView.drawingArea()->size();
return IntSize();*/
}

bool PageClientImpl::isViewWindowActive()
{
//return fWebView.isWindowActive();
}

bool PageClientImpl::isViewFocused()
{
//return fWebView.isFocused();
}

bool PageClientImpl::isViewVisible()
{
//return fWebView.isVisible();
}

bool PageClientImpl::isViewInWindow()
{
//return fWebView.isInWindow();
}

void PageClientImpl::PageClientImpl::processDidExit()
{
notImplemented();
}

void PageClientImpl::didRelaunchProcess()
{
notImplemented();
}

void PageClientImpl::toolTipChanged(const String&, const String& newToolTip)
{
//fWebView.setToolTip(newToolTip);
}

void PageClientImpl::setCursor(const WebCore::Cursor& cursor)
{
//fWebView.setCursor(cursor);
}

void PageClientImpl::setCursorHiddenUntilMouseMoves(bool /* hiddenUntilMouseMoves */)
{
notImplemented();
}

void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&)
{
notImplemented();
}

void PageClientImpl::registerEditCommand(Ref<WebEditCommandProxy>&& command, UndoOrRedo undoOrRedo)
{
fUndoController.registerEditCommand(WTFMove(command), undoOrRedo);
}

void PageClientImpl::clearAllEditCommands()
{
fUndoController.clearAllEditCommands();
}

bool PageClientImpl::canUndoRedo(UndoOrRedo undoOrRedo)
{
return fUndoController.canUndoRedo(undoOrRedo);
}

void PageClientImpl::executeUndoRedo(UndoOrRedo undoOrRedo)
{
fUndoController.executeUndoRedo(undoOrRedo);
}

FloatRect PageClientImpl::convertToDeviceSpace(const FloatRect& viewRect)
{
notImplemented();
return viewRect;
}

FloatRect PageClientImpl::convertToUserSpace(const FloatRect& viewRect)
{
notImplemented();
return viewRect;
}

IntPoint PageClientImpl::screenToRootView(const IntPoint& point)
{
return IntPoint();
}

IntRect PageClientImpl::rootViewToScreen(const IntRect& rect)
{
return IntRect();
}

void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled)
{
notImplemented();
}

RefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy& page)
{
fprintf(stderr,"context menu");
notImplemented();
//return WebPopupMenuProxyWin::create(&fWebView, page);
}

#if ENABLE(CONTEXT_MENUS)
Ref<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& page, ContextMenuContextData&& context, const UserData& userData)
{
notImplemented();
//return WebContextMenuProxyWin::create(page, WTFMove(context), userData);
}
#endif

//#if ENABLE(INPUT_TYPE_COLOR)
RefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy*, const WebCore::Color& intialColor,
const WebCore::IntRect&, Vector<WebCore::Color>&&)
{
return nullptr;
}
//#endif

void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
{
notImplemented();
}

void PageClientImpl::exitAcceleratedCompositingMode()
{
notImplemented();
}

void PageClientImpl::updateAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
{
notImplemented();
}

void PageClientImpl::pageClosed()
{
notImplemented();
}

void PageClientImpl::preferencesDidChange()
{
notImplemented();
}

void PageClientImpl::didChangeContentSize(const IntSize& size)
{
notImplemented();
}

void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
{
notImplemented();
}

void PageClientImpl::didCommitLoadForMainFrame(const String& /* mimeType */, bool /* useCustomContentProvider */ )
{
notImplemented();
}
void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent& event)
{
notImplemented();
}

void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String&, const IPC::DataReference&)
{
notImplemented();
}

void PageClientImpl::navigationGestureDidBegin()
{
notImplemented();
}

void PageClientImpl::navigationGestureWillEnd(bool, WebBackForwardListItem&)
{
notImplemented();
}

void PageClientImpl::navigationGestureDidEnd(bool, WebBackForwardListItem&)
{
notImplemented();
}

void PageClientImpl::navigationGestureDidEnd()
{
notImplemented();
}

void PageClientImpl::willRecordNavigationSnapshot(WebBackForwardListItem&)
{
notImplemented();
}

void PageClientImpl::didRemoveNavigationGestureSnapshot()
{
notImplemented();
}

void PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame()
{
notImplemented();
}

void PageClientImpl::didFinishLoadForMainFrame()
{
notImplemented();
}

void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType)
{
notImplemented();
}

void PageClientImpl::didChangeBackgroundColor()
{
notImplemented();
}

void PageClientImpl::isPlayingAudioWillChange()
{
notImplemented();
}

void PageClientImpl::isPlayingAudioDidChange()
{
notImplemented();
}

void PageClientImpl::refView()
{
notImplemented();
}

void PageClientImpl::derefView()
{
notImplemented();
}

BView* PageClientImpl::viewWidget()
{
return fWebView.getView();
}

}

@@ -0,0 +1,121 @@
/*
* Copyright (C) 2019 Haiku, 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.
*/
#pragma once

#include "PageClient.h"
#include "WebPageProxy.h"
#include "DefaultUndoController.h"

namespace WebKit
{
class WebViewBase;
class DrawingAreaProxy;
class PageClientImpl: public PageClient
{
public:
PageClientImpl(WebViewBase&);
BView* viewWidget();
private:
//page client def's
std::unique_ptr<DrawingAreaProxy> createDrawingAreaProxy(WebProcessProxy&) override;
void setViewNeedsDisplay(const WebCore::Region&) override;
void requestScroll(const WebCore::FloatPoint& scrollPosition, const WebCore::IntPoint& scrollOrigin, bool isProgrammaticScroll) override;
WebCore::FloatPoint viewScrollPosition() override;
WebCore::IntSize viewSize() override;
bool isViewWindowActive() override;
bool isViewFocused() override;
bool isViewVisible() override;
bool isViewInWindow() override;
void processDidExit() override;
void didRelaunchProcess() override;
void pageClosed() override;
void preferencesDidChange() override;
void toolTipChanged(const WTF::String&, const WTF::String&) override;
void setCursor(const WebCore::Cursor&) override;
void setCursorHiddenUntilMouseMoves(bool) override;
void didChangeViewportProperties(const WebCore::ViewportAttributes&) override;
void registerEditCommand(Ref<WebEditCommandProxy>&&, UndoOrRedo) override;
void clearAllEditCommands() override;
bool canUndoRedo(UndoOrRedo) override;
void executeUndoRedo(UndoOrRedo) override;
WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) override;
WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) override;
WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) override;
WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override;
Ref<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, ContextMenuContextData&&, const UserData&) override;

#if ENABLE(INPUT_TYPE_COLOR)
RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor,
const WebCore::IntRect&,Vector<WebCore::Color>&&) override;
#endif

void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
void exitAcceleratedCompositingMode() override;
void updateAcceleratedCompositingMode(const LayerTreeContext&) override;

void handleDownloadRequest(DownloadProxy*) override;
void didChangeContentSize(const WebCore::IntSize&) override;
void didCommitLoadForMainFrame(const String& mimeType, bool useCustomContentProvider) override;
void didFailLoadForMainFrame() override { }


void didFinishLoadingDataForCustomContentProvider(const String& suggestedFilename, const IPC::DataReference&) override;
void navigationGestureDidBegin() override;
void navigationGestureWillEnd(bool, WebBackForwardListItem&) override;
void navigationGestureDidEnd(bool, WebBackForwardListItem&) override;
void navigationGestureDidEnd() override;
void willRecordNavigationSnapshot(WebBackForwardListItem&) override;
void didRemoveNavigationGestureSnapshot() override;

void didFirstVisuallyNonEmptyLayoutForMainFrame() override;
void didFinishLoadForMainFrame() override;
void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override;

void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;

void didChangeBackgroundColor() override;
void isPlayingAudioWillChange() override;
void isPlayingAudioDidChange() override;

void refView() override;
void derefView() override;

void didRestoreScrollPosition() override { }

WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; }

void didFinishProcessingAllPendingMouseEvents() final { }


DefaultUndoController fUndoController;

//haiku def
WebViewBase& fWebView;
};


}
@@ -1,44 +1,74 @@
/*
Copyright (C) 2014 Haiku, inc.
* Copyright (C) 2019 Haiku, 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.
*/

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
#include <Window.h>
#include <View.h>

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "WKPageConfigurationRef.h"
#include "WKPage.h"
#include "WKView.h"
#include "WKURL.h"
#include "WKString.h"
#include "WKContext.h"
#include "WKPreferencesRef.h"

#include "config.h"
#include "WebView.h"

#include "NotImplemented.h"
#include "WebContext.h"
#include "WebPageGroup.h"
#include "wtf/RunLoop.h"

using namespace WebKit;

BWebView::BWebView(WKContextRef context, WKPageGroupRef pageGroup)
: BView("web view", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
#include "WebView.h"
BWebView::BWebView(BRect frame,BWindow* myWindow)
{
fWebView = adoptWK(WKViewCreate(context, pageGroup));
initializeOnce();
//webkit stuff
auto config = adoptWK(WKPageConfigurationCreate());
auto prefs = WKPreferencesCreate();


WKPreferencesSetDeveloperExtrasEnabled(prefs, true);
WKPageConfigurationSetPreferences(config.get(),prefs);

fContext = adoptWK(WKContextCreateWithConfiguration(nullptr));
//fprintf(stderr,"here");
WKPageConfigurationSetContext(config.get(),fContext.get());

fViewPort=adoptWK(WKViewCreate("Webkit",frame,myWindow,config.get()));
//
}

WKViewRef BWebView::GetWKView()
void BWebView::initializeOnce()
{
return fWebView.get();
WTF::RunLoop::initializeMainRunLoop();
WTF::RunLoop::run();
}

WKPageRef BWebView::pageRef()
void BWebView::loadHTML()
{
return WKViewGetPage(GetWKView());
fprintf(stderr,"\nim loading");
auto page = WKViewGetPage( fViewPort.get());
WKRetainPtr<WKURLRef> uri;
uri = adoptWK(WKURLCreateWithUTF8CString("about:blank"));
WKRetainPtr<WKStringRef> str;
str = adoptWK(WKStringCreateWithUTF8CString("<body>Hello world</body>"));
//WKPageLoadURL(page,uri.get());
WKPageLoadHTMLString(page,str.get(),uri.get());
}

@@ -1,38 +1,42 @@
/*
Copyright (C) 2014 Haiku, inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/

#include <View.h>

#include "APIObject.h"
#include "WKBase.h"
#include "WKRetainPtr.h"
* Copyright (C) 2019 Haiku, 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 "WKPage.h"
#include "WKView.h"

class BWebView: public BView
#include "WKContext.h"
#include "WKRetainPtr.h"
using namespace WebKit;
class BWebView
{
public:
BWebView(WKContextRef, WKPageGroupRef);

WKViewRef GetWKView();
WKPageRef pageRef();

private:
WKRetainPtr<WKViewRef> fWebView;
public:
BWebView(BRect,BWindow*);
void initializeOnce();
void loadHTML();
private:
WKRetainPtr<WKViewRef> fViewPort;
WKRetainPtr<WKContextRef> fContext;
};


@@ -0,0 +1,101 @@
/*
* Copyright (C) 2019 Haiku, 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 "WebViewBase.h"
#include "APIPageConfiguration.h"
#include "WebProcessPool.h"
#include "WebPageGroup.h"
#include "DrawingAreaProxyImpl.h"
#include <WebCore/IntRect.h>

using namespace WebKit;
using namespace WebCore;

WebKit::WebViewBase::WebViewBase(const char*name,BRect rect,BWindow* parentWindow,
const API::PageConfiguration& pageConfig)
:BView(name,B_WILL_DRAW),
fViewPort(new BView(name,B_WILL_DRAW)),
fPageClient(std::make_unique<PageClientImpl>(*this))
{
fprintf(stderr,"Init");
parentWindow->AddChild(fViewPort);
auto config = pageConfig.copy();
auto* preferences = config->preferences();

if(!preferences && config->pageGroup())
{
fprintf(stderr,"config");
preferences = &config->pageGroup()->preferences();
config->setPreferences(preferences);
}
if(preferences)
{
preferences->setAcceleratedCompositingEnabled(false);
}

WebProcessPool* processPool = config->processPool();
fPage = processPool->createWebPage(*fPageClient,WTFMove(config));
fPage->initializeWebPage();

if(fPage->drawingArea())
{
fprintf(stderr,"drawing available");
fPage->drawingArea()->setSize(IntSize(rect.right - rect.left,
rect.top - rect.bottom));
}
BRect p(0,0,10,20);
paint(WebCore::IntRect(p));
}

static void drawPageBackground(const WebPageProxy* page,const BRect& rect)
{
if(!page->drawsBackground())
return;


}

void WebViewBase::paint(const IntRect& dirtyRect)
{
if(dirtyRect.isEmpty())
{
fprintf(stderr,"its empty\n");
return;
}
fPage->endPrinting();
if(DrawingAreaProxyImpl* drawingArea = static_cast <DrawingAreaProxyImpl*>(fPage->drawingArea()))
{
fprintf(stderr,"its painting\n");
WebCore::Region unpainted;
BView* surface = new BView("drawing_surface",B_WILL_DRAW);
drawingArea->paint(surface,dirtyRect,unpainted);
}
else
{
drawPageBackground(fPage.get(),dirtyRect);
}
}



@@ -0,0 +1,60 @@
/*
* Copyright (C) 2019 Haiku, 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 <View.h>
#include <Window.h>
#include <Rect.h>
#include "APIObject.h"
#include "APIPageConfiguration.h"
#include "WebPageProxy.h"
#include "PageClientImplHaiku.h"

using namespace WebKit;
namespace WebKit
{
class WebViewBase:public API::ObjectImpl<API::Object::Type::View>,
public BView
{
public:
static RefPtr<WebViewBase> create(const char*name,BRect rect,
BWindow* parentWindow,const API::PageConfiguration& config)
{
fprintf(stderr,"yolo");
auto fWebView=adoptRef(*new WebViewBase(name,rect,parentWindow,config));
fprintf(stderr,"im stuff");
return fWebView;
}
WebPageProxy* page() const { return fPage.get(); }
BView* getView() const {return fViewPort;}
void initializeOnce();
private:
WebViewBase(const char*,BRect,BWindow*,const API::PageConfiguration&);

void paint(const WebCore::IntRect&);

BView* fViewPort {nullptr};
RefPtr<WebPageProxy> fPage;
std::unique_ptr<PageClientImpl> fPageClient;
};
}
@@ -65,7 +65,8 @@ void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context,
unpaintedRegion = rect;

if (isInAcceleratedCompositingMode())
return;
{fprintf(stderr,"\nExiting impl");
return;}

ASSERT(m_currentBackingStoreStateID <= m_nextBackingStoreStateID);
if (m_currentBackingStoreStateID < m_nextBackingStoreStateID) {
@@ -75,7 +76,9 @@ void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context,

// If we haven't yet received our first bits from the WebProcess then don't paint anything.
if (!m_hasReceivedFirstUpdate)
return;
{
fprintf(stderr,"not recieved anything\n");return;
}

if (m_isWaitingForDidUpdateBackingStoreState) {
// Wait for a DidUpdateBackingStoreState message that contains the new bits before we paint
@@ -48,6 +48,7 @@ void ProcessLauncher::didFinishLaunchingProcess(ProcessID processIdentifier, IPC
m_processIdentifier = processIdentifier;
m_isLaunching = false;


if (!m_client) {
// FIXME: Make Identifier a move-only object and release port rights/connections in the destructor.
#if OS(DARWIN) && !PLATFORM(GTK)
@@ -57,7 +58,7 @@ void ProcessLauncher::didFinishLaunchingProcess(ProcessID processIdentifier, IPC
#endif
return;
}

m_client->didFinishLaunching(this, identifier);
}

@@ -1,136 +1,115 @@
/*
Copyright (C) 2012 Samsung Electronics
Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
* Copyright (C) 2019 Haiku, Inc.
*
* 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 "ProcessLauncher.h"

#include "Connection.h"
#include "ProcessExecutablePath.h"
#include <WebCore/AuthenticationChallenge.h>
#include <WebCore/FileSystem.h>
#include <WebCore/NetworkingContext.h>
#include <WebCore/ResourceHandle.h>
#include <signal.h>
#include <sys/socket.h>
#define __STDC_FORMAT_MACROS
#include <unistd.h>
#include <wtf/RunLoop.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
#include <string>
#include <inttypes.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/resource.h>

#include <Looper.h>
#include <Application.h>
#include <Message.h>

using namespace WebCore;

namespace WebKit {

static Vector<std::unique_ptr<char[]>> createArgsArray(const String& prefix, const String& executablePath, const String& socket, const String& pluginPath)
static const char* processName(ProcessLauncher::ProcessType type)
{
ASSERT(!executablePath.isEmpty());
ASSERT(!socket.isEmpty());

Vector<String> splitArgs;
prefix.split(' ', splitArgs);

splitArgs.append(executablePath);
splitArgs.append(socket);
if (!pluginPath.isEmpty())
splitArgs.append(pluginPath);

Vector<std::unique_ptr<char[]>> args;
args.resize(splitArgs.size() + 1); // Extra room for null.

size_t numArgs = splitArgs.size();
for (size_t i = 0; i < numArgs; ++i) {
CString param = splitArgs[i].utf8();
args[i] = std::make_unique<char[]>(param.length() + 1); // Room for the terminating null coming from the CString.
strncpy(args[i].get(), param.data(), param.length() + 1); // +1 here so that strncpy copies the ending null.
}
// execvp() needs the pointers' array to be null-terminated.
args[numArgs] = nullptr;

return args;
switch(type)
{
case ProcessLauncher::ProcessType::Web:
//debug later will be taken system based absolute path
return "/WebKit/webkit/WebKitBuild/Release/bin/WebProcess";
case ProcessLauncher::ProcessType::Network:
return "/WebKit/webkit/WebKitBuild/Release/bin/NetworkProcess";
}
}

void ProcessLauncher::launchProcess()
{
int sockets[2];
if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) < 0) {
ASSERT_NOT_REACHED();
return;
}

String processCmdPrefix, executablePath, pluginPath;
switch (m_launchOptions.processType) {
case WebProcess:
executablePath = executablePathOfWebProcess();
break;
#if ENABLE(PLUGIN_PROCESS)
case PluginProcess:
executablePath = executablePathOfPluginProcess();
pluginPath = m_launchOptions.extraInitializationData.get("plugin-path");
break;
#endif
#if ENABLE(NETWORK_PROCESS)
case NetworkProcess:
executablePath = executablePathOfNetworkProcess();
break;
#endif
default:
ASSERT_NOT_REACHED();
return;
}

#ifndef NDEBUG
if (!m_launchOptions.processCmdPrefix.isEmpty())
processCmdPrefix = m_launchOptions.processCmdPrefix;
#endif
auto args = createArgsArray(processCmdPrefix, executablePath, String::number(sockets[0]), pluginPath);

// Do not perform memory allocation in the middle of the fork()
// exec() below. FastMalloc can potentially deadlock because
// the fork() doesn't inherit the running threads.
pid_t pid = fork();
if (!pid) { // Child process.
close(sockets[1]);
execvp(args.data()[0].get(), reinterpret_cast<char* const*>(args.data()));
} else if (pid > 0) { // parent process;
close(sockets[0]);
m_processIdentifier = pid;
// We've finished launching the process, message back to the main run loop.
RunLoop::main().dispatch(bind(&ProcessLauncher::didFinishLaunchingProcess, this, pid, sockets[1]));
} else {
ASSERT_NOT_REACHED();
return;
}
const char* name=processName(m_launchOptions.processType);
char* procName;
switch(m_launchOptions.processType)
{
case ProcessLauncher::ProcessType::Web:
procName="WebProcess";
break;
case ProcessLauncher::ProcessType::Network:
procName="NetworkProcess";
break;
}
//process identifier
uint64_t prID = m_launchOptions.processIdentifier.toUInt64();
fprintf(stderr,"\nlaunch%d\n",prID);
char buff[21];
snprintf(buff,sizeof(buff),"%"PRIu64,prID);
//

//socket
int sockets[2];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, sockets)==-1)
{
fprintf(stderr,":(%s\n",strerror(errno));
}
//1-> client 0-> server is taken convention

std::string sock = std::to_string(sockets[1]);
char* sockBuff = new char[sock.length()+1];
strcpy(sockBuff,sock.c_str());
//

pid_t pid=fork();
char* m_args[]={procName,buff,sockBuff,NULL};
if(pid==0)
{

execvp(name,m_args);
}
else
{
fprintf(stderr,"\nChild:%d\n",pid);
}

fprintf(stderr,"\ngoing to send\n");
RefPtr<ProcessLauncher> protectedLauncher(this);

RunLoop::main().dispatch([protectedLauncher,pid,sockets]{
fprintf(stderr,"Messaged function executing now\n");
protectedLauncher->didFinishLaunchingProcess(pid,sockets[0]);
});
}

void ProcessLauncher::terminateProcess()
{
if (m_isLaunching) {
invalidate();
return;
}

if (!m_processIdentifier)
return;
kill(m_processIdentifier, SIGKILL);
m_processIdentifier = 0;
}

void ProcessLauncher::platformInvalidate()
@@ -0,0 +1,16 @@
<?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>com.apple.security.device.usb</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<string>com.apple.Safari.SafeBrowsing.Service</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.temporary-exception.files.absolute-path.read-only</key>
<string>/</string>
</dict>
</plist>
@@ -35,7 +35,6 @@ void WebContextConnectionClient::didCreateConnection(WebProcessPool* processPool
{
if (!m_client.didCreateConnection)
return;

m_client.didCreateConnection(toAPI(processPool), toAPI(connection), m_client.base.clientInfo);
}

@@ -803,15 +803,15 @@ void WebPageProxy::swapToWebProcess(Ref<WebProcessProxy>&& process, std::unique_
void WebPageProxy::finishAttachingToWebProcess(ShouldInitializeWebPage shouldInitializePage)
{
ASSERT(m_process->state() != AuxiliaryProcessProxy::State::Terminated);

fprintf(stderr,"step1\n");
if (m_process->state() == AuxiliaryProcessProxy::State::Running) {
m_webProcessLifetimeTracker.webPageEnteringWebProcess();
processDidFinishLaunching();
}

updateActivityState();
updateThrottleState();

fprintf(stderr,"step2\n");
#if ENABLE(FULLSCREEN_API)
m_fullScreenManager = std::make_unique<WebFullScreenManagerProxy>(*this, pageClient().fullScreenManagerProxyClient());
#endif
@@ -847,9 +847,10 @@ void WebPageProxy::finishAttachingToWebProcess(ShouldInitializeWebPage shouldIni

clearInspectorTargets();
createInspectorTargets();

fprintf(stderr,"step3-1\n");
pageClient().didRelaunchProcess();
m_pageLoadState.didSwapWebProcesses();
fprintf(stderr,"step3\n");
m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
}

@@ -1061,9 +1062,11 @@ void WebPageProxy::addPlatformLoadParameters(LoadParameters&)

RefPtr<API::Navigation> WebPageProxy::loadRequest(ResourceRequest&& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData)
{
fprintf(stderr,"Access:");
fprintf(stderr,"loadRequest: %d",m_isClosed);
if (m_isClosed)
return nullptr;

RELEASE_LOG_IF_ALLOWED(Loading, "loadRequest: webPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_pageID);

if (!isValid())
@@ -1168,7 +1171,7 @@ RefPtr<API::Navigation> WebPageProxy::loadData(const IPC::DataReference& data, c

if (!isValid())
reattachToWebProcess();

fprintf(stderr,"loadData: webPID = %i, pageID = %" PRIu64, m_process->processIdentifier(), m_pageID);
auto navigation = m_navigationState->createLoadDataNavigation(std::make_unique<API::SubstituteData>(data.vector(), MIMEType, encoding, baseURL, userData));
loadDataWithNavigationShared(m_process.copyRef(), navigation, data, MIMEType, encoding, baseURL, userData, ShouldTreatAsContinuingLoad::No);
return WTFMove(navigation);
@@ -7292,7 +7295,7 @@ void WebPageProxy::updateBackingStoreDiscardableState()
isDiscardable = false;
else
isDiscardable = !pageClient().isViewWindowActive() || !isViewVisible();

m_drawingArea->setBackingStoreIsDiscardable(isDiscardable);
}

@@ -123,6 +123,10 @@ OBJC_CLASS _WKRemoteObjectRegistry;
#include "ArgumentCodersGtk.h"
#endif

#if PLATFORM(HAIKU)
#include <View.h>
#endif

#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
#include <WebCore/MediaPlaybackTargetPicker.h>
#include <WebCore/WebMediaSessionManagerClient.h>
@@ -218,6 +222,10 @@ typedef struct OpaqueJSContext* JSGlobalContextRef;
typedef HWND PlatformWidget;
#endif

#if PLATFORM(HAIKU)
typedef BView* PlatformWidget;
#endif

namespace WebKit {
class DrawingAreaProxy;
class EditableImageController;
@@ -768,6 +776,9 @@ class WebPageProxy : public API::ObjectImpl<API::Object::Type::Page>
#if PLATFORM(WPE)
struct wpe_view_backend* viewBackend();
#endif
#if PLATFORM(HAIKU)
PlatformWidget viewWidget();
#endif

bool isProcessingMouseEvents() const;
void processNextQueuedMouseEvent();
@@ -256,6 +256,7 @@ WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration& configuration)
, m_backgroundWebProcessCounter([this](RefCounterEvent) { updateProcessAssertions(); })
#endif
{
fprintf(stderr,"initwebprocesspool\n");
static std::once_flag onceFlag;
std::call_once(onceFlag, [] {
WTF::setProcessPrivileges(allPrivileges());
@@ -1112,8 +1113,9 @@ WebProcessProxy& WebProcessPool::createNewWebProcessRespectingProcessCountLimit(

Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API::PageConfiguration>&& pageConfiguration)
{
if (!pageConfiguration->pageGroup())
if (!pageConfiguration->pageGroup())
pageConfiguration->setPageGroup(m_defaultPageGroup.ptr());
fprintf(stderr,"Hey inside webprocesspool");
if (!pageConfiguration->preferences())
pageConfiguration->setPreferences(&pageConfiguration->pageGroup()->preferences());
if (!pageConfiguration->userContentController())
@@ -248,7 +248,7 @@ class WebsiteDataStore : public RefCounted<WebsiteDataStore>, public WebProcessL
void platformDestroy();
static void platformRemoveRecentSearches(WallTime);

#if USE(CURL) || USE(SOUP)
#if USE(CURL) || USE(SOUP) || PLATFORM(HAIKU)
void platformSetNetworkParameters(WebsiteDataStoreParameters&);
#endif

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2019 Haiku, Inc.
*
* 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT HOLDERS OR
* 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 "WebsiteDataStore.h"
#include "WebsiteDataStoreParameters.h"

#include "NotImplemented.h"

namespace WebKit {

void WebsiteDataStore::platformInitialize()
{
notImplemented();
}

void WebsiteDataStore::platformDestroy()
{
notImplemented();
}

void WebsiteDataStore::platformRemoveRecentSearches(WallTime)
{
notImplemented();
}

void WebsiteDataStore::platformSetNetworkParameters(WebsiteDataStoreParameters&)
{
}
} // namespace WebKit
@@ -34,7 +34,15 @@ namespace WebKit {

void BackingStore::incorporateUpdate(ShareableBitmap* bitmap, const UpdateInfo& updateInfo)
{
fprintf(stderr,"Updater\n");
notImplemented();
}

void BackingStore::paint(BView* context,const IntRect& rect)
{
fprintf(stderr,"Im drawing");


}

}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Haiku, inc.
* Copyright (C) 2019 Haiku, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,174 +26,113 @@
#include "config.h"
#include "TextChecker.h"

#include "NotImplemented.h"
#include "TextCheckerState.h"

using namespace WebCore;
#include "NotImplemented.h"

namespace WebKit {
using namespace WebCore;

static TextCheckerState textCheckerState;
TextCheckerState& checkerState()
{
static TextCheckerState textCheckerState;
return textCheckerState;
}

const TextCheckerState& TextChecker::state()
{
static bool didInitializeState = false;
if (didInitializeState)
return textCheckerState;
return checkerState();
}

textCheckerState.isContinuousSpellCheckingEnabled = false;
textCheckerState.isGrammarCheckingEnabled = false;
static bool testingModeEnabled = false;

didInitializeState = true;
void TextChecker::setTestingMode(bool enabled)
{
testingModeEnabled = enabled;
}

return textCheckerState;
bool TextChecker::isTestingMode()
{
return testingModeEnabled;
}

bool TextChecker::isContinuousSpellCheckingAllowed()
{
notImplemented();
return false;
}

void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
void TextChecker::setContinuousSpellCheckingEnabled(bool)
{
#if ENABLE(SPELLCHECK)
if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
return;

textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;

// Notify the client about the setting change.
WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
#else
UNUSED_PARAM(isContinuousSpellCheckingEnabled);
#endif
}

void TextChecker::setGrammarCheckingEnabled(bool)
{
notImplemented();
}

void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
void TextChecker::continuousSpellCheckingEnabledStateChanged(bool)
{
#if ENABLE(SPELLCHECK)
if (state().isContinuousSpellCheckingEnabled == enabled)
return;

textCheckerState.isContinuousSpellCheckingEnabled = enabled;
#else
UNUSED_PARAM(enabled);
#endif
}

void TextChecker::grammarCheckingEnabledStateChanged(bool)
{
notImplemented();
}

int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
{
#if ENABLE(SPELLCHECK)
return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page);
#else
UNUSED_PARAM(page);
return 0;
#endif
return { };
}

void TextChecker::closeSpellDocumentWithTag(int64_t tag)
void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag)
{
#if ENABLE(SPELLCHECK)
WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
#else
UNUSED_PARAM(tag);
#endif
}

void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, StringView text, int32_t& misspellingLocation, int32_t& misspellingLength)
void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
{
#if ENABLE(SPELLCHECK)
WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, text.toStringWithoutCopying(), misspellingLocation, misspellingLength);
#else
UNUSED_PARAM(spellDocumentTag);
UNUSED_PARAM(text);
UNUSED_PARAM(misspellingLocation);
UNUSED_PARAM(misspellingLength);
#endif
}

void TextChecker::checkGrammarOfString(int64_t, StringView, Vector<GrammarDetail>&, int32_t&, int32_t&)
void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
{
notImplemented();
}

bool TextChecker::spellingUIIsShowing()
{
notImplemented();
return false;
}

void TextChecker::toggleSpellingUIIsShowing()
{
notImplemented();
}

void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&)
void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */)
{
notImplemented();
}

void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&)
void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
{
notImplemented();
}

void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& , Vector<String>& guesses)
void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool)
{
#if ENABLE(SPELLCHECK)
WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses);
#else
UNUSED_PARAM(spellDocumentTag);
UNUSED_PARAM(word);
UNUSED_PARAM(guesses);
#endif
}

void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
void TextChecker::learnWord(SpellDocumentTag, const String&)
{
#if ENABLE(SPELLCHECK)
WebTextChecker::shared()->client().learnWord(spellDocumentTag, word);
#else
UNUSED_PARAM(spellDocumentTag);
UNUSED_PARAM(word);
#endif
}

void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
void TextChecker::ignoreWord(SpellDocumentTag, const String&)
{
#if ENABLE(SPELLCHECK)
WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word);
#else
UNUSED_PARAM(spellDocumentTag);
UNUSED_PARAM(word);
#endif
}

void TextChecker::requestCheckingOfString(PassRefPtr<TextCheckerCompletion> completion)
void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t)
{
#if ENABLE(SPELLCHECK)
if (!completion)
return;
}

TextCheckingRequestData request = completion->textCheckingRequestData();
ASSERT(request.sequence() != unrequestedTextCheckingSequence);
ASSERT(request.mask() != TextCheckingTypeNone);
#if USE(UNIFIED_TEXT_CHECKING)

completion->didFinishCheckingText(checkTextOfParagraph(completion->spellDocumentTag(), request.text(), request.mask()));
#else
UNUSED_PARAM(completion);
#endif
Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag, StringView, int32_t, OptionSet<TextCheckingType>, bool)
{
return { };
}

}
#endif

} // namespace WebKit
@@ -39,16 +39,6 @@

namespace WebKit {

void WebInspectorProxy::platformOpen()
{
notImplemented();
}

void WebInspectorProxy::platformDidClose()
{
notImplemented();
}

void WebInspectorProxy::platformHide()
{
notImplemented();
@@ -70,7 +60,7 @@ void WebInspectorProxy::platformInspectedURLChanged(const String& url)
notImplemented();
}

String WebInspectorProxy::inspectorPageURL() const
String WebInspectorProxy::inspectorPageURL()
{
StringBuilder builder;
builder.append(inspectorBaseURL());
@@ -79,7 +69,7 @@ String WebInspectorProxy::inspectorPageURL() const
return builder.toString();
}

String WebInspectorProxy::inspectorTestPageURL() const
String WebInspectorProxy::inspectorTestPageURL()
{
StringBuilder builder;
builder.append(inspectorBaseURL());
@@ -88,7 +78,7 @@ String WebInspectorProxy::inspectorTestPageURL() const
return builder.toString();
}

String WebInspectorProxy::inspectorBaseURL() const
String WebInspectorProxy::inspectorBaseURL()
{
notImplemented();
return "file://" /*+ WebCore::inspectorResourcePath()*/;
@@ -126,11 +116,6 @@ void WebInspectorProxy::platformSetAttachedWindowWidth(unsigned)
notImplemented();
}

void WebInspectorProxy::platformSetToolbarHeight(unsigned)
{
notImplemented();
}

void WebInspectorProxy::platformSave(const String&, const String&, bool, bool)
{
notImplemented();
@@ -146,10 +131,40 @@ void WebInspectorProxy::platformAttachAvailabilityChanged(bool)
notImplemented();
}

WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
void WebInspectorProxy::platformStartWindowDrag()
{
notImplemented();
return nullptr;
notImplemented();
}

void WebInspectorProxy::platformCreateFrontendWindow()
{
notImplemented();
}
void WebInspectorProxy::platformCloseFrontendPageAndWindow()
{
notImplemented();
}

void WebInspectorProxy::platformShowCertificate(const WebCore::CertificateInfo&)
{
notImplemented();
}

void WebInspectorProxy::platformDidCloseForCrash()
{
notImplemented();
}
void WebInspectorProxy::platformInvalidate()
{
notImplemented();
}
void WebInspectorProxy::platformBringInspectedPageToFront()
{
notImplemented();
}
WebPageProxy* WebInspectorProxy::platformCreateFrontendPage()
{
notImplemented();
}

}
@@ -59,22 +59,26 @@ String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent
return applicationNameForUserAgent.isEmpty() ? standardUserAgentString : standardUserAgentString + ' ' + applicationNameForUserAgent;
}

#if 0
void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& /*commandsList*/)
void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems)
{
notImplemented();
}
#endif

void WebPageProxy::saveRecentSearches(const String&, const Vector<String>&)
void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems)
{
notImplemented();
}

void WebPageProxy::loadRecentSearches(const String&, Vector<String>&)
#if 0
void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& /*commandsList*/)
{
notImplemented();
}
#endif

void WebPageProxy::editorStateChanged(const EditorState& editorState)
{
m_editorState = editorState;
}

}
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2019 Haiku, Inc.
*
* 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 "WebProcessPool.h"

#include "WebProcessCreationParameters.h"
#include "NotImplemented.h"

namespace WebKit {

void WebProcessPool::platformInitialize()
{
fprintf(stderr,"YOLO");
notImplemented();
}

void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters&)
{
fprintf(stderr,"YOLO");
notImplemented();
}

void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
{
fprintf(stderr,"YOLO webprocess\n");
notImplemented();
}

void WebProcessPool::platformInvalidateContext()
{
fprintf(stderr,"YOLO");
notImplemented();
}

void WebProcessPool::platformResolvePathsForSandboxExtensions()
{
}

} // namespace WebKit

This file was deleted.