Skip to content
Permalink
Browse files

Build fixes for WebKit2

- Shuffle around includes list to get things working. Note that webcore
  forwarding headers are not used yet because there are a lot of files in
  the same dir and it confuses things. A later commit fixes this.
- Fix some easy problems (FileSystem moved from WebCore to WTF, for
  example). ProcessExecutablePathHaiku is full of Linux-isms (trying to
  use /proc), so it should be replaced anyways.
- Enable some GTK/WPE stuff also for Haiku
- Skip over code needing DT_DIR and friends, as is done for Windows.
- Many updates to WebKit sourcecode to bring it in line with the current
  codebase. A lot of the existing Haiku code was from 2015 at best and
  had largely stayed untouched since.
  • Loading branch information...
pulkomandy committed Feb 9, 2019
1 parent ce02f34 commit aec19064eca9a9e30cfdac602f0a15de15ad12d9
Showing with 1,050 additions and 586 deletions.
  1. +1 −0 Source/WTF/wtf/PlatformHaiku.cmake
  2. +106 −2 Source/WebCore/PlatformHaiku.cmake
  3. +2 −2 Source/WebCore/platform/graphics/haiku/ImageBufferHaiku.cpp
  4. +0 −5 Source/WebCore/platform/haiku/LocalizedStringsHaiku.cpp
  5. +1 −1 Source/WebCore/platform/network/haiku/CookieJarHaiku.cpp
  6. +1 −1 Source/WebCore/platform/network/haiku/ProxyServerHaiku.cpp
  7. +3 −3 Source/WebCore/platform/network/haiku/SocketStreamHandleImpl.h
  8. +1 −4 Source/WebKit/CMakeLists.txt
  9. +1 −0 Source/WebKit/NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp
  10. +21 −28 Source/WebKit/{UIProcess/haiku/WebContextHaiku.cpp → NetworkProcess/cache/NetworkCacheDataHaiku.cpp}
  11. +2 −2 Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp
  12. +61 −0 Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelHaiku.cpp
  13. +93 −0 Source/WebKit/NetworkProcess/haiku/NetworkProcessHaiku.cpp
  14. +45 −0 Source/WebKit/NetworkProcess/haiku/NetworkProcessMainHaiku.cpp
  15. +48 −0 Source/WebKit/NetworkProcess/haiku/RemoteNetworkingContextHaiku.cpp
  16. +0 −44 Source/WebKit/Platform/haiku/WorkQueueHaiku.cpp
  17. +73 −73 Source/WebKit/PlatformHaiku.cmake
  18. +1 −1 Source/WebKit/Shared/ShareableBitmap.h
  19. +8 −11 ...ce/WebKit/{UIProcess/haiku/WebProcessProxyHaiku.cpp → Shared/haiku/AuxiliaryProcessMainHaiku.cpp}
  20. +7 −7 Source/WebKit/Shared/haiku/ProcessExecutablePathHaiku.cpp
  21. +17 −10 Source/WebKit/Shared/haiku/ShareableBitmapHaiku.cpp
  22. +28 −13 Source/WebKit/Shared/haiku/WebCoreArgumentCodersHaiku.cpp
  23. +47 −0 Source/WebKit/Shared/haiku/WebEventFactory.h
  24. +33 −28 Source/WebKit/Shared/haiku/WebMemorySamplerHaiku.cpp
  25. +3 −0 Source/WebKit/UIProcess/API/C/WKContextPrivate.h
  26. +3 −0 Source/WebKit/UIProcess/API/C/WKPagePrivate.h
  27. +124 −0 Source/WebKit/UIProcess/API/haiku/APIWebsiteDataStoreHaiku.cpp
  28. +1 −1 Source/WebKit/UIProcess/Launcher/ProcessLauncher.h
  29. +22 −117 Source/WebKit/UIProcess/Launcher/haiku/ProcessLauncherHaiku.cpp
  30. +1 −1 Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
  31. +52 −0 Source/WebKit/UIProcess/WebsiteData/haiku/WebsiteDataStoreHaiku.cpp
  32. +39 −100 Source/WebKit/UIProcess/haiku/TextCheckerHaiku.cpp
  33. +36 −21 Source/WebKit/UIProcess/haiku/WebInspectorProxyHaiku.cpp
  34. +9 −5 Source/WebKit/UIProcess/haiku/WebPageProxyHaiku.cpp
  35. +58 −0 Source/WebKit/UIProcess/haiku/WebProcessPoolHaiku.cpp
  36. +1 −0 Source/WebKit/WebProcess/EntryPoint/unix/WebProcessMain.cpp
  37. +5 −2 Source/WebKit/WebProcess/InjectedBundle/haiku/InjectedBundleHaiku.cpp
  38. +9 −0 Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
  39. +4 −0 Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
  40. +2 −1 Source/WebKit/WebProcess/WebCoreSupport/haiku/WebContextMenuClientHaiku.cpp
  41. +44 −0 Source/WebKit/WebProcess/WebCoreSupport/haiku/WebEditorClientHaiku.cpp
  42. +2 −8 Source/WebKit/WebProcess/WebCoreSupport/haiku/WebFrameNetworkingContext.cpp
  43. +5 −6 Source/WebKit/WebProcess/WebCoreSupport/haiku/WebFrameNetworkingContext.h
  44. +11 −3 Source/WebKit/WebProcess/WebPage/haiku/WebInspectorHaiku.cpp
  45. +9 −39 Source/WebKit/WebProcess/WebPage/haiku/WebPageHaiku.cpp
  46. +2 −29 Source/WebKit/WebProcess/haiku/WebProcessHaiku.cpp
  47. +7 −18 Source/WebKit/WebProcess/haiku/WebProcessMainHaiku.cpp
  48. +1 −0 Source/cmake/OptionsHaiku.cmake
@@ -11,6 +11,7 @@ LIST(APPEND WTF_SOURCES
posix/ThreadingPOSIX.cpp

unicode/icu/CollatorICU.cpp
UniStdExtras.cpp

unix/CPUTimeUnix.cpp

@@ -348,16 +348,120 @@ endif ()
# FIXME: We do not need everything from all of these directories.
# Move some to WebCore_FORWARDING_HEADERS_FILES once people start actually maintaining this.
set(WebCore_FORWARDING_HEADERS_DIRECTORIES
.
accessibility
animation
bindings
bridge
contentextensions
crypto
css
dom
editing
fileapi
history
html
inspector
loader
page
platform
plugins
rendering
replay
storage
style
svg
websockets
workers
xml

dom/messageports/

Modules/applicationmanifest
Modules/cache
Modules/fetch
Modules/geolocation
Modules/mediastream
Modules/websockets

Modules/indexeddb

Modules/indexeddb/client
Modules/indexeddb/shared
Modules/indexeddb/server
Modules/notifications
Modules/webdatabase

bindings/js

bridge/c
bridge/jsc

css/parser

inspector/agents

html/canvas
html/forms
html/parser
html/shadow
html/track

loader/appcache
loader/archive
loader/cache
loader/icon
loader/archive/mhtml


page/animation
page/csp
page/scrolling
page/haiku

platform/animation
platform/audio
platform/graphics
platform/mediacapabilities
platform/mock
platform/network
platform/sql
platform/text
platform/haiku
platform/mediastream
platform/network/haiku

platform/graphics/filters
platform/graphics/opengl
platform/graphics/opentype
platform/graphics/texmap
platform/graphics/transforms
platform/graphics/haiku

platform/mediastream/libwebrtc

platform/text/transcoder

PAL/pal

rendering/line
rendering/shapes
rendering/style
rendering/svg

svg/animation
svg/graphics
svg/properties

svg/graphics/filters

workers/service
workers/service/context
)

set(WebCore_FORWARDING_HEADERS_FILES
platform/PlatformExportMacros.h
platform/PlatformExportMacros.h
fileapi/Blob.h
)

WEBKIT_CREATE_FORWARDING_HEADERS(WebCore DIRECTORIES ${WebCore_FORWARDING_HEADERS_DIRECTORIES} FILES ${WebCore_FORWARDING_HEADERS_FILES})

@@ -32,8 +32,8 @@
#include "MIMETypeRegistry.h"
#include "NotImplemented.h"
#include "StillImageHaiku.h"
#include "JavaScriptCore/GenericTypedArrayViewInlines.h"
#include "JavaScriptCore/JSGenericTypedArrayView.h"
#include "JavaScriptCore/JSCInlines.h"
#include "JavaScriptCore/TypedArrayInlines.h"

#include <wtf/text/Base64.h>
#include <wtf/text/CString.h>
@@ -36,9 +36,4 @@ String contextMenuItemTagSearchWeb()
return String::fromUTF8("_Search the Web");
}

String localizedString(const char* key)
{
return String::fromUTF8(key, strlen(key));
}

};
@@ -56,7 +56,7 @@ void startObservingCookieChanges(const NetworkStorageSession& storageSession, WT
notImplemented();
}

void stopObservingCookieChanges()
void stopObservingCookieChanges(const NetworkStorageSession& storageSession)
{
}

@@ -30,7 +30,7 @@

namespace WebCore {

Vector<ProxyServer> proxyServersForURL(const URL&, const NetworkingContext*)
Vector<ProxyServer> proxyServersForURL(const URL&)
{
// FIXME: Implement.
return Vector<ProxyServer>();
@@ -58,11 +58,11 @@ namespace WebCore {
{ return adoptRef(*new SocketStreamHandleImpl(url, client, provider)); }
virtual ~SocketStreamHandleImpl();

WEBCORE_EXPORT void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) final;
WEBCORE_EXPORT void platformSendHandshake(const uint8_t* data, size_t length, const WTF::Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final;
WEBCORE_EXPORT void platformClose() final;
protected:
void platformSend(const uint8_t* data, size_t length, Function<void(bool)>&&) final;
WTF::Optional<size_t> platformSendInternal(const uint8_t* data, size_t length);
void platformClose() final;
void platformSendHandshake(const uint8_t* data, size_t length, const WTF::Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final;
size_t bufferedAmount() final;
bool sendPendingData();

@@ -92,11 +92,8 @@ set(WebKit_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/WebKitLibraries"
)

set(WebKit2_LOCAL_INCLUDE_DIRECTORIES
SET(WebKit_LOCAL_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/css"
"${WEBCORE_DIR}/platform"
"${WEBCORE_DIR}/platform/graphics"
"${WEBCORE_DIR}/platform/graphics/transforms"
)

set(PROTOCOL_GENERATOR_SCRIPTS_DIR "${JAVASCRIPTCORE_DIR}/inspector/scripts")
@@ -24,6 +24,7 @@
*/

#include "NetworkProcessMainUnix.h"
#include "wtf/Platform.h"

#include <cstdlib>

@@ -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
@@ -10,7 +10,7 @@
* 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''
* 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
@@ -24,65 +24,58 @@
*/

#include "config.h"
#include "WebCookieManagerProxy.h"
#include "WebContext.h"
#include "NetworkCacheData.h"

#include "NotImplemented.h"
#include <WebCore/IconDatabase.h>

namespace WebKit {
namespace NetworkCache {

void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
Data::Data(const uint8_t* data, size_t size)
{
notImplemented();
}

void WebContext::platformInvalidateContext()
Data Data::empty()
{
notImplemented();
return { };
}

String WebContext::platformDefaultWebSQLDatabaseDirectory()
const uint8_t* Data::data() const
{
notImplemented();
return "/WebKitEfl/Databases";
return nullptr;
}

String WebContext::platformDefaultIndexedDBDatabaseDirectory()
bool Data::isNull() const
{
notImplemented();
return String();
return true;
}

String WebContext::platformDefaultIconDatabasePath() const
bool Data::apply(const Function<bool(const uint8_t*, size_t)>& applier) const
{
notImplemented();
return "/WebKitEfl/IconDatabase/" + WebCore::IconDatabase::defaultDatabaseFilename();
return false;
}

String WebContext::platformDefaultLocalStorageDirectory()
Data Data::subrange(size_t offset, size_t size) const
{
notImplemented();
return "/WebKitEfl/LocalStorage";
return { };
}

String WebContext::platformDefaultDiskCacheDirectory() const
Data concatenate(const Data& a, const Data& b)
{
notImplemented();
return "/WebKitEfl";
return { };
}

String WebContext::platformDefaultCookieStorageDirectory() const
Data Data::adoptMap(void* map, size_t size, int fd)
{
notImplemented();
return String();
return { };
}


String WebContext::platformDefaultApplicationCacheDirectory() const
{
notImplemented();
return "/WebKitEfl/Applications";
}

}
} // namespace NetworkCache
} // namespace WebKit
@@ -51,7 +51,7 @@
namespace WebKit {
namespace NetworkCache {

#if !OS(WINDOWS)
#if !OS(WINDOWS) && !OS(HAIKU)
static DirectoryEntryType directoryEntryType(uint8_t dtype)
{
switch (dtype) {
@@ -69,7 +69,7 @@ static DirectoryEntryType directoryEntryType(uint8_t dtype)

void traverseDirectory(const String& path, const Function<void (const String&, DirectoryEntryType)>& function)
{
#if !OS(WINDOWS)
#if !OS(WINDOWS) && !OS(HAIKU)
DIR* dir = opendir(FileSystem::fileSystemRepresentation(path).data());
if (!dir)
return;
@@ -0,0 +1,61 @@
/*
* 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 "NetworkCacheIOChannel.h"

#include "NotImplemented.h"

namespace WebKit {
namespace NetworkCache {

IOChannel::IOChannel(const String& filePath, Type type)
: m_path{filePath}
, m_type{type}
{
notImplemented();
}

IOChannel::~IOChannel()
{
}

Ref<IOChannel> IOChannel::open(const String& filePath, IOChannel::Type type)
{
return adoptRef(*new IOChannel(filePath, type));
}

void IOChannel::read(size_t offset, size_t size, WorkQueue* queue, Function<void(Data&, int error)>&& completionHandler)
{
notImplemented();
}

void IOChannel::write(size_t offset, const Data& data, WorkQueue* queue, Function<void(int error)>&& completionHandler)
{
notImplemented();
}

} // namespace NetworkCache
} // namespace WebKit

0 comments on commit aec1906

Please sign in to comment.
You can’t perform that action at this time.