Compare commits

..

1 Commits

Author SHA1 Message Date
Pascal Abresch 8f64885c40 Haiku: Make gigacage use Overcommit by default 2021-09-08 19:25:04 +02:00
24 changed files with 404 additions and 44 deletions

View File

@ -0,0 +1,4 @@
# DRT needs to access WebCore and JSC internals, this can't work in non-shared
# mode because it ends up linking them twice (in the DRT executable and the
# merged libWebKit library).
set(SHARED_CORE 1)

View File

@ -139,7 +139,7 @@
#define USE_ACCELERATE 1
#endif
#if OS(WINDOWS) || OS(HAIKU)
#if OS(WINDOWS)
#define USE_SYSTEM_MALLOC 1
#endif

View File

@ -53,7 +53,6 @@
#if USE(HAIKU_EVENT_LOOP)
class BHandler;
class BMessageRunner;
class BLooper;
#endif
namespace WTF {
@ -251,7 +250,6 @@ private:
WeakHashSet<Observer> m_observers;
#elif USE(HAIKU_EVENT_LOOP)
BHandler* m_handler;
BLooper* m_looper;
#elif USE(GENERIC_EVENT_LOOP)
void schedule(Ref<TimerBase::ScheduledTask>&&);
void scheduleWithLock(Ref<TimerBase::ScheduledTask>&&) WTF_REQUIRES_LOCK(m_loopLock);

View File

@ -78,22 +78,22 @@ class LoopHandler: public BHandler
RunLoop::RunLoop()
: m_looper(nullptr)
{
m_handler = new LoopHandler(this);
}
RunLoop::~RunLoop()
{
stop();
delete m_handler;
}
void RunLoop::run()
{
BLooper* looper = BLooper::LooperForThread(find_thread(NULL));
bool newLooper = false;
if (!looper) {
current().m_looper = looper = new BLooper();
looper = new BLooper();
newLooper = true;
} else if (looper != be_app) {
fprintf(stderr, "Add handler to existing RunLoop looper\n");
}
@ -101,28 +101,16 @@ void RunLoop::run()
looper->AddHandler(current().m_handler);
looper->UnlockLooper();
if (current().m_looper)
current().m_looper->Loop();
if (newLooper)
looper->Loop();
}
void RunLoop::stop()
{
if (!m_handler->LockLooper())
return;
m_handler->LockLooper();
BLooper* looper = m_handler->Looper();
looper->RemoveHandler(m_handler);
looper->Unlock();
if (m_looper) {
thread_id thread = m_looper->Thread();
status_t ret;
m_looper->PostMessage(B_QUIT_REQUESTED);
m_looper = nullptr;
wait_for_thread(thread, &ret);
}
}
void RunLoop::wakeUp()

View File

@ -45,7 +45,7 @@ Color NativeImage::singlePixelSolidColor() const
if (size() != IntSize(1, 1))
return Color();
return (asSRGBA(PackedColor::ARGB { *(uint32*)m_platformImage.get()->Bits()}));
return (asSRGBA(PackedColor::ARGB { *(int32*)m_platformImage.get()->Bits()}));
}
void NativeImage::clearSubimages()

View File

@ -283,8 +283,8 @@ bool RenderThemeHaiku::paintButton(const RenderObject& object, const PaintInfo&
flags |= BControlLook::B_DEFAULT_BUTTON;
view->PushState();
be_control_look->DrawButtonFrame(view, rect, view->Bounds(), base, background, flags);
be_control_look->DrawButtonBackground(view, rect, view->Bounds(), base, flags);
be_control_look->DrawButtonFrame(view, rect, rect, base, background, flags);
be_control_look->DrawButtonBackground(view, rect, rect, base, flags);
view->PopState();
return false;
}
@ -370,8 +370,8 @@ void RenderThemeHaiku::paintMenuListButtonDecorations(const RenderBox& object, c
// we can't use flagsForObject(object) & ~BControlLook::B_CLICKED;
view->PushState();
be_control_look->DrawMenuFieldFrame(view, rect, view->Bounds(), base, base, flags);
be_control_look->DrawMenuFieldBackground(view, rect, view->Bounds(), base, true, flags);
be_control_look->DrawMenuFieldFrame(view, rect, rect, base, base, flags);
be_control_look->DrawMenuFieldBackground(view, rect, rect, base, true, flags);
view->PopState();
}

View File

@ -54,7 +54,6 @@ public:
const BCertificate& certificate() const { return *m_certificate; }
bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; }
private:
const BCertificate* m_certificate;
};

View File

@ -54,7 +54,7 @@ bool Data::isNull() const
return true;
}
bool Data::apply(const Function<bool(WTF::Span<const unsigned char>)>& applier) const
bool Data::apply(const Function<bool(const uint8_t*, size_t)>& applier) const
{
notImplemented();
return false;

View File

@ -31,9 +31,9 @@
namespace WebKit {
namespace NetworkCache {
IOChannel::IOChannel(String&& filePath, Type type, std::optional<WTF::Thread::QOS>)
: m_path(filePath)
, m_type(type)
IOChannel::IOChannel(const String& filePath, Type type)
: m_path{filePath}
, m_type{type}
{
notImplemented();
}
@ -42,12 +42,17 @@ IOChannel::~IOChannel()
{
}
void IOChannel::read(size_t offset, size_t size, WorkQueue& queue, Function<void(Data&, int error)>&& completionHandler)
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)
void IOChannel::write(size_t offset, const Data& data, WorkQueue* queue, Function<void(int error)>&& completionHandler)
{
notImplemented();
}

View File

@ -49,6 +49,31 @@ void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo&
notImplemented();
}
std::unique_ptr<WebCore::NetworkStorageSession> NetworkProcess::platformCreateDefaultStorageSession() const
{
return std::make_unique<WebCore::NetworkStorageSession>(PAL::SessionID::defaultSessionID());
}
void NetworkProcess::platformProcessDidTransitionToForeground()
{
notImplemented();
}
void NetworkProcess::platformProcessDidTransitionToBackground()
{
notImplemented();
}
void NetworkProcess::clearCacheForAllOrigins(uint32_t cachesToClear)
{
notImplemented();
}
void NetworkProcess::platformProcessDidResume()
{
notImplemented();
}
void NetworkProcess::platformTerminate()
{
notImplemented();

View File

@ -24,6 +24,7 @@
*/
#include "config.h"
#include "NetworkProcessMainUnix.h"
#include "AuxiliaryProcessMain.h"
#include "NetworkProcess.h"

View File

@ -27,12 +27,16 @@ list(APPEND WebKit_SOURCES
UIProcess/haiku/TextCheckerHaiku.cpp
UIProcess/haiku/WebInspectorProxyHaiku.cpp
UIProcess/haiku/WebPageProxyHaiku.cpp
UIProcess/haiku/WebPreferencesHaiku.cpp
UIProcess/haiku/WebProcessPoolHaiku.cpp
WebProcess/Cookies/haiku/WebCookieManagerHaiku.cpp
WebProcess/InjectedBundle/haiku/InjectedBundleHaiku.cpp
WebProcess/InjectedBundle/haiku/InjectedBundleHaiku.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

View File

@ -38,6 +38,94 @@ TextCheckerState& checkerState()
return textCheckerState;
}
const TextCheckerState& TextChecker::state()
{
return checkerState();
}
static bool testingModeEnabled = false;
void TextChecker::setTestingMode(bool enabled)
{
testingModeEnabled = enabled;
}
bool TextChecker::isTestingMode()
{
return testingModeEnabled;
}
bool TextChecker::isContinuousSpellCheckingAllowed()
{
return false;
}
void TextChecker::setContinuousSpellCheckingEnabled(bool)
{
}
void TextChecker::setGrammarCheckingEnabled(bool)
{
}
void TextChecker::continuousSpellCheckingEnabledStateChanged(bool)
{
}
void TextChecker::grammarCheckingEnabledStateChanged(bool)
{
}
SpellDocumentTag TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
{
return { };
}
void TextChecker::closeSpellDocumentWithTag(SpellDocumentTag)
{
}
void TextChecker::checkSpellingOfString(SpellDocumentTag, StringView, int32_t&, int32_t&)
{
}
void TextChecker::checkGrammarOfString(SpellDocumentTag, StringView /* text */, Vector<WebCore::GrammarDetail>& /* grammarDetails */, int32_t& /* badGrammarLocation */, int32_t& /* badGrammarLength */)
{
}
bool TextChecker::spellingUIIsShowing()
{
return false;
}
void TextChecker::toggleSpellingUIIsShowing()
{
}
void TextChecker::updateSpellingUIWithMisspelledWord(SpellDocumentTag, const String& /* misspelledWord */)
{
}
void TextChecker::updateSpellingUIWithGrammarString(SpellDocumentTag, const String& /* badGrammarPhrase */, const GrammarDetail& /* grammarDetail */)
{
}
void TextChecker::getGuessesForWord(SpellDocumentTag, const String&, const String& /* context */, int32_t /* insertionPoint */, Vector<String>&, bool)
{
}
void TextChecker::learnWord(SpellDocumentTag, const String&)
{
}
void TextChecker::ignoreWord(SpellDocumentTag, const String&)
{
}
void TextChecker::requestCheckingOfString(Ref<TextCheckerCompletion>&&, int32_t)
{
}
#if USE(UNIFIED_TEXT_CHECKING)
Vector<TextCheckingResult> TextChecker::checkTextOfParagraph(SpellDocumentTag, StringView, int32_t, OptionSet<TextCheckingType>, bool)

View File

@ -69,6 +69,13 @@ void WebPageProxy::loadRecentSearches(const String& name, CompletionHandler<void
notImplemented();
}
#if 0
void WebPageProxy::getEditorCommandsForKeyEvent(Vector<WTF::String>& /*commandsList*/)
{
notImplemented();
}
#endif
void WebPageProxy::editorStateChanged(const EditorState& editorState)
{
m_editorState = editorState;

View File

@ -0,0 +1,93 @@
/*
* Copyright (C) 2011 Samsung Electronics
*
* 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 "WebPreferences.h"
#include <WebCore/NotImplemented.h>
namespace WebKit {
void WebPreferences::platformInitializeStore()
{
notImplemented();
}
void WebPreferences::platformUpdateStringValueForKey(const String&, const String&)
{
notImplemented();
}
void WebPreferences::platformUpdateBoolValueForKey(const String&, bool)
{
notImplemented();
}
void WebPreferences::platformUpdateUInt32ValueForKey(const String&, uint32_t)
{
notImplemented();
}
void WebPreferences::platformUpdateDoubleValueForKey(const String&, double)
{
notImplemented();
}
void WebPreferences::platformUpdateFloatValueForKey(const String&, float)
{
notImplemented();
}
void WebPreferences::platformDeleteKey(const String&)
{
notImplemented();
}
bool WebPreferences::platformGetStringUserValueForKey(const String&, String&)
{
notImplemented();
return false;
}
bool WebPreferences::platformGetBoolUserValueForKey(const String&, bool&)
{
notImplemented();
return false;
}
bool WebPreferences::platformGetUInt32UserValueForKey(const String&, uint32_t&)
{
notImplemented();
return false;
}
bool WebPreferences::platformGetDoubleUserValueForKey(const String&, double&)
{
notImplemented();
return false;
}
} // namespace WebKit

View File

@ -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"
#if ENABLE(CONTEXT_MENUS)
#include "WebContextMenuClient.h"
#include <WebCore/NotImplemented.h>
using namespace WebCore;
namespace WebKit {
void WebContextMenuClient::lookUpInDictionary(Frame*)
{
notImplemented();
}
bool WebContextMenuClient::isSpeaking()
{
notImplemented();
return false;
}
void WebContextMenuClient::speak(const String&)
{
notImplemented();
}
void WebContextMenuClient::stopSpeaking()
{
notImplemented();
}
} // namespace WebKit
#endif // ENABLE(CONTEXT_MENUS)

View File

@ -0,0 +1,44 @@
/*
* 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 "WebEditorClient.h"
#include "NotImplemented.h"
namespace WebKit {
using namespace WebCore;
void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event)
{
notImplemented();
}
void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event)
{
notImplemented();
}
}

View File

@ -0,0 +1,42 @@
/*
* Copyright (C) 2011 Samsung Electronics. 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 "WebPopupMenu.h"
#include "PlatformPopupMenuData.h"
#include <WebCore/NotImplemented.h>
using namespace WebCore;
namespace WebKit {
void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData&)
{
notImplemented();
}
} // namespace WebKit

View File

@ -33,8 +33,6 @@
#include <WebCore/KeyboardEvent.h>
#include <WebCore/PlatformKeyboardEvent.h>
#include "WebKeyboardEvent.h"
using namespace WebCore;
namespace WebKit {
@ -51,6 +49,10 @@ void WebPage::platformDetach()
{
}
void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePostLayoutDataHint shouldIncludePostLayoutData) const
{
}
#if HAVE(ACCESSIBILITY)
void WebPage::updateAccessibilityTree()
{

View File

@ -24,7 +24,7 @@
*/
#include "config.h"
#include "WebProcessMain.h"
#include "WebProcessMainUnix.h"
#include "AuxiliaryProcessMain.h"
#include "WebProcess.h"

View File

@ -1414,7 +1414,6 @@ void BWebPage::handleFindString(BMessage* message)
|| message->FindBool("wrap selection", &wrapSelection) != B_OK
|| message->FindBool("start in selection", &startInSelection) != B_OK) {
message->SendReply(&reply);
return;
}
WebCore::FindOptions options;

View File

@ -101,7 +101,7 @@ void WebSettingsPrivate::apply()
settings->setNeedsSiteSpecificQuirks(true);
char path[256];
status_t result = find_path(B_CURRENT_IMAGE_SYMBOL,
status_t result = find_path((void*)&WebSettingsPrivate::apply,
B_FIND_PATH_DATA_DIRECTORY,
"/WebKit/Directory Listing Template.html", path, 256);
if (result != B_OK) {

View File

@ -18,7 +18,9 @@ add_definitions(-D_GLIBCXX_USE_C99_MATH)
set(ENABLE_WEBKIT OFF)
set(ENABLE_WEBKIT_LEGACY ON)
set(USE_ANGLE_EGL OFF)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "debug" AND NOT SHARED_CORE)
message(FATAL_ERROR "Turn on the SHARED_CORE flag to make a debug build - e.g.\n build-webkit --haiku --debug --cmakeargs=\"-DSHARED_CORE=ON\".\n")
endif ()
# To get assertions in release mode, we replace all -DNDEBUG with -UNDEBUG
# (they are automatically added by CMake and there is no "release with asserts"

View File

@ -7,7 +7,7 @@ SET(HaikuLauncher_SOURCES
SET(HaikuLauncher_LIBRARIES
JavaScriptCore
WebCore
WebKitLegacy
WebKitLegacy
${LIBXML2_LIBRARIES}
${LIBXSLT_LIBRARIES}
${SQLITE_LIBRARIES}
@ -16,10 +16,7 @@ SET(HaikuLauncher_LIBRARIES
be bsd network stdc++ translation tracker
)
INCLUDE_DIRECTORIES(
"${WEBKITLEGACY_DIR}/haiku/API"
/system/develop/headers/private/netservices/
)
INCLUDE_DIRECTORIES("${WEBKITLEGACY_DIR}/haiku/API")
ADD_EXECUTABLE(HaikuLauncher ${HaikuLauncher_SOURCES})
TARGET_LINK_LIBRARIES(HaikuLauncher ${HaikuLauncher_LIBRARIES})