Skip to content

Commit

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

Reviewed by Alex Christensen.

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp: Removed.
* Source/WebKit/GPUProcess/GPUProcessCreationParameters.h:
* Source/WebKit/GPUProcess/GPUProcessCreationParameters.serialization.in: Added.
* Source/WebKit/Sources.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/268973@main
  • Loading branch information
rniwa committed Oct 6, 2023
1 parent 269e774 commit af07911
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 182 deletions.
1 change: 1 addition & 0 deletions Source/WebKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ set(WebKit_MESSAGES_IN_FILES
)

set(WebKit_SERIALIZATION_IN_FILES
GPUProcess/GPUProcessCreationParameters.serialization.in
GPUProcess/GPUProcessSessionParameters.serialization.in

GPUProcess/graphics/PathSegment.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 @@ -33,6 +33,7 @@ $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR)/xxd.pl
$(PROJECT_DIR)/DerivedSources.make
$(PROJECT_DIR)/GPUProcess/GPUConnectionToWebProcess.messages.in
$(PROJECT_DIR)/GPUProcess/GPUProcess.messages.in
$(PROJECT_DIR)/GPUProcess/GPUProcessCreationParameters.serialization.in
$(PROJECT_DIR)/GPUProcess/GPUProcessSessionParameters.serialization.in
$(PROJECT_DIR)/GPUProcess/ShapeDetection/RemoteBarcodeDetector.messages.in
$(PROJECT_DIR)/GPUProcess/ShapeDetection/RemoteFaceDetector.messages.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 @@ -469,6 +469,7 @@ $(WEB_PREFERENCES_PATTERNS) : $(WTF_BUILD_SCRIPTS_DIR)/GeneratePreferences.rb $(
$(RUBY) $< --frontend WebKit $(addprefix --template , $(WEB_PREFERENCES_TEMPLATES)) $(WEB_PREFERENCES)

SERIALIZATION_DESCRIPTION_FILES = \
GPUProcess/GPUProcessCreationParameters.serialization.in \
GPUProcess/GPUProcessSessionParameters.serialization.in \
GPUProcess/graphics/PathSegment.serialization.in \
GPUProcess/graphics/RemoteGraphicsContextGLInitializationState.serialization.in \
Expand Down
172 changes: 0 additions & 172 deletions Source/WebKit/GPUProcess/GPUProcessCreationParameters.cpp

This file was deleted.

5 changes: 0 additions & 5 deletions Source/WebKit/GPUProcess/GPUProcessCreationParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ class Encoder;
namespace WebKit {

struct GPUProcessCreationParameters {
GPUProcessCreationParameters();

AuxiliaryProcessCreationParameters auxiliaryProcessParameters;
#if ENABLE(MEDIA_STREAM)
bool useMockCaptureDevices { false };
Expand Down Expand Up @@ -76,9 +74,6 @@ struct GPUProcessCreationParameters {
String renderDeviceFile;
#endif
Vector<String> overrideLanguages;

void encode(IPC::Encoder&) const;
static WARN_UNUSED_RETURN bool decode(IPC::Decoder&, GPUProcessCreationParameters&);
};

} // namespace WebKit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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.

#if ENABLE(GPU_PROCESS)

struct WebKit::GPUProcessCreationParameters {
WebKit::AuxiliaryProcessCreationParameters auxiliaryProcessParameters;

#if ENABLE(MEDIA_STREAM)
bool useMockCaptureDevices;
#if PLATFORM(MAC)
WebKit::SandboxExtension::Handle microphoneSandboxExtensionHandle;
WebKit::SandboxExtension::Handle launchServicesExtensionHandle;
#endif
#endif

#if HAVE(AVCONTENTKEYSPECIFIER)
bool sampleBufferContentKeySessionSupportEnabled;
#endif

ProcessID parentPID;

#if USE(SANDBOX_EXTENSIONS_FOR_CACHE_AND_TEMP_DIRECTORY_ACCESS)
WebKit::SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
WebKit::SandboxExtension::Handle containerTemporaryDirectoryExtensionHandle;
#endif

#if PLATFORM(IOS_FAMILY)
Vector<WebKit::SandboxExtension::Handle> compilerServiceExtensionHandles;
Vector<WebKit::SandboxExtension::Handle> dynamicIOKitExtensionHandles;
#endif

std::optional<WebKit::SandboxExtension::Handle> mobileGestaltExtensionHandle;

#if PLATFORM(COCOA) && ENABLE(REMOTE_INSPECTOR)
Vector<WebKit::SandboxExtension::Handle> gpuToolsExtensionHandles;
#endif

String applicationVisibleName;

#if PLATFORM(COCOA)
bool strictSecureDecodingForAllObjCEnabled;
#endif

#if USE(GBM)
String renderDeviceFile;
#endif

Vector<String> overrideLanguages;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

#include "GPUConnectionToWebProcess.h"
#include "IPCUtilities.h"
#include <WebCore/ProcessIdentity.h>
#include <wtf/MachSendRight.h>


#if ENABLE(VIDEO)
#include "RemoteVideoFrameObjectHeap.h"
#include <WebCore/GraphicsContextGLCV.h>
Expand Down Expand Up @@ -123,7 +123,7 @@ void RemoteGraphicsContextGLCocoa::createEGLSync(WTF::MachSendRight syncEvent, u
void RemoteGraphicsContextGLCocoa::platformWorkQueueInitialize(WebCore::GraphicsContextGLAttributes&& attributes)
{
assertIsCurrent(workQueue());
m_context = WebCore::GraphicsContextGLCocoa::create(WTFMove(attributes), ProcessIdentity { m_resourceOwner });
m_context = WebCore::GraphicsContextGLCocoa::create(WTFMove(attributes), WebCore::ProcessIdentity { m_resourceOwner });
}

void RemoteGraphicsContextGLCocoa::prepareForDisplay(IPC::Semaphore&& finishedSemaphore, CompletionHandler<void(WTF::MachSendRight&&)>&& completionHandler)
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit/Sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

GPUProcess/GPUProcess.cpp
GPUProcess/GPUConnectionToWebProcess.cpp
GPUProcess/GPUProcessCreationParameters.cpp
GPUProcess/GPUProcessPreferences.cpp
GPUProcess/ShapeDetection/RemoteBarcodeDetector.cpp
GPUProcess/ShapeDetection/RemoteFaceDetector.cpp
Expand Down
2 changes: 0 additions & 2 deletions Source/WebKit/WebKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4412,7 +4412,6 @@
2D9FB2102375209D0049F936 /* GPUServiceEntryPoint.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = GPUServiceEntryPoint.mm; sourceTree = "<group>"; };
2D9FB2122375209D0049F936 /* Info-OSX.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-OSX.plist"; sourceTree = "<group>"; };
2D9FB2132375209D0049F936 /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; };
2D9FB2142375209D0049F936 /* GPUProcessCreationParameters.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = GPUProcessCreationParameters.cpp; sourceTree = "<group>"; };
2D9FB2152375209D0049F936 /* GPUProcess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUProcess.h; sourceTree = "<group>"; };
2D9FB228237523830049F936 /* com.apple.WebKit.GPU.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = com.apple.WebKit.GPU.xpc; sourceTree = BUILT_PRODUCTS_DIR; };
2D9FB22A237523FB0049F936 /* GPUService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = GPUService.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9867,7 +9866,6 @@
2D9FB2012375209D0049F936 /* GPUProcess.cpp */,
2D9FB2152375209D0049F936 /* GPUProcess.h */,
2D9FB2022375209D0049F936 /* GPUProcess.messages.in */,
2D9FB2142375209D0049F936 /* GPUProcessCreationParameters.cpp */,
2D9FB2032375209D0049F936 /* GPUProcessCreationParameters.h */,
5ABF2BEC2862353F000DCE74 /* GPUProcessPreferences.cpp */,
5ABF2BED2862353F000DCE74 /* GPUProcessPreferences.h */,
Expand Down

0 comments on commit af07911

Please sign in to comment.