LibWebView: Enable EXPLICIT_SYMBOL_EXPORT

This commit is contained in:
ayeteadoe 2025-07-01 20:55:11 -07:00 committed by Andrew Kaster
commit 9c67c4a270
Notes: github-actions[bot] 2025-08-23 22:06:32 +00:00
36 changed files with 104 additions and 94 deletions

View file

@ -18,6 +18,7 @@
#include <LibMain/Main.h> #include <LibMain/Main.h>
#include <LibRequests/RequestClient.h> #include <LibRequests/RequestClient.h>
#include <LibURL/URL.h> #include <LibURL/URL.h>
#include <LibWebView/Forward.h>
#include <LibWebView/Options.h> #include <LibWebView/Options.h>
#include <LibWebView/Process.h> #include <LibWebView/Process.h>
#include <LibWebView/ProcessManager.h> #include <LibWebView/ProcessManager.h>
@ -28,7 +29,7 @@ namespace WebView {
struct ApplicationSettingsObserver; struct ApplicationSettingsObserver;
class Application : public DevTools::DevToolsDelegate { class WEBVIEW_API Application : public DevTools::DevToolsDelegate {
AK_MAKE_NONCOPYABLE(Application); AK_MAKE_NONCOPYABLE(Application);
public: public:

View file

@ -8,10 +8,11 @@
#include <AK/String.h> #include <AK/String.h>
#include <LibIPC/Forward.h> #include <LibIPC/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
struct Attribute { struct WEBVIEW_API Attribute {
String name; String name;
String value; String value;
}; };
@ -21,9 +22,9 @@ struct Attribute {
namespace IPC { namespace IPC {
template<> template<>
ErrorOr<void> encode(Encoder&, WebView::Attribute const&); WEBVIEW_API ErrorOr<void> encode(Encoder&, WebView::Attribute const&);
template<> template<>
ErrorOr<WebView::Attribute> decode(Decoder&); WEBVIEW_API ErrorOr<WebView::Attribute> decode(Decoder&);
} }

View file

@ -13,6 +13,7 @@
#include <AK/String.h> #include <AK/String.h>
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibRequests/Forward.h> #include <LibRequests/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
@ -21,10 +22,10 @@ struct AutocompleteEngine {
StringView query_url; StringView query_url;
}; };
ReadonlySpan<AutocompleteEngine> autocomplete_engines(); WEBVIEW_API ReadonlySpan<AutocompleteEngine> autocomplete_engines();
Optional<AutocompleteEngine const&> find_autocomplete_engine_by_name(StringView name); WEBVIEW_API Optional<AutocompleteEngine const&> find_autocomplete_engine_by_name(StringView name);
class Autocomplete { class WEBVIEW_API Autocomplete {
public: public:
Autocomplete(); Autocomplete();
~Autocomplete(); ~Autocomplete();

View file

@ -13,13 +13,14 @@
#include <LibIPC/ConnectionFromClient.h> #include <LibIPC/ConnectionFromClient.h>
#include <LibIPC/Forward.h> #include <LibIPC/Forward.h>
#include <LibIPC/MultiServer.h> #include <LibIPC/MultiServer.h>
#include <LibWebView/Forward.h>
#include <LibWebView/Options.h> #include <LibWebView/Options.h>
#include <LibWebView/UIProcessClientEndpoint.h> #include <LibWebView/UIProcessClientEndpoint.h>
#include <LibWebView/UIProcessServerEndpoint.h> #include <LibWebView/UIProcessServerEndpoint.h>
namespace WebView { namespace WebView {
class UIProcessConnectionFromClient final class WEBVIEW_API UIProcessConnectionFromClient final
: public IPC::ConnectionFromClient<UIProcessClientEndpoint, UIProcessServerEndpoint> { : public IPC::ConnectionFromClient<UIProcessClientEndpoint, UIProcessServerEndpoint> {
C_OBJECT(UIProcessConnectionFromClient); C_OBJECT(UIProcessConnectionFromClient);
@ -38,7 +39,7 @@ private:
virtual void create_new_window(Vector<ByteString> urls) override; virtual void create_new_window(Vector<ByteString> urls) override;
}; };
class BrowserProcess { class WEBVIEW_API BrowserProcess {
AK_MAKE_NONCOPYABLE(BrowserProcess); AK_MAKE_NONCOPYABLE(BrowserProcess);
AK_MAKE_DEFAULT_MOVABLE(BrowserProcess); AK_MAKE_DEFAULT_MOVABLE(BrowserProcess);

View file

@ -68,7 +68,7 @@ set(GENERATED_SOURCES
UIProcessServerEndpoint.h UIProcessServerEndpoint.h
) )
ladybird_lib(LibWebView webview) ladybird_lib(LibWebView webview EXPLICIT_SYMBOL_EXPORT)
target_link_libraries(LibWebView PRIVATE LibCore LibDevTools LibFileSystem LibGfx LibImageDecoderClient LibIPC LibRequests LibJS LibWeb LibUnicode LibURL LibSyntax LibTextCodec) target_link_libraries(LibWebView PRIVATE LibCore LibDevTools LibFileSystem LibGfx LibImageDecoderClient LibIPC LibRequests LibJS LibWeb LibUnicode LibURL LibSyntax LibTextCodec)
if (APPLE) if (APPLE)

View file

@ -13,29 +13,30 @@
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibIPC/Forward.h> #include <LibIPC/Forward.h>
#include <LibJS/Console.h> #include <LibJS/Console.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
struct ConsoleLog { struct WEBVIEW_API ConsoleLog {
JS::Console::LogLevel level; JS::Console::LogLevel level;
Vector<JsonValue> arguments; Vector<JsonValue> arguments;
}; };
struct StackFrame { struct WEBVIEW_API StackFrame {
Optional<String> function; Optional<String> function;
Optional<String> file; Optional<String> file;
Optional<size_t> line; Optional<size_t> line;
Optional<size_t> column; Optional<size_t> column;
}; };
struct ConsoleError { struct WEBVIEW_API ConsoleError {
String name; String name;
String message; String message;
Vector<StackFrame> trace; Vector<StackFrame> trace;
bool inside_promise { false }; bool inside_promise { false };
}; };
struct ConsoleOutput { struct WEBVIEW_API ConsoleOutput {
UnixDateTime timestamp; UnixDateTime timestamp;
Variant<ConsoleLog, ConsoleError> output; Variant<ConsoleLog, ConsoleError> output;
}; };
@ -63,9 +64,9 @@ template<>
ErrorOr<WebView::ConsoleError> decode(Decoder&); ErrorOr<WebView::ConsoleError> decode(Decoder&);
template<> template<>
ErrorOr<void> encode(Encoder&, WebView::ConsoleOutput const&); WEBVIEW_API ErrorOr<void> encode(Encoder&, WebView::ConsoleOutput const&);
template<> template<>
ErrorOr<WebView::ConsoleOutput> decode(Decoder&); WEBVIEW_API ErrorOr<WebView::ConsoleOutput> decode(Decoder&);
} }

View file

@ -29,14 +29,14 @@ struct CookieStorageKey {
String path; String path;
}; };
class CookieJar { class WEBVIEW_API CookieJar {
struct Statements { struct Statements {
Database::StatementID insert_cookie { 0 }; Database::StatementID insert_cookie { 0 };
Database::StatementID expire_cookie { 0 }; Database::StatementID expire_cookie { 0 };
Database::StatementID select_all_cookies { 0 }; Database::StatementID select_all_cookies { 0 };
}; };
class TransientStorage { class WEBVIEW_API TransientStorage {
public: public:
using Cookies = HashMap<CookieStorageKey, Web::Cookie::Cookie>; using Cookies = HashMap<CookieStorageKey, Web::Cookie::Cookie>;
@ -72,7 +72,7 @@ class CookieJar {
Cookies m_dirty_cookies; Cookies m_dirty_cookies;
}; };
struct PersistedStorage { struct WEBVIEW_API PersistedStorage {
void insert_cookie(Web::Cookie::Cookie const& cookie); void insert_cookie(Web::Cookie::Cookie const& cookie);
TransientStorage::Cookies select_all_cookies(); TransientStorage::Cookies select_all_cookies();

View file

@ -8,10 +8,11 @@
#include <AK/JsonValue.h> #include <AK/JsonValue.h>
#include <LibIPC/Forward.h> #include <LibIPC/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
struct DOMNodeProperties { struct WEBVIEW_API DOMNodeProperties {
enum class Type { enum class Type {
ComputedStyle, ComputedStyle,
Layout, Layout,
@ -27,9 +28,9 @@ struct DOMNodeProperties {
namespace IPC { namespace IPC {
template<> template<>
ErrorOr<void> encode(Encoder&, WebView::DOMNodeProperties const&); WEBVIEW_API ErrorOr<void> encode(Encoder&, WebView::DOMNodeProperties const&);
template<> template<>
ErrorOr<WebView::DOMNodeProperties> decode(Decoder&); WEBVIEW_API ErrorOr<WebView::DOMNodeProperties> decode(Decoder&);
} }

View file

@ -13,13 +13,14 @@
#include <AK/RefCounted.h> #include <AK/RefCounted.h>
#include <AK/StringView.h> #include <AK/StringView.h>
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibWebView/Forward.h>
struct sqlite3; struct sqlite3;
struct sqlite3_stmt; struct sqlite3_stmt;
namespace WebView { namespace WebView {
class Database : public RefCounted<Database> { class WEBVIEW_API Database : public RefCounted<Database> {
public: public:
static ErrorOr<NonnullRefPtr<Database>> create(); static ErrorOr<NonnullRefPtr<Database>> create();
~Database(); ~Database();

View file

@ -9,10 +9,11 @@
#include <AK/Function.h> #include <AK/Function.h>
#include <AK/NonnullOwnPtr.h> #include <AK/NonnullOwnPtr.h>
#include <LibCore/EventLoopImplementation.h> #include <LibCore/EventLoopImplementation.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
class EventLoopManagerMacOS final : public Core::EventLoopManager { class WEBVIEW_API EventLoopManagerMacOS final : public Core::EventLoopManager {
public: public:
virtual NonnullOwnPtr<Core::EventLoopImplementation> make_implementation() override; virtual NonnullOwnPtr<Core::EventLoopImplementation> make_implementation() override;
@ -28,7 +29,7 @@ public:
virtual void unregister_signal(int) override; virtual void unregister_signal(int) override;
}; };
class EventLoopImplementationMacOS final : public Core::EventLoopImplementation { class WEBVIEW_API EventLoopImplementationMacOS final : public Core::EventLoopImplementation {
public: public:
// FIXME: This currently only manages the main NSApp event loop, as that is all we currently // FIXME: This currently only manages the main NSApp event loop, as that is all we currently
// interact with. When we need multiple event loops, or an event loop that isn't the // interact with. When we need multiple event loops, or an event loop that isn't the

View file

@ -8,6 +8,7 @@
#include <AK/Platform.h> #include <AK/Platform.h>
#include <AK/Traits.h> #include <AK/Traits.h>
#include <LibWebView/Export.h>
namespace WebView { namespace WebView {

View file

@ -10,11 +10,12 @@
#include <LibGfx/Forward.h> #include <LibGfx/Forward.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/PixelUnits.h> #include <LibWeb/PixelUnits.h>
#include <LibWebView/Forward.h>
#include <LibWebView/ViewImplementation.h> #include <LibWebView/ViewImplementation.h>
namespace WebView { namespace WebView {
class HeadlessWebView : public WebView::ViewImplementation { class WEBVIEW_API HeadlessWebView : public WebView::ViewImplementation {
public: public:
static NonnullOwnPtr<HeadlessWebView> create(Core::AnonymousBuffer theme, Web::DevicePixelSize window_size); static NonnullOwnPtr<HeadlessWebView> create(Core::AnonymousBuffer theme, Web::DevicePixelSize window_size);
static NonnullOwnPtr<HeadlessWebView> create_child(HeadlessWebView&, u64 page_index); static NonnullOwnPtr<HeadlessWebView> create_child(HeadlessWebView&, u64 page_index);

View file

@ -12,25 +12,26 @@
#include <LibRequests/RequestClient.h> #include <LibRequests/RequestClient.h>
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Worker/WebWorkerClient.h> #include <LibWeb/Worker/WebWorkerClient.h>
#include <LibWebView/Forward.h>
#include <LibWebView/ViewImplementation.h> #include <LibWebView/ViewImplementation.h>
#include <LibWebView/WebContentClient.h> #include <LibWebView/WebContentClient.h>
namespace WebView { namespace WebView {
ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_web_content_process( WEBVIEW_API ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_web_content_process(
WebView::ViewImplementation& view, WebView::ViewImplementation& view,
IPC::File image_decoder_socket, IPC::File image_decoder_socket,
Optional<IPC::File> request_server_socket = {}); Optional<IPC::File> request_server_socket = {});
ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_spare_web_content_process( WEBVIEW_API ErrorOr<NonnullRefPtr<WebView::WebContentClient>> launch_spare_web_content_process(
IPC::File image_decoder_socket, IPC::File image_decoder_socket,
Optional<IPC::File> request_server_socket = {}); Optional<IPC::File> request_server_socket = {});
ErrorOr<NonnullRefPtr<ImageDecoderClient::Client>> launch_image_decoder_process(); WEBVIEW_API ErrorOr<NonnullRefPtr<ImageDecoderClient::Client>> launch_image_decoder_process();
ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process(Web::Bindings::AgentType); WEBVIEW_API ErrorOr<NonnullRefPtr<Web::HTML::WebWorkerClient>> launch_web_worker_process(Web::Bindings::AgentType);
ErrorOr<NonnullRefPtr<Requests::RequestClient>> launch_request_server_process(); WEBVIEW_API ErrorOr<NonnullRefPtr<Requests::RequestClient>> launch_request_server_process();
ErrorOr<IPC::File> connect_new_request_server_client(); WEBVIEW_API ErrorOr<IPC::File> connect_new_request_server_client();
ErrorOr<IPC::File> connect_new_image_decoder_client(); WEBVIEW_API ErrorOr<IPC::File> connect_new_image_decoder_client();
} }

View file

@ -11,6 +11,7 @@
#include <AK/String.h> #include <AK/String.h>
#include <LibCore/MachPort.h> #include <LibCore/MachPort.h>
#include <LibThreading/Thread.h> #include <LibThreading/Thread.h>
#include <LibWebView/Forward.h>
#if !defined(AK_OS_MACH) #if !defined(AK_OS_MACH)
# error "This file is only for Mach kernel-based OS's" # error "This file is only for Mach kernel-based OS's"
@ -18,7 +19,7 @@
namespace WebView { namespace WebView {
class MachPortServer { class WEBVIEW_API MachPortServer {
public: public:
MachPortServer(); MachPortServer();

View file

@ -11,25 +11,26 @@
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibIPC/Forward.h> #include <LibIPC/Forward.h>
#include <LibWeb/Forward.h> #include <LibWeb/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
struct AttributeMutation { struct WEBVIEW_API AttributeMutation {
String attribute_name; String attribute_name;
Optional<String> new_value; Optional<String> new_value;
}; };
struct CharacterDataMutation { struct WEBVIEW_API CharacterDataMutation {
String new_value; String new_value;
}; };
struct ChildListMutation { struct WEBVIEW_API ChildListMutation {
Vector<Web::UniqueNodeID> added; Vector<Web::UniqueNodeID> added;
Vector<Web::UniqueNodeID> removed; Vector<Web::UniqueNodeID> removed;
size_t target_child_count { 0 }; size_t target_child_count { 0 };
}; };
struct Mutation { struct WEBVIEW_API Mutation {
using Type = Variant<AttributeMutation, CharacterDataMutation, ChildListMutation>; using Type = Variant<AttributeMutation, CharacterDataMutation, ChildListMutation>;
String type; String type;
@ -61,9 +62,9 @@ template<>
ErrorOr<WebView::ChildListMutation> decode(Decoder&); ErrorOr<WebView::ChildListMutation> decode(Decoder&);
template<> template<>
ErrorOr<void> encode(Encoder&, WebView::Mutation const&); WEBVIEW_API ErrorOr<void> encode(Encoder&, WebView::Mutation const&);
template<> template<>
ErrorOr<WebView::Mutation> decode(Decoder&); WEBVIEW_API ErrorOr<WebView::Mutation> decode(Decoder&);
} }

View file

@ -10,10 +10,11 @@
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibGfx/Font/FontDatabase.h> #include <LibGfx/Font/FontDatabase.h>
#include <LibWeb/Platform/FontPlugin.h> #include <LibWeb/Platform/FontPlugin.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
class FontPlugin final : public Web::Platform::FontPlugin { class WEBVIEW_API FontPlugin final : public Web::Platform::FontPlugin {
public: public:
FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* = nullptr); FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* = nullptr);
virtual ~FontPlugin(); virtual ~FontPlugin();

View file

@ -9,10 +9,11 @@
#include <LibImageDecoderClient/Client.h> #include <LibImageDecoderClient/Client.h>
#include <LibWeb/Platform/ImageCodecPlugin.h> #include <LibWeb/Platform/ImageCodecPlugin.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
class ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin { class WEBVIEW_API ImageCodecPlugin final : public Web::Platform::ImageCodecPlugin {
public: public:
explicit ImageCodecPlugin(NonnullRefPtr<ImageDecoderClient::Client>); explicit ImageCodecPlugin(NonnullRefPtr<ImageDecoderClient::Client>);
virtual ~ImageCodecPlugin() override; virtual ~ImageCodecPlugin() override;

View file

@ -11,11 +11,12 @@
#include <LibCore/Process.h> #include <LibCore/Process.h>
#include <LibIPC/Connection.h> #include <LibIPC/Connection.h>
#include <LibIPC/Transport.h> #include <LibIPC/Transport.h>
#include <LibWebView/Forward.h>
#include <LibWebView/ProcessType.h> #include <LibWebView/ProcessType.h>
namespace WebView { namespace WebView {
class Process { class WEBVIEW_API Process {
AK_MAKE_NONCOPYABLE(Process); AK_MAKE_NONCOPYABLE(Process);
AK_MAKE_DEFAULT_MOVABLE(Process); AK_MAKE_DEFAULT_MOVABLE(Process);

View file

@ -16,10 +16,10 @@
namespace WebView { namespace WebView {
ProcessType process_type_from_name(StringView); WEBVIEW_API ProcessType process_type_from_name(StringView);
StringView process_name_from_type(ProcessType type); WEBVIEW_API StringView process_name_from_type(ProcessType type);
class ProcessManager { class WEBVIEW_API ProcessManager {
AK_MAKE_NONCOPYABLE(ProcessManager); AK_MAKE_NONCOPYABLE(ProcessManager);
public: public:

View file

@ -9,17 +9,18 @@
#include <AK/Span.h> #include <AK/Span.h>
#include <AK/String.h> #include <AK/String.h>
#include <AK/StringView.h> #include <AK/StringView.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
struct SearchEngine { struct SearchEngine {
String format_search_query_for_display(StringView query) const; WEBVIEW_API String format_search_query_for_display(StringView query) const;
String format_search_query_for_navigation(StringView query) const; WEBVIEW_API String format_search_query_for_navigation(StringView query) const;
String name; String name;
String query_url; String query_url;
}; };
ReadonlySpan<SearchEngine> builtin_search_engines(); WEBVIEW_API ReadonlySpan<SearchEngine> builtin_search_engines();
} }

View file

@ -18,7 +18,7 @@
namespace WebView { namespace WebView {
struct SiteSetting { struct WEBVIEW_API SiteSetting {
SiteSetting(); SiteSetting();
bool enabled_globally { false }; bool enabled_globally { false };
@ -30,7 +30,7 @@ enum class DoNotTrack {
Yes, Yes,
}; };
class SettingsObserver { class WEBVIEW_API SettingsObserver {
public: public:
explicit SettingsObserver(); explicit SettingsObserver();
virtual ~SettingsObserver(); virtual ~SettingsObserver();
@ -44,7 +44,7 @@ public:
virtual void dns_settings_changed() { } virtual void dns_settings_changed() { }
}; };
class Settings { class WEBVIEW_API Settings {
public: public:
static Settings create(Badge<Application>); static Settings create(Badge<Application>);

View file

@ -7,10 +7,11 @@
#pragma once #pragma once
#include <LibURL/Forward.h> #include <LibURL/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
void disable_site_isolation(); WEBVIEW_API void disable_site_isolation();
[[nodiscard]] bool is_url_suitable_for_same_process_navigation(URL::URL const& current_url, URL::URL const& target_url); [[nodiscard]] WEBVIEW_API bool is_url_suitable_for_same_process_navigation(URL::URL const& current_url, URL::URL const& target_url);
} }

View file

@ -14,6 +14,7 @@
#include <LibSyntax/HighlighterClient.h> #include <LibSyntax/HighlighterClient.h>
#include <LibSyntax/Language.h> #include <LibSyntax/Language.h>
#include <LibURL/Forward.h> #include <LibURL/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
@ -22,7 +23,7 @@ enum class HighlightOutputMode {
SourceOnly, // Just the highlighted source SourceOnly, // Just the highlighted source
}; };
class SourceDocument final : public Syntax::Document { class WEBVIEW_API SourceDocument final : public Syntax::Document {
public: public:
static NonnullRefPtr<SourceDocument> create(String const& source) static NonnullRefPtr<SourceDocument> create(String const& source)
{ {
@ -47,7 +48,7 @@ private:
Vector<Syntax::TextDocumentLine> m_lines; Vector<Syntax::TextDocumentLine> m_lines;
}; };
class SourceHighlighterClient final : public Syntax::HighlighterClient { class WEBVIEW_API SourceHighlighterClient final : public Syntax::HighlighterClient {
public: public:
SourceHighlighterClient(String const& source, Syntax::Language); SourceHighlighterClient(String const& source, Syntax::Language);
virtual ~SourceHighlighterClient() = default; virtual ~SourceHighlighterClient() = default;
@ -75,7 +76,7 @@ private:
OwnPtr<Syntax::Highlighter> m_highlighter; OwnPtr<Syntax::Highlighter> m_highlighter;
}; };
String highlight_source(Optional<URL::URL> const&, URL::URL const& base_url, String const& source, Syntax::Language, HighlightOutputMode); WEBVIEW_API String highlight_source(Optional<URL::URL> const&, URL::URL const& base_url, String const& source, Syntax::Language, HighlightOutputMode);
constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~( constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {

View file

@ -26,7 +26,7 @@ struct StorageLocation {
String bottle_key; String bottle_key;
}; };
class StorageJar { class WEBVIEW_API StorageJar {
AK_MAKE_NONCOPYABLE(StorageJar); AK_MAKE_NONCOPYABLE(StorageJar);
AK_MAKE_NONMOVABLE(StorageJar); AK_MAKE_NONMOVABLE(StorageJar);

View file

@ -9,6 +9,7 @@
#include <AK/Optional.h> #include <AK/Optional.h>
#include <AK/StringView.h> #include <AK/StringView.h>
#include <LibURL/URL.h> #include <LibURL/URL.h>
#include <LibWebView/Forward.h>
#include <LibWebView/SearchEngine.h> #include <LibWebView/SearchEngine.h>
namespace WebView { namespace WebView {
@ -17,15 +18,15 @@ enum class AppendTLD {
No, No,
Yes, Yes,
}; };
Optional<URL::URL> sanitize_url(StringView, Optional<SearchEngine> const& search_engine = {}, AppendTLD = AppendTLD::No); WEBVIEW_API Optional<URL::URL> sanitize_url(StringView, Optional<SearchEngine> const& search_engine = {}, AppendTLD = AppendTLD::No);
Vector<URL::URL> sanitize_urls(ReadonlySpan<ByteString> raw_urls, URL::URL const& new_tab_page_url); WEBVIEW_API Vector<URL::URL> sanitize_urls(ReadonlySpan<ByteString> raw_urls, URL::URL const& new_tab_page_url);
struct URLParts { struct URLParts {
StringView scheme_and_subdomain; StringView scheme_and_subdomain;
StringView effective_tld_plus_one; StringView effective_tld_plus_one;
StringView remainder; StringView remainder;
}; };
Optional<URLParts> break_url_into_parts(StringView url); WEBVIEW_API Optional<URLParts> break_url_into_parts(StringView url);
// These are both used for the "right-click -> copy FOO" interaction for links. // These are both used for the "right-click -> copy FOO" interaction for links.
enum class URLType { enum class URLType {
@ -33,7 +34,7 @@ enum class URLType {
Telephone, Telephone,
Other, Other,
}; };
URLType url_type(URL::URL const&); WEBVIEW_API URLType url_type(URL::URL const&);
String url_text_to_copy(URL::URL const&); WEBVIEW_API String url_text_to_copy(URL::URL const&);
} }

View file

@ -9,11 +9,12 @@
#include <AK/HashMap.h> #include <AK/HashMap.h>
#include <AK/Optional.h> #include <AK/Optional.h>
#include <AK/StringView.h> #include <AK/StringView.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
extern OrderedHashMap<StringView, StringView> const user_agents; WEBVIEW_API extern OrderedHashMap<StringView, StringView> const user_agents;
Optional<StringView> normalize_user_agent_name(StringView); WEBVIEW_API Optional<StringView> normalize_user_agent_name(StringView);
} }

View file

@ -11,17 +11,18 @@
#include <AK/Error.h> #include <AK/Error.h>
#include <AK/String.h> #include <AK/String.h>
#include <AK/Vector.h> #include <AK/Vector.h>
#include <LibWebView/Forward.h>
namespace WebView { namespace WebView {
void platform_init(Optional<ByteString> ladybird_binary_path = {}); WEBVIEW_API void platform_init(Optional<ByteString> ladybird_binary_path = {});
void copy_default_config_files(StringView config_path); WEBVIEW_API void copy_default_config_files(StringView config_path);
ErrorOr<Vector<ByteString>> get_paths_for_helper_process(StringView process_name); WEBVIEW_API ErrorOr<Vector<ByteString>> get_paths_for_helper_process(StringView process_name);
extern ByteString s_ladybird_resource_root; WEBVIEW_API extern ByteString s_ladybird_resource_root;
Optional<ByteString const&> mach_server_name(); WEBVIEW_API Optional<ByteString const&> mach_server_name();
void set_mach_server_name(ByteString name); WEBVIEW_API void set_mach_server_name(ByteString name);
ErrorOr<void> handle_attached_debugger(); WEBVIEW_API ErrorOr<void> handle_attached_debugger();
} }

View file

@ -34,7 +34,7 @@
namespace WebView { namespace WebView {
class ViewImplementation : public SettingsObserver { class WEBVIEW_API ViewImplementation : public SettingsObserver {
public: public:
virtual ~ViewImplementation(); virtual ~ViewImplementation();

View file

@ -26,7 +26,7 @@ namespace WebView {
class ViewImplementation; class ViewImplementation;
class WebContentClient final class WEBVIEW_API WebContentClient final
: public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint> : public IPC::ConnectionToServer<WebContentClientEndpoint, WebContentServerEndpoint>
, public WebContentClientEndpoint { , public WebContentClientEndpoint {
C_OBJECT_ABSTRACT(WebContentClient); C_OBJECT_ABSTRACT(WebContentClient);

View file

@ -20,7 +20,7 @@
namespace WebView { namespace WebView {
class WebUI class WEBVIEW_API WebUI
: public IPC::ConnectionToServer<WebUIClientEndpoint, WebUIServerEndpoint> : public IPC::ConnectionToServer<WebUIClientEndpoint, WebUIServerEndpoint>
, public WebUIClientEndpoint { , public WebUIClientEndpoint {
public: public:

View file

@ -6,11 +6,12 @@
#pragma once #pragma once
#include <LibWebView/Forward.h>
#include <LibWebView/WebUI.h> #include <LibWebView/WebUI.h>
namespace WebView { namespace WebView {
class ProcessesUI : public WebUI { class WEBVIEW_API ProcessesUI : public WebUI {
WEB_UI(ProcessesUI); WEB_UI(ProcessesUI);
private: private:

View file

@ -6,11 +6,12 @@
#pragma once #pragma once
#include <LibWebView/Forward.h>
#include <LibWebView/WebUI.h> #include <LibWebView/WebUI.h>
namespace WebView { namespace WebView {
class SettingsUI : public WebUI { class WEBVIEW_API SettingsUI : public WebUI {
WEB_UI(SettingsUI); WEB_UI(SettingsUI);
private: private:

View file

@ -52,7 +52,7 @@ endif()
target_link_libraries(WebContent PRIVATE webcontentservice LibURL) target_link_libraries(WebContent PRIVATE webcontentservice LibURL)
if(WIN32) if(WIN32)
# FIXME: This is a hack to get around lld-link error undefined symbols in various libraries # FIXME: This is a hack to get around lld-link error undefined symbols in LibWeb
target_link_libraries(WebContent PRIVATE target_link_libraries(WebContent PRIVATE
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AbortSignal> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AbortSignal>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AttributeNames> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AttributeNames>
@ -78,7 +78,6 @@ if(WIN32)
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,TransformStream> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,TransformStream>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WebUI> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WebUI>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WritableStream> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WritableStream>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Utilities>
) )
find_package(unofficial-angle REQUIRED CONFIG) find_package(unofficial-angle REQUIRED CONFIG)
target_link_libraries(WebContent PRIVATE LibTextCodec unofficial::angle::libGLESv2) target_link_libraries(WebContent PRIVATE LibTextCodec unofficial::angle::libGLESv2)

View file

@ -22,7 +22,7 @@ target_include_directories(WebWorker PRIVATE ${LADYBIRD_SOURCE_DIR})
target_link_libraries(WebWorker PRIVATE webworkerservice) target_link_libraries(WebWorker PRIVATE webworkerservice)
if(WIN32) if(WIN32)
# FIXME: This is a hack to get around lld-link error undefined symbols in various libraries # FIXME: This is a hack to get around lld-link error undefined symbols in LibWeb
target_link_libraries(webworkerservice PRIVATE target_link_libraries(webworkerservice PRIVATE
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,CallbackType> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,CallbackType>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,DedicatedWorkerGlobalScope> $<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,DedicatedWorkerGlobalScope>

View file

@ -13,12 +13,6 @@ target_link_libraries(test-web PRIVATE AK LibCore LibDiff LibFileSystem LibGfx L
if (APPLE) if (APPLE)
target_compile_definitions(test-web PRIVATE LADYBIRD_BINARY_PATH="$<TARGET_FILE_DIR:ladybird>") target_compile_definitions(test-web PRIVATE LADYBIRD_BINARY_PATH="$<TARGET_FILE_DIR:ladybird>")
elseif (WIN32) elseif (WIN32)
# FIXME: This is a hack to get around lld-link error undefined symbols in various libraries
target_link_libraries(test-web PRIVATE
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Application>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Utilities>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,WebContentClient>
)
target_link_libraries(test-web PRIVATE LibDevTools) target_link_libraries(test-web PRIVATE LibDevTools)
find_package(pthread REQUIRED) find_package(pthread REQUIRED)
target_include_directories(test-web PRIVATE $<BUILD_INTERFACE:${PTHREAD_INCLUDE_DIR}>) target_include_directories(test-web PRIVATE $<BUILD_INTERFACE:${PTHREAD_INCLUDE_DIR}>)

View file

@ -77,14 +77,7 @@ target_include_directories(${LADYBIRD_TARGET} ${LADYBIRD_SOURCE_DIR})
target_include_directories(${LADYBIRD_TARGET} ${LADYBIRD_SOURCE_DIR}/Services/) target_include_directories(${LADYBIRD_TARGET} ${LADYBIRD_SOURCE_DIR}/Services/)
if(WIN32) if(WIN32)
# FIXME: This is a hack to get around lld-link error undefined symbols in various libraries target_link_libraries(${LADYBIRD_TARGET} LibDevTools)
target_link_libraries(${LADYBIRD_TARGET}
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Application>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,UserAgent>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Utilities>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,WebContentClient>
LibDevTools
)
endif() endif()
function(set_helper_process_properties) function(set_helper_process_properties)