Changeset 254392 in webkit
- Timestamp:
- Jan 10, 2020 9:32:23 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r254391 r254392 1 2020-01-10 Eric Carlson <eric.carlson@apple.com> 2 3 [Media in GPU process] Extend the GPU process sandbox to allow access to local files when necessary 4 https://bugs.webkit.org/show_bug.cgi?id=205967 5 <rdar://problem/58425020> 6 7 Reviewed by youenn fablet. 8 9 * gpu-process/TestExpectations: 10 1 11 2020-01-10 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/LayoutTests/gpu-process/TestExpectations
r254019 r254392 180 180 181 181 media [ Skip ] 182 media/audio-play-with-video-element.html [ Pass ]183 media/audio-play.html [ Pass ]184 media/media-can-play-mpeg-audio.html [ Pass ]185 media/media-can-play-wav-audio.html [ Pass ]186 182 media/media-controller.html [ Pass ] 187 183 media/media-preload-no-delay-loadevent.html [ Pass ] 188 184 media/video-src.html [ Pass ] 189 185 media/video-source.html [ Pass ] 186 media/audio-as-video-fullscreen.html [ Pass ] 187 media/audio-background-playback-playlist.html [ Pass ] 188 media/audio-concurrent-supported.html [ Pass ] 189 media/audio-constructor-preload.html [ Pass ] 190 media/audio-constructor-src.html [ Pass ] 191 media/audio-constructor.html [ Pass ] 192 media/audio-controls-do-not-fade-out.html [ Pass ] 193 media/audio-controls-timeline-in-media-document.html [ Pass ] 194 media/audio-dealloc-crash.html [ Pass ] 195 media/audio-delete-while-slider-thumb-clicked.html [ Pass ] 196 media/audio-garbage-collect.html [ Pass ] 197 media/audio-mpeg-supported.html [ Pass ] 198 media/audio-mpeg4-supported.html [ Pass ] 199 media/audio-no-installed-engines.html [ Pass ] 200 media/audio-only-video-intrinsic-size.html [ Pass ] 201 media/audio-play-event.html [ Pass ] 202 media/audio-play-with-video-element.html [ Pass ] 203 media/audio-play.html [ Pass ] 204 media/audio-playback-restriction-autoplay.html [ Pass ] 205 media/audio-playback-restriction-play-muted.html [ Pass ] 206 media/audio-playback-restriction-play.html [ Pass ] 207 media/audio-playback-restriction-removed-muted.html [ Pass ] 208 media/audio-playback-volume-changes-with-restrictions-and-user-gestures.html [ Pass ] 209 media/audio-playback-volume-changes-with-restrictions.html [ Pass ] 210 media/deactivate-audio-session.html [ Pass ] 211 media/media-can-play-mpeg-audio.html [ Pass ] 212 media/media-can-play-wav-audio.html [ Pass ] 213 media/media-document-audio-controls-visible.html [ Pass ] 214 media/media-document-audio-repaint.html [ Pass ] 215 media/media-document-audio-size.html [ Pass ] 216 media/muted-video-is-playing-audio.html [ Pass ] 217 media/restricted-audio-playback-with-document-gesture.html [ Pass ] 218 media/restricted-audio-playback-with-multiple-settimeouts.html [ Pass ] 219 media/video-controls-visible-audio-only.html [ Pass ] 220 media/video-play-audio-require-user-gesture.html [ Pass ] 221 190 222 accessibility/media-element.html [ Skip ] 191 223 fast/block/float/list-marker-is-float-crash.html [ Skip ] -
trunk/Source/WebKit/ChangeLog
r254387 r254392 1 2020-01-10 Eric Carlson <eric.carlson@apple.com> 2 3 [Media in GPU process] Extend the GPU process sandbox to allow access to local files when necessary 4 https://bugs.webkit.org/show_bug.cgi?id=205967 5 <rdar://problem/58425020> 6 7 Reviewed by youenn fablet. 8 9 No new tests, un-skipped existing tests that pass because of this change. 10 11 The GPU process sandbox does not allow access to local files so extend it before 12 attempting to open a file:// url, and revoke the extension when the file is closed. 13 14 * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: 15 (WebKit::RemoteMediaPlayerManagerProxy::load): 16 * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: 17 * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: 18 * GPUProcess/media/RemoteMediaPlayerProxy.cpp: 19 (WebKit::RemoteMediaPlayerProxy::invalidate): 20 (WebKit::RemoteMediaPlayerProxy::load): 21 * GPUProcess/media/RemoteMediaPlayerProxy.h: 22 * UIProcess/GPU/GPUProcessProxy.cpp: 23 (WebKit::GPUProcessProxy::openGPUProcessConnection): 24 * UIProcess/GPU/GPUProcessProxy.h: 25 * UIProcess/WebProcessProxy.cpp: 26 * UIProcess/WebProcessProxy.h: 27 * WebKit.xcodeproj/project.pbxproj: 28 * WebProcess/GPU/GPUProcessConnection.h: 29 (WebKit::GPUProcessConnection::setAuditToken): 30 (WebKit::GPUProcessConnection::auditToken const): 31 * WebProcess/GPU/GPUProcessConnectionInfo.h: 32 (WebKit::GPUProcessConnectionInfo::encode const): 33 (WebKit::GPUProcessConnectionInfo::decode): 34 * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: 35 (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): 36 (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): 37 (WebKit::MediaPlayerPrivateRemote::cancelLoad): 38 (WebKit::MediaPlayerPrivateRemote::prepareToPlay): 39 (WebKit::MediaPlayerPrivateRemote::play): 40 (WebKit::MediaPlayerPrivateRemote::pause): 41 (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): 42 (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): 43 (WebKit::MediaPlayerPrivateRemote::setMuted): 44 (WebKit::MediaPlayerPrivateRemote::setPreload): 45 (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): 46 (WebKit::MediaPlayerPrivateRemote::seek): 47 (WebKit::MediaPlayerPrivateRemote::seekWithTolerance): 48 (WebKit::MediaPlayerPrivateRemote::prepareForRendering): 49 (WebKit::MediaPlayerPrivateRemote::setSize): 50 (WebKit::MediaPlayerPrivateRemote::setVisible): 51 (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): 52 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): 53 (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): 54 (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): 55 (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): 56 (WebKit::MediaPlayerPrivateRemote::requestResource): 57 * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 58 * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp: 59 (WebKit::RemoteMediaPlayerMIMETypeCache::canDecodeExtendedType): 60 (WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs): 61 (WebKit::RemoteMediaPlayerMIMETypeCache::initializeCache): 62 * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: 63 (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 64 (WebKit::RemoteMediaPlayerManager::deleteRemoteMediaPlayer): 65 (WebKit::RemoteMediaPlayerManager::getSupportedTypes): 66 (WebKit::RemoteMediaPlayerManager::originsInMediaCache): 67 (WebKit::RemoteMediaPlayerManager::clearMediaCache): 68 (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): 69 (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const): 70 * WebProcess/GPU/media/RemoteMediaPlayerManager.h: 71 (WebKit::RemoteMediaPlayerManager::parentProcess const): 72 * WebProcess/WebProcess.cpp: 73 (WebKit::WebProcess::ensureGPUProcessConnection): 74 1 75 2020-01-10 Jer Noble <jer.noble@apple.com> 2 76 -
trunk/Source/WebKit/GPUProcess/GPUProcess.cpp
r253900 r254392 36 36 #include "GPUProcessCreationParameters.h" 37 37 #include "Logging.h" 38 #include "SandboxExtension.h" 38 39 #include "WebPageProxyMessages.h" 39 40 #include "WebProcessPoolMessages.h" -
trunk/Source/WebKit/GPUProcess/GPUProcess.messages.in
r253900 r254392 1 # Copyright (C) 2019 Apple Inc. All rights reserved.1 # Copyright (C) 2019-2020 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp
r254098 r254392 204 204 } 205 205 206 void RemoteMediaPlayerManagerProxy::load(MediaPlayerPrivateRemoteIdentifier id, URL&& url, WebCore::ContentType&& contentType, String&& keySystem, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&& completionHandler)207 { 208 if (auto player = m_proxies.get(id)) 209 player->load(WTFMove(url), WTFMove( contentType), WTFMove(keySystem), WTFMove(completionHandler));206 void RemoteMediaPlayerManagerProxy::load(MediaPlayerPrivateRemoteIdentifier id, URL&& url, Optional<SandboxExtension::Handle>&& sandboxExtension, WebCore::ContentType&& contentType, String&& keySystem, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&& completionHandler) 207 { 208 if (auto player = m_proxies.get(id)) 209 player->load(WTFMove(url), WTFMove(sandboxExtension), WTFMove(contentType), WTFMove(keySystem), WTFMove(completionHandler)); 210 210 } 211 211 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.h
r254098 r254392 31 31 #include "MediaPlayerPrivateRemoteIdentifier.h" 32 32 #include "MessageReceiver.h" 33 #include "SandboxExtension.h" 33 34 #include <WebCore/MediaPlayer.h> 34 35 #include <wtf/LoggerHelper.h> … … 83 84 void supportsKeySystem(WebCore::MediaPlayerEnums::MediaEngineIdentifier, const String&&, const String&&, CompletionHandler<void(bool)>&&); 84 85 85 void load(MediaPlayerPrivateRemoteIdentifier, URL&&, WebCore::ContentType&&, String&&, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&&);86 void load(MediaPlayerPrivateRemoteIdentifier, URL&&, Optional<SandboxExtension::Handle>&&, WebCore::ContentType&&, String&&, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&&); 86 87 void prepareForPlayback(MediaPlayerPrivateRemoteIdentifier, bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering); 87 88 void cancelLoad(MediaPlayerPrivateRemoteIdentifier); -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in
r254098 r254392 38 38 PrepareForPlayback(WebKit::MediaPlayerPrivateRemoteIdentifier id, bool privateMode, enum:uint8_t WebCore::MediaPlayerEnums::Preload preload, bool preservesPitch, bool prepareForRendering) 39 39 40 Load(WebKit::MediaPlayerPrivateRemoteIdentifier id, URL url, WebCore::ContentType contentType, String keySystem) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async40 Load(WebKit::MediaPlayerPrivateRemoteIdentifier id, URL url, Optional<WebKit::SandboxExtension::Handle> sandboxExtension, WebCore::ContentType contentType, String keySystem) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async 41 41 CancelLoad(WebKit::MediaPlayerPrivateRemoteIdentifier id) 42 42 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
r254098 r254392 70 70 m_updateCachedStateMessageTimer.stop(); 71 71 m_player->invalidate(); 72 if (m_sandboxExtension) { 73 m_sandboxExtension->revoke(); 74 m_sandboxExtension = nullptr; 75 } 72 76 } 73 77 … … 83 87 } 84 88 85 void RemoteMediaPlayerProxy::load(const URL& url, const ContentType& contentType, const String& keySystem, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&& completionHandler) 86 { 89 void RemoteMediaPlayerProxy::load(const URL& url, Optional<SandboxExtension::Handle>&& sandboxExtensionHandle, const ContentType& contentType, const String& keySystem, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&& completionHandler) 90 { 91 RemoteMediaPlayerConfiguration configuration; 92 93 if (sandboxExtensionHandle) { 94 m_sandboxExtension = SandboxExtension::create(WTFMove(sandboxExtensionHandle.value())); 95 if (m_sandboxExtension) 96 m_sandboxExtension->consume(); 97 else 98 WTFLogAlways("Unable to create sandbox extension for media url.\n"); 99 } 100 87 101 m_player->load(url, contentType, keySystem); 88 89 RemoteMediaPlayerConfiguration configuration;90 102 getConfiguration(configuration); 91 103 completionHandler(WTFMove(configuration)); -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
r254098 r254392 34 34 #include "RemoteMediaPlayerState.h" 35 35 #include "RemoteMediaResourceIdentifier.h" 36 #include "SandboxExtension.h" 36 37 #include <WebCore/Cookie.h> 37 38 #include <WebCore/MediaPlayer.h> … … 61 62 void prepareForPlayback(bool privateMode, WebCore::MediaPlayerEnums::Preload, bool preservesPitch, bool prepareForRendering); 62 63 63 void load(const URL&, const WebCore::ContentType&, const String&, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&&);64 void load(const URL&, Optional<SandboxExtension::Handle>&&, const WebCore::ContentType&, const String&, CompletionHandler<void(RemoteMediaPlayerConfiguration&&)>&&); 64 65 void cancelLoad(); 65 66 … … 187 188 188 189 MediaPlayerPrivateRemoteIdentifier m_id; 190 RefPtr<SandboxExtension> m_sandboxExtension; 189 191 Ref<IPC::Connection> m_webProcessConnection; 190 192 RefPtr<WebCore::MediaPlayer> m_player; -
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp
r254259 r254392 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 48 48 #endif 49 49 50 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, connection())50 #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, this->connection()) 51 51 52 52 namespace WebKit { … … 126 126 void GPUProcessProxy::openGPUProcessConnection(ConnectionRequestIdentifier connectionRequestIdentifier, WebProcessProxy& webProcessProxy) 127 127 { 128 connection()->sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(this), webProcessProxy = makeWeakPtr(webProcessProxy), connectionRequestIdentifier](auto&& connectionIdentifier) mutable { 128 auto& connection = *this->connection(); 129 130 connection.sendWithAsyncReply(Messages::GPUProcess::CreateGPUConnectionToWebProcess { webProcessProxy.coreProcessIdentifier(), webProcessProxy.sessionID() }, [this, weakThis = makeWeakPtr(this), webProcessProxy = makeWeakPtr(webProcessProxy), connectionRequestIdentifier](auto&& connectionIdentifier) mutable { 129 131 if (!weakThis) 130 132 return; … … 143 145 #elif OS(DARWIN) 144 146 MESSAGE_CHECK(MACH_PORT_VALID(connectionIdentifier->port())); 145 request.reply(GPUProcessConnectionInfo { IPC::Attachment { connectionIdentifier->port(), MACH_MSG_TYPE_MOVE_SEND } });147 request.reply(GPUProcessConnectionInfo { IPC::Attachment { connectionIdentifier->port(), MACH_MSG_TYPE_MOVE_SEND }, this->connection()->getAuditToken() }); 146 148 #else 147 149 notImplemented(); -
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.h
r254259 r254392 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 #include "ProcessThrottler.h" 34 34 #include "ProcessThrottlerClient.h" 35 #include "TransactionID.h"36 35 #include "WebPageProxyIdentifier.h" 37 36 #include "WebProcessProxyMessagesReplies.h" 38 37 #include <memory> 39 #include <wtf/Deque.h>40 38 41 39 namespace WebKit { … … 97 95 ProcessThrottler m_throttler; 98 96 ProcessThrottler::ActivityVariant m_activityFromWebProcesses; 99 100 97 #if ENABLE(MEDIA_STREAM) 101 98 bool m_useMockCaptureDevices { false }; -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r253705 r254392 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r253984 r254392 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r253484 r254392 32 32 #include "AuthenticatorManager.h" 33 33 #include "DeviceIdHashSaltStorage.h" 34 #include "GPUProcessProxy.h" 34 35 #include "MockAuthenticatorManager.h" 35 36 #include "NetworkProcessMessages.h" -
trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnection.h
r253964 r254392 48 48 IPC::Connection& connection() { return m_connection.get(); } 49 49 50 #if HAVE(AUDIT_TOKEN) 51 void setAuditToken(Optional<audit_token_t> auditToken) { m_auditToken = auditToken; } 52 Optional<audit_token_t> auditToken() const { return m_auditToken; } 53 #endif 54 50 55 private: 51 56 GPUProcessConnection(IPC::Connection::Identifier); … … 58 63 // The connection from the web process to the GPU process. 59 64 Ref<IPC::Connection> m_connection; 65 66 #if HAVE(AUDIT_TOKEN) 67 Optional<audit_token_t> m_auditToken; 68 #endif 60 69 }; 61 70 -
trunk/Source/WebKit/WebProcess/GPU/GPUProcessConnectionInfo.h
r253941 r254392 32 32 struct GPUProcessConnectionInfo { 33 33 IPC::Attachment connection; 34 #if HAVE(AUDIT_TOKEN) 35 Optional<audit_token_t> auditToken; 36 #endif 34 37 35 38 IPC::Connection::Identifier identifier() … … 61 64 { 62 65 encoder << connection; 66 #if HAVE(AUDIT_TOKEN) 67 encoder << auditToken; 68 #endif 63 69 } 64 70 … … 67 73 if (!decoder.decode(info.connection)) 68 74 return false; 75 #if HAVE(AUDIT_TOKEN) 76 if (!decoder.decode(info.auditToken)) 77 return false; 78 #endif 69 79 return true; 70 80 } -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
r254214 r254392 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #include "Logging.h" 32 32 #include "RemoteMediaPlayerManagerProxyMessages.h" 33 #include "SandboxExtension.h" 33 34 #include "WebCoreArgumentCoders.h" 35 #include "WebProcess.h" 34 36 #include <WebCore/MediaPlayer.h> 35 37 #include <WebCore/NotImplemented.h> … … 85 87 void MediaPlayerPrivateRemote::prepareForPlayback(bool privateMode, MediaPlayer::Preload preload, bool preservesPitch, bool prepare) 86 88 { 87 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::PrepareForPlayback(m_id, privateMode, preload, preservesPitch, prepare), 0);89 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::PrepareForPlayback(m_id, privateMode, preload, preservesPitch, prepare), 0); 88 90 } 89 91 90 92 void MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load(const URL& url, const ContentType& contentType, const String& keySystem) 91 93 { 92 m_manager.gpuProcessConnection().sendWithAsyncReply(Messages::RemoteMediaPlayerManagerProxy::Load(m_id, url, contentType, keySystem), [weakThis = makeWeakPtr(*this)](auto&& configuration) { 94 auto& connection = m_manager.gpuProcessConnection().connection(); 95 Optional<SandboxExtension::Handle> sandboxExtensionHandle; 96 if (url.isLocalFile()) { 97 SandboxExtension::Handle handle; 98 auto fileSystemPath = url.fileSystemPath(); 99 bool createdExtension = false; 100 101 #if HAVE(SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN) 102 auto auditToken = m_manager.gpuProcessConnection().auditToken(); 103 ASSERT(auditToken); 104 if (auditToken) 105 createdExtension = SandboxExtension::createHandleForReadByAuditToken(fileSystemPath, auditToken.value(), handle); 106 else 107 #endif 108 createdExtension = SandboxExtension::createHandle(fileSystemPath, SandboxExtension::Type::ReadOnly, handle); 109 110 if (!createdExtension) { 111 WTFLogAlways("Unable to create sandbox extension handle for GPUProcess url.\n"); 112 m_cachedState.networkState = MediaPlayer::NetworkState::FormatError; 113 m_player->networkStateChanged(); 114 return; 115 } 116 117 sandboxExtensionHandle = WTFMove(handle); 118 } 119 120 connection.sendWithAsyncReply(Messages::RemoteMediaPlayerManagerProxy::Load(m_id, url, sandboxExtensionHandle, contentType, keySystem), [weakThis = makeWeakPtr(*this)](auto&& configuration) { 93 121 if (weakThis) 94 122 weakThis->m_configuration = configuration; … … 98 126 void MediaPlayerPrivateRemote::cancelLoad() 99 127 { 100 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::CancelLoad(m_id), 0);128 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::CancelLoad(m_id), 0); 101 129 } 102 130 103 131 void MediaPlayerPrivateRemote::prepareToPlay() 104 132 { 105 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::PrepareToPlay(m_id), 0);133 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::PrepareToPlay(m_id), 0); 106 134 } 107 135 … … 109 137 { 110 138 m_cachedState.paused = false; 111 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::Play(m_id), 0);139 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::Play(m_id), 0); 112 140 } 113 141 … … 115 143 { 116 144 m_cachedState.paused = true; 117 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::Pause(m_id), 0);145 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::Pause(m_id), 0); 118 146 } 119 147 120 148 void MediaPlayerPrivateRemote::setPreservesPitch(bool preservesPitch) 121 149 { 122 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetPreservesPitch(m_id, preservesPitch), 0);150 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetPreservesPitch(m_id, preservesPitch), 0); 123 151 } 124 152 125 153 void MediaPlayerPrivateRemote::setVolumeDouble(double volume) 126 154 { 127 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetVolume(m_id, volume), 0);155 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetVolume(m_id, volume), 0); 128 156 } 129 157 130 158 void MediaPlayerPrivateRemote::setMuted(bool muted) 131 159 { 132 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetMuted(m_id, muted), 0);160 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetMuted(m_id, muted), 0); 133 161 } 134 162 135 163 void MediaPlayerPrivateRemote::setPreload(MediaPlayer::Preload preload) 136 164 { 137 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetPreload(m_id, preload), 0);165 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetPreload(m_id, preload), 0); 138 166 } 139 167 140 168 void MediaPlayerPrivateRemote::setPrivateBrowsingMode(bool privateMode) 141 169 { 142 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetPrivateBrowsingMode(m_id, privateMode), 0);170 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetPrivateBrowsingMode(m_id, privateMode), 0); 143 171 } 144 172 … … 151 179 { 152 180 m_seeking = true; 153 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::Seek(m_id, time), 0);181 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::Seek(m_id, time), 0); 154 182 } 155 183 … … 157 185 { 158 186 m_seeking = true; 159 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SeekWithTolerance(m_id, time, negativeTolerance, positiveTolerance), 0);187 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SeekWithTolerance(m_id, time, negativeTolerance, positiveTolerance), 0); 160 188 } 161 189 … … 314 342 void MediaPlayerPrivateRemote::prepareForRendering() 315 343 { 316 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::PrepareForRendering(m_id), 0);344 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::PrepareForRendering(m_id), 0); 317 345 } 318 346 319 347 void MediaPlayerPrivateRemote::setSize(const WebCore::IntSize& size) 320 348 { 321 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetSize(m_id, size), 0);349 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetSize(m_id, size), 0); 322 350 } 323 351 324 352 void MediaPlayerPrivateRemote::setVisible(bool visible) 325 353 { 326 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetVisible(m_id, visible), 0);354 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetVisible(m_id, visible), 0); 327 355 } 328 356 329 357 void MediaPlayerPrivateRemote::setShouldMaintainAspectRatio(bool maintainRatio) 330 358 { 331 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetShouldMaintainAspectRatio(m_id, maintainRatio), 0);359 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetShouldMaintainAspectRatio(m_id, maintainRatio), 0); 332 360 } 333 361 334 362 void MediaPlayerPrivateRemote::setVideoFullscreenFrame(WebCore::FloatRect rect) 335 363 { 336 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetVideoFullscreenFrame(m_id, rect), 0);364 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetVideoFullscreenFrame(m_id, rect), 0); 337 365 } 338 366 339 367 void MediaPlayerPrivateRemote::setVideoFullscreenGravity(WebCore::MediaPlayerEnums::VideoGravity gravity) 340 368 { 341 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetVideoFullscreenGravity(m_id, gravity), 0);369 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetVideoFullscreenGravity(m_id, gravity), 0); 342 370 } 343 371 344 372 void MediaPlayerPrivateRemote::acceleratedRenderingStateChanged() 345 373 { 346 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::AcceleratedRenderingStateChanged(m_id, m_player->supportsAcceleratedRendering()), 0);374 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::AcceleratedRenderingStateChanged(m_id, m_player->supportsAcceleratedRendering()), 0); 347 375 } 348 376 349 377 void MediaPlayerPrivateRemote::setShouldDisableSleep(bool disable) 350 378 { 351 m_manager.gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::SetShouldDisableSleep(m_id, disable), 0);379 m_manager.gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::SetShouldDisableSleep(m_id, disable), 0); 352 380 } 353 381 … … 814 842 auto resource = m_mediaResourceLoader->requestResource(WTFMove(request), options); 815 843 // PlatformMediaResource owns the PlatformMediaResourceClient 816 resource->setClient(makeUnique<RemoteMediaResourceProxy>(m_manager.gpuProcessConnection() , *resource, remoteMediaResourceIdentifier));844 resource->setClient(makeUnique<RemoteMediaResourceProxy>(m_manager.gpuProcessConnection().connection(), *resource, remoteMediaResourceIdentifier)); 817 845 m_mediaResources.add(remoteMediaResourceIdentifier, WTFMove(resource)); 818 846 } -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
r254214 r254392 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without -
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp
r254048 r254392 88 88 { 89 89 bool result; 90 if (!m_manager.gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::CanDecodeExtendedType(m_engineIdentifier, type.raw()), Messages::RemoteMediaPlayerManagerProxy::CanDecodeExtendedType::Reply(result), 0))90 if (!m_manager.gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::CanDecodeExtendedType(m_engineIdentifier, type.raw()), Messages::RemoteMediaPlayerManagerProxy::CanDecodeExtendedType::Reply(result), 0)) 91 91 return false; 92 92 … … 109 109 110 110 MediaPlayer::SupportsType result; 111 if (!m_manager.gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::SupportsTypeAndCodecs(m_engineIdentifier, parameters), Messages::RemoteMediaPlayerManagerProxy::SupportsTypeAndCodecs::Reply(result), 0))111 if (!m_manager.gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::SupportsTypeAndCodecs(m_engineIdentifier, parameters), Messages::RemoteMediaPlayerManagerProxy::SupportsTypeAndCodecs::Reply(result), 0)) 112 112 return MediaPlayer::SupportsType::IsNotSupported; 113 113 … … 126 126 127 127 Vector<String> types; 128 if (!m_manager.gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes(m_engineIdentifier), Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes::Reply(types), 0))128 if (!m_manager.gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes(m_engineIdentifier), Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes::Reply(types), 0)) 129 129 return; 130 130 -
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp
r254098 r254392 29 29 #if ENABLE(GPU_PROCESS) 30 30 31 #include "GPUProcessConnection.h"32 31 #include "MediaPlayerPrivateRemote.h" 33 32 #include "RemoteMediaPlayerConfiguration.h" … … 165 164 166 165 RemoteMediaPlayerConfiguration playerConfiguration; 167 bool sendSucceeded = gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(id, remoteEngineIdentifier, proxyConfiguration), Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer::Reply(playerConfiguration), 0);166 bool sendSucceeded = gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(id, remoteEngineIdentifier, proxyConfiguration), Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer::Reply(playerConfiguration), 0); 168 167 if (!sendSucceeded) { 169 168 WTFLogAlways("Failed to create remote media player."); … … 179 178 { 180 179 m_players.take(id); 181 gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::DeleteMediaPlayer(id), 0);180 gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::DeleteMediaPlayer(id), 0); 182 181 } 183 182 … … 193 192 194 193 Vector<String> types; 195 if (!gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes(remoteEngineIdentifier), Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes::Reply(types), 0))194 if (!gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes(remoteEngineIdentifier), Messages::RemoteMediaPlayerManagerProxy::GetSupportedTypes::Reply(types), 0)) 196 195 return; 197 196 … … 215 214 { 216 215 Vector<SecurityOriginData> originData; 217 if (!gpuProcessConnection(). sendSync(Messages::RemoteMediaPlayerManagerProxy::OriginsInMediaCache(remoteEngineIdentifier, path), Messages::RemoteMediaPlayerManagerProxy::OriginsInMediaCache::Reply(originData), 0))216 if (!gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::OriginsInMediaCache(remoteEngineIdentifier, path), Messages::RemoteMediaPlayerManagerProxy::OriginsInMediaCache::Reply(originData), 0)) 218 217 return { }; 219 218 … … 227 226 void RemoteMediaPlayerManager::clearMediaCache(MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, const String& path, WallTime modifiedSince) 228 227 { 229 gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::ClearMediaCache(remoteEngineIdentifier, path, modifiedSince), 0);228 gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::ClearMediaCache(remoteEngineIdentifier, path, modifiedSince), 0); 230 229 } 231 230 … … 236 235 }); 237 236 238 gpuProcessConnection(). send(Messages::RemoteMediaPlayerManagerProxy::ClearMediaCacheForOrigins(remoteEngineIdentifier, path, originData), 0);237 gpuProcessConnection().connection().send(Messages::RemoteMediaPlayerManagerProxy::ClearMediaCacheForOrigins(remoteEngineIdentifier, path, originData), 0); 239 238 } 240 239 … … 334 333 } 335 334 336 IPC::Connection& RemoteMediaPlayerManager::gpuProcessConnection() const 337 { 338 return WebProcess::singleton().ensureGPUProcessConnection().connection(); 335 GPUProcessConnection& RemoteMediaPlayerManager::gpuProcessConnection() const 336 { 337 if (!m_gpuProcessConnection) 338 m_gpuProcessConnection = &WebProcess::singleton().ensureGPUProcessConnection(); 339 340 return *m_gpuProcessConnection; 339 341 } 340 342 -
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h
r254098 r254392 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #if ENABLE(GPU_PROCESS) 29 29 30 #include "GPUProcessConnection.h" 30 31 #include "MediaPlayerPrivateRemoteIdentifier.h" 31 32 #include "MessageReceiver.h" … … 55 56 56 57 static const char* supplementName(); 58 WebProcess& parentProcess() const { return m_process; } 57 59 58 60 void updatePreferences(const WebCore::Settings&); 59 61 60 IPC::Connection& gpuProcessConnection() const;62 GPUProcessConnection& gpuProcessConnection() const; 61 63 62 64 void didReceiveMessageFromGPUProcess(IPC::Connection& connection, IPC::Decoder& decoder) { didReceiveMessage(connection, decoder); } … … 102 104 HashMap<MediaPlayerPrivateRemoteIdentifier, WeakPtr<MediaPlayerPrivateRemote>> m_players; 103 105 WebProcess& m_process; 106 mutable GPUProcessConnection* m_gpuProcessConnection { nullptr }; 104 107 }; 105 108 -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r254347 r254392 1 1 /* 2 * Copyright (C) 2009-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2009-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1300 1300 1301 1301 m_gpuProcessConnection = GPUProcessConnection::create(connectionInfo.releaseIdentifier()); 1302 #if HAVE(AUDIT_TOKEN) 1303 ASSERT(connectionInfo.auditToken); 1304 m_gpuProcessConnection->setAuditToken(WTFMove(connectionInfo.auditToken)); 1305 #endif 1302 1306 } 1303 1307
Note: See TracChangeset
for help on using the changeset viewer.