Skip to content

Commit

Permalink
Generate IPC serialization for enumerations under WebCore/workers
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264563

Reviewed by Chris Dumez.

Remove EnumTraits specializations for the BackgroundFetchFailureReason and
BackgroundFetchResult enumerations. Instead, provide IPC serialization
specification for the two enumerations in the WebCoreArgumentCoders
serialization input file.

* Source/WebCore/workers/service/background-fetch/BackgroundFetchFailureReason.h:
* Source/WebCore/workers/service/background-fetch/BackgroundFetchResult.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/270595@main
  • Loading branch information
zdobersek committed Nov 11, 2023
1 parent 779341c commit ecd3922
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#if ENABLE(SERVICE_WORKER)

#include <wtf/EnumTraits.h>

namespace WebCore {

enum class BackgroundFetchFailureReason : uint8_t {
Expand All @@ -42,20 +40,4 @@ enum class BackgroundFetchFailureReason : uint8_t {

} // namespace WebCore

namespace WTF {

template<> struct EnumTraits<WebCore::BackgroundFetchFailureReason> {
using values = EnumValues<
WebCore::BackgroundFetchFailureReason,
WebCore::BackgroundFetchFailureReason::EmptyString,
WebCore::BackgroundFetchFailureReason::Aborted,
WebCore::BackgroundFetchFailureReason::BadStatus,
WebCore::BackgroundFetchFailureReason::FetchError,
WebCore::BackgroundFetchFailureReason::QuotaExceeded,
WebCore::BackgroundFetchFailureReason::DownloadTotalExceeded
>;
};

} // namespace WTF

#endif // ENABLE(SERVICE_WORKER)
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

#if ENABLE(SERVICE_WORKER)

#include <wtf/EnumTraits.h>

namespace WebCore {

enum class BackgroundFetchResult : uint8_t {
Expand All @@ -39,17 +37,4 @@ enum class BackgroundFetchResult : uint8_t {

} // namespace WebCore

namespace WTF {

template<> struct EnumTraits<WebCore::BackgroundFetchResult> {
using values = EnumValues<
WebCore::BackgroundFetchResult,
WebCore::BackgroundFetchResult::EmptyString,
WebCore::BackgroundFetchResult::Success,
WebCore::BackgroundFetchResult::Failure
>;
};

} // namespace WTF

#endif // ENABLE(SERVICE_WORKER)
17 changes: 17 additions & 0 deletions Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
Original file line number Diff line number Diff line change
Expand Up @@ -6665,3 +6665,20 @@ enum class WebCore::ExceptionCode : uint8_t {
OutOfMemoryError,
ExistingExceptionError,
}

header: <WebCore/BackgroundFetchFailureReason.h>
enum class WebCore::BackgroundFetchFailureReason : uint8_t {
EmptyString,
Aborted,
BadStatus,
FetchError,
QuotaExceeded,
DownloadTotalExceeded
};

header: <WebCore/BackgroundFetchResult.h>
enum class WebCore::BackgroundFetchResult : uint8_t {
EmptyString,
Success,
Failure
};

0 comments on commit ecd3922

Please sign in to comment.