Skip to content

Commit

Permalink
Make WebPageGroupData use generated serialization
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262652

Reviewed by Alex Christensen.

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/Shared/WebPageGroupData.cpp:
(WebKit::WebPageGroupData::encode const): Deleted.
(WebKit::WebPageGroupData::decode): Deleted.
* Source/WebKit/Shared/WebPageGroupData.h:
* Source/WebKit/Shared/WebPageGroupData.serialization.in: Added.
* Source/WebKit/Sources.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/269001@main
  • Loading branch information
rniwa committed Oct 6, 2023
1 parent 5b38611 commit 009dc74
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 31 deletions.
1 change: 1 addition & 0 deletions Source/WebKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ set(WebKit_SERIALIZATION_IN_FILES
Shared/WebHitTestResultData.serialization.in
Shared/WebNavigationDataStore.serialization.in
Shared/WebPageCreationParameters.serialization.in
Shared/WebPageGroupData.serialization.in
Shared/WebPageNetworkParameters.serialization.in
Shared/WebPopupItem.serialization.in
Shared/WebProcessCreationParameters.serialization.in
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/DerivedSources-input.xcfilelist
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ $(PROJECT_DIR)/Shared/WebHitTestResultData.serialization.in
$(PROJECT_DIR)/Shared/WebNavigationDataStore.serialization.in
$(PROJECT_DIR)/Shared/WebPageCreationParameters.serialization.in
$(PROJECT_DIR)/Shared/WebPageNetworkParameters.serialization.in
$(PROJECT_DIR)/Shared/WebPageGroupData.serialization.in
$(PROJECT_DIR)/Shared/WebPopupItem.serialization.in
$(PROJECT_DIR)/Shared/WebProcessCreationParameters.serialization.in
$(PROJECT_DIR)/Shared/WebProcessDataStoreParameters.serialization.in
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/DerivedSources.make
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ SERIALIZATION_DESCRIPTION_FILES = \
Shared/WebNavigationDataStore.serialization.in \
Shared/WebPageCreationParameters.serialization.in \
Shared/WebPageNetworkParameters.serialization.in \
Shared/WebPageGroupData.serialization.in \
Shared/WebPopupItem.serialization.in \
Shared/WebProcessCreationParameters.serialization.in \
Shared/WebProcessDataStoreParameters.serialization.in \
Expand Down
21 changes: 0 additions & 21 deletions Source/WebKit/Shared/WebPageGroupData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,4 @@

namespace WebKit {

void WebPageGroupData::encode(IPC::Encoder& encoder) const
{
encoder << identifier;
encoder << pageGroupID;
}

std::optional<WebPageGroupData> WebPageGroupData::decode(IPC::Decoder& decoder)
{
std::optional<String> identifier;
decoder >> identifier;
if (!identifier)
return std::nullopt;

std::optional<PageGroupIdentifier> pageGroupID;
decoder >> pageGroupID;
if (!pageGroupID)
return std::nullopt;

return {{ WTFMove(*identifier), *pageGroupID }};
}

} // namespace WebKit
8 changes: 0 additions & 8 deletions Source/WebKit/Shared/WebPageGroupData.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,9 @@
#include "IdentifierTypes.h"
#include <wtf/text/WTFString.h>

namespace IPC {
class Decoder;
class Encoder;
}

namespace WebKit {

struct WebPageGroupData {
void encode(IPC::Encoder&) const;
static std::optional<WebPageGroupData> decode(IPC::Decoder&);

String identifier;
PageGroupIdentifier pageGroupID;
};
Expand Down
26 changes: 26 additions & 0 deletions Source/WebKit/Shared/WebPageGroupData.serialization.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (C) 2023 Apple 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.

struct WebKit::WebPageGroupData {
String identifier;
WebKit::PageGroupIdentifier pageGroupID;
}
2 changes: 0 additions & 2 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6809,7 +6809,6 @@
BC7B621312A4219A00D174A4 /* WebPageGroupProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageGroupProxy.h; sourceTree = "<group>"; };
BC7B621412A4219A00D174A4 /* WebPageGroupProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageGroupProxy.cpp; sourceTree = "<group>"; };
BC7B625012A43C9600D174A4 /* WebPageGroupData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageGroupData.h; sourceTree = "<group>"; };
BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageGroupData.cpp; sourceTree = "<group>"; };
BC7B633512A45ABA00D174A4 /* WKPageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageGroup.h; sourceTree = "<group>"; };
BC7B633612A45ABA00D174A4 /* WKPageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageGroup.cpp; sourceTree = "<group>"; };
BC82839616B47EC400A278FE /* XPCServiceMain.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = XPCServiceMain.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -8464,7 +8463,6 @@
BCF69F981176CED600471A52 /* WebNavigationDataStore.h */,
C06C6094124C14430001682F /* WebPageCreationParameters.h */,
466A4B192A3D293E007E286E /* WebPageCreationParameters.serialization.in */,
BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */,
BC7B625012A43C9600D174A4 /* WebPageGroupData.h */,
5C1B38DF2667140700B1545B /* WebPageNetworkParameters.h */,
8623B1272ACE1B66002BA9EA /* WebPageNetworkParameters.serialization.in */,
Expand Down

0 comments on commit 009dc74

Please sign in to comment.