Changeset 293707 in webkit
- Timestamp:
- May 2, 2022, 6:32:11 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r293697 r293707 1 2022-05-02 Gabriel Nava Marino <gnavamarino@apple.com> 2 3 Crash in WebKit::ModelElementController::modelElementCreateRemotePreview 4 https://bugs.webkit.org/show_bug.cgi?id=239985 5 6 Reviewed by Dean Jackson. 7 8 Add a check before using m_modelElementController, as it's not guaranteed 9 to be initialized in the constructor, and can be invalidated in WebPageProxy::resetState. 10 11 Test: fast/html/model-element-controller-crash.html 12 13 * UIProcess/WebPageProxy.cpp: 14 (WebKit::WebPageProxy::modelElementGetCamera): 15 (WebKit::WebPageProxy::modelElementSetCamera): 16 (WebKit::WebPageProxy::modelElementIsPlayingAnimation): 17 (WebKit::WebPageProxy::modelElementSetAnimationIsPlaying): 18 (WebKit::WebPageProxy::modelElementIsLoopingAnimation): 19 (WebKit::WebPageProxy::modelElementSetIsLoopingAnimation): 20 (WebKit::WebPageProxy::modelElementAnimationDuration): 21 (WebKit::WebPageProxy::modelElementAnimationCurrentTime): 22 (WebKit::WebPageProxy::modelElementSetAnimationCurrentTime): 23 (WebKit::WebPageProxy::modelElementHasAudio): 24 (WebKit::WebPageProxy::modelElementIsMuted): 25 (WebKit::WebPageProxy::modelElementSetIsMuted): 26 (WebKit::WebPageProxy::takeModelElementFullscreen): 27 (WebKit::WebPageProxy::modelElementSetInteractionEnabled): 28 (WebKit::WebPageProxy::modelElementCreateRemotePreview): 29 (WebKit::WebPageProxy::modelElementLoadRemotePreview): 30 (WebKit::WebPageProxy::modelElementDestroyRemotePreview): 31 (WebKit::WebPageProxy::modelElementSizeDidChange): 32 (WebKit::WebPageProxy::handleMouseDownForModelElement): 33 (WebKit::WebPageProxy::handleMouseMoveForModelElement): 34 (WebKit::WebPageProxy::handleMouseUpForModelElement): 35 (WebKit::WebPageProxy::modelInlinePreviewUUIDs): 36 1 37 2022-05-02 Alex Christensen <achristensen@webkit.org> 2 38 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r293681 r293707 11114 11114 void WebPageProxy::modelElementGetCamera(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<WebCore::HTMLModelElementCamera, ResourceError>)>&& completionHandler) 11115 11115 { 11116 modelElementController()->getCameraForModelElement(modelIdentifier, WTFMove(completionHandler)); 11116 if (m_modelElementController) 11117 m_modelElementController->getCameraForModelElement(modelIdentifier, WTFMove(completionHandler)); 11117 11118 } 11118 11119 11119 11120 void WebPageProxy::modelElementSetCamera(ModelIdentifier modelIdentifier, WebCore::HTMLModelElementCamera camera, CompletionHandler<void(bool)>&& completionHandler) 11120 11121 { 11121 modelElementController()->setCameraForModelElement(modelIdentifier, camera, WTFMove(completionHandler)); 11122 if (m_modelElementController) 11123 m_modelElementController->setCameraForModelElement(modelIdentifier, camera, WTFMove(completionHandler)); 11122 11124 } 11123 11125 11124 11126 void WebPageProxy::modelElementIsPlayingAnimation(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<bool, ResourceError>)>&& completionHandler) 11125 11127 { 11126 modelElementController()->isPlayingAnimationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11128 if (m_modelElementController) 11129 m_modelElementController->isPlayingAnimationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11127 11130 } 11128 11131 11129 11132 void WebPageProxy::modelElementSetAnimationIsPlaying(ModelIdentifier modelIdentifier, bool isPlaying, CompletionHandler<void(bool)>&& completionHandler) 11130 11133 { 11131 modelElementController()->setAnimationIsPlayingForModelElement(modelIdentifier, isPlaying, WTFMove(completionHandler)); 11134 if (m_modelElementController) 11135 m_modelElementController->setAnimationIsPlayingForModelElement(modelIdentifier, isPlaying, WTFMove(completionHandler)); 11132 11136 } 11133 11137 11134 11138 void WebPageProxy::modelElementIsLoopingAnimation(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<bool, ResourceError>)>&& completionHandler) 11135 11139 { 11136 modelElementController()->isLoopingAnimationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11140 if (m_modelElementController) 11141 m_modelElementController->isLoopingAnimationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11137 11142 } 11138 11143 11139 11144 void WebPageProxy::modelElementSetIsLoopingAnimation(ModelIdentifier modelIdentifier, bool isLooping, CompletionHandler<void(bool)>&& completionHandler) 11140 11145 { 11141 modelElementController()->setIsLoopingAnimationForModelElement(modelIdentifier, isLooping, WTFMove(completionHandler)); 11146 if (m_modelElementController) 11147 m_modelElementController->setIsLoopingAnimationForModelElement(modelIdentifier, isLooping, WTFMove(completionHandler)); 11142 11148 } 11143 11149 11144 11150 void WebPageProxy::modelElementAnimationDuration(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<Seconds, WebCore::ResourceError>)>&& completionHandler) 11145 11151 { 11146 modelElementController()->animationDurationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11152 if (m_modelElementController) 11153 m_modelElementController->animationDurationForModelElement(modelIdentifier, WTFMove(completionHandler)); 11147 11154 } 11148 11155 11149 11156 void WebPageProxy::modelElementAnimationCurrentTime(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<Seconds, WebCore::ResourceError>)>&& completionHandler) 11150 11157 { 11151 modelElementController()->animationCurrentTimeForModelElement(modelIdentifier, WTFMove(completionHandler)); 11158 if (m_modelElementController) 11159 m_modelElementController->animationCurrentTimeForModelElement(modelIdentifier, WTFMove(completionHandler)); 11152 11160 } 11153 11161 11154 11162 void WebPageProxy::modelElementSetAnimationCurrentTime(ModelIdentifier modelIdentifier, Seconds currentTime, CompletionHandler<void(bool)>&& completionHandler) 11155 11163 { 11156 modelElementController()->setAnimationCurrentTimeForModelElement(modelIdentifier, currentTime, WTFMove(completionHandler)); 11164 if (m_modelElementController) 11165 m_modelElementController->setAnimationCurrentTimeForModelElement(modelIdentifier, currentTime, WTFMove(completionHandler)); 11157 11166 } 11158 11167 11159 11168 void WebPageProxy::modelElementHasAudio(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<bool, ResourceError>)>&& completionHandler) 11160 11169 { 11161 modelElementController()->hasAudioForModelElement(modelIdentifier, WTFMove(completionHandler)); 11170 if (m_modelElementController) 11171 m_modelElementController->hasAudioForModelElement(modelIdentifier, WTFMove(completionHandler)); 11162 11172 } 11163 11173 11164 11174 void WebPageProxy::modelElementIsMuted(ModelIdentifier modelIdentifier, CompletionHandler<void(Expected<bool, ResourceError>)>&& completionHandler) 11165 11175 { 11166 modelElementController()->isMutedForModelElement(modelIdentifier, WTFMove(completionHandler)); 11176 if (m_modelElementController) 11177 m_modelElementController->isMutedForModelElement(modelIdentifier, WTFMove(completionHandler)); 11167 11178 } 11168 11179 11169 11180 void WebPageProxy::modelElementSetIsMuted(ModelIdentifier modelIdentifier, bool isMuted, CompletionHandler<void(bool)>&& completionHandler) 11170 11181 { 11171 modelElementController()->setIsMutedForModelElement(modelIdentifier, isMuted, WTFMove(completionHandler)); 11182 if (m_modelElementController) 11183 m_modelElementController->setIsMutedForModelElement(modelIdentifier, isMuted, WTFMove(completionHandler)); 11172 11184 } 11173 11185 #endif … … 11176 11188 void WebPageProxy::takeModelElementFullscreen(ModelIdentifier modelIdentifier) 11177 11189 { 11178 modelElementController()->takeModelElementFullscreen(modelIdentifier, URL { currentURL() }); 11190 if (m_modelElementController) 11191 m_modelElementController->takeModelElementFullscreen(modelIdentifier, URL { currentURL() }); 11179 11192 } 11180 11193 11181 11194 void WebPageProxy::modelElementSetInteractionEnabled(ModelIdentifier modelIdentifier, bool isInteractionEnabled) 11182 11195 { 11183 modelElementController()->setInteractionEnabledForModelElement(modelIdentifier, isInteractionEnabled); 11196 if (m_modelElementController) 11197 m_modelElementController->setInteractionEnabledForModelElement(modelIdentifier, isInteractionEnabled); 11184 11198 } 11185 11199 … … 11199 11213 void WebPageProxy::modelElementCreateRemotePreview(const String& uuid, const FloatSize& size, CompletionHandler<void(Expected<std::pair<String, uint32_t>, ResourceError>)>&& completionHandler) 11200 11214 { 11201 modelElementController()->modelElementCreateRemotePreview(uuid, size, WTFMove(completionHandler)); 11215 if (m_modelElementController) 11216 m_modelElementController->modelElementCreateRemotePreview(uuid, size, WTFMove(completionHandler)); 11202 11217 } 11203 11218 11204 11219 void WebPageProxy::modelElementLoadRemotePreview(const String& uuid, const URL& url, CompletionHandler<void(std::optional<WebCore::ResourceError>&&)>&& completionHandler) 11205 11220 { 11206 modelElementController()->modelElementLoadRemotePreview(uuid, url, WTFMove(completionHandler)); 11221 if (m_modelElementController) 11222 m_modelElementController->modelElementLoadRemotePreview(uuid, url, WTFMove(completionHandler)); 11207 11223 } 11208 11224 11209 11225 void WebPageProxy::modelElementDestroyRemotePreview(const String& uuid) 11210 11226 { 11211 modelElementController()->modelElementDestroyRemotePreview(uuid); 11227 if (m_modelElementController) 11228 m_modelElementController->modelElementDestroyRemotePreview(uuid); 11212 11229 } 11213 11230 11214 11231 void WebPageProxy::modelElementSizeDidChange(const String& uuid, WebCore::FloatSize size, CompletionHandler<void(Expected<MachSendRight, WebCore::ResourceError>)>&& completionHandler) 11215 11232 { 11216 modelElementController()->modelElementSizeDidChange(uuid, size, WTFMove(completionHandler)); 11233 if (m_modelElementController) 11234 m_modelElementController->modelElementSizeDidChange(uuid, size, WTFMove(completionHandler)); 11217 11235 } 11218 11236 11219 11237 void WebPageProxy::handleMouseDownForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11220 11238 { 11221 modelElementController()->handleMouseDownForModelElement(uuid, flippedLocationInElement, timestamp); 11239 if (m_modelElementController) 11240 m_modelElementController->handleMouseDownForModelElement(uuid, flippedLocationInElement, timestamp); 11222 11241 } 11223 11242 11224 11243 void WebPageProxy::handleMouseMoveForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11225 11244 { 11226 modelElementController()->handleMouseMoveForModelElement(uuid, flippedLocationInElement, timestamp); 11245 if (m_modelElementController) 11246 m_modelElementController->handleMouseMoveForModelElement(uuid, flippedLocationInElement, timestamp); 11227 11247 } 11228 11248 11229 11249 void WebPageProxy::handleMouseUpForModelElement(const String& uuid, const WebCore::LayoutPoint& flippedLocationInElement, MonotonicTime timestamp) 11230 11250 { 11231 modelElementController()->handleMouseUpForModelElement(uuid, flippedLocationInElement, timestamp); 11251 if (m_modelElementController) 11252 m_modelElementController->handleMouseUpForModelElement(uuid, flippedLocationInElement, timestamp); 11232 11253 } 11233 11254 11234 11255 void WebPageProxy::modelInlinePreviewUUIDs(CompletionHandler<void(Vector<String>&&)>&& completionHandler) 11235 11256 { 11236 modelElementController()->inlinePreviewUUIDs(WTFMove(completionHandler)); 11257 if (m_modelElementController) 11258 m_modelElementController->inlinePreviewUUIDs(WTFMove(completionHandler)); 11237 11259 } 11238 11260 #endif
Note:
See TracChangeset
for help on using the changeset viewer.