Skip to content

Commit

Permalink
Deploy more smart pointers in Source/WebKit/GPUProcess/GPUProcess.cpp
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=273531

Reviewed by Tim Nguyen.

Deployed more smart pointers in Source/WebKit/GPUProcess/GPUProcess.cpp
as warned by the clang static analyzer.

* Source/WebKit/GPUProcess/GPUProcess.cpp:
(WebKit::GPUProcess::tryExitIfUnused):
(WebKit::GPUProcess::updateCaptureAccess):
(WebKit::GPUProcess::updateCaptureOrigin):
* Source/WebKit/Shared/AuxiliaryProcess.h:
(WebKit::AuxiliaryProcess::protectedParentProcessConnection const):

Canonical link: https://commits.webkit.org/278216@main
  • Loading branch information
rniwa committed May 1, 2024
1 parent 926918e commit a56e420
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebKit/GPUProcess/GPUProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void GPUProcess::tryExitIfUnused()
m_idleExitTimer.stop();

RELEASE_LOG(Process, "GPUProcess::tryExitIfUnused: GPUProcess is exiting because we are under memory pressure and the process is no longer useful.");
parentProcessConnection()->send(Messages::GPUProcessProxy::ProcessIsReadyToExit(), 0);
protectedParentProcessConnection()->send(Messages::GPUProcessProxy::ProcessIsReadyToExit(), 0);
}

void GPUProcess::lowMemoryHandler(Critical critical, Synchronous synchronous)
Expand Down Expand Up @@ -452,7 +452,7 @@ void GPUProcess::updateCaptureAccess(bool allowAudioCapture, bool allowVideoCapt
ensureAVCaptureServerConnection();
#endif

if (auto* connection = webProcessConnection(processID)) {
if (RefPtr connection = webProcessConnection(processID)) {
connection->updateCaptureAccess(allowAudioCapture, allowVideoCapture, allowDisplayCapture);
return completionHandler();
}
Expand All @@ -467,7 +467,7 @@ void GPUProcess::updateCaptureAccess(bool allowAudioCapture, bool allowVideoCapt

void GPUProcess::updateCaptureOrigin(const WebCore::SecurityOriginData& originData, WebCore::ProcessIdentifier processID)
{
if (auto* connection = webProcessConnection(processID))
if (RefPtr connection = webProcessConnection(processID))
connection->updateCaptureOrigin(originData);
}

Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/Shared/AuxiliaryProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class AuxiliaryProcess : public IPC::Connection::Client, public IPC::MessageSend
static void applySandboxProfileForDaemon(const String& profilePath, const String& userDirectorySuffix);

IPC::Connection* parentProcessConnection() const { return m_connection.get(); }
RefPtr<IPC::Connection> protectedParentProcessConnection() const { return parentProcessConnection(); }

IPC::MessageReceiverMap& messageReceiverMap() { return m_messageReceiverMap; }

Expand Down

0 comments on commit a56e420

Please sign in to comment.