Changeset 267599 in webkit
- Timestamp:
- Sep 25, 2020, 3:09:29 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
WebProcess/cocoa/VideoFullscreenManager.h (modified) (2 diffs)
-
WebProcess/cocoa/VideoFullscreenManager.messages.in (modified) (1 diff)
-
WebProcess/cocoa/VideoFullscreenManager.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r267597 r267599 1 2020-09-25 Peng Liu <peng.liu6@apple.com> 2 3 Replace the usages of (IPC::Attachment fencePort) with IPC::MachPort 4 https://bugs.webkit.org/show_bug.cgi?id=207683 5 6 Reviewed by Daniel Bates. 7 8 No new tests, no functional change. 9 10 * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: 11 (WebKit::VideoFullscreenManagerProxy::setVideoLayerFrame): Replace the 12 IPC::Attachment argument with a MachSendRight. 13 * WebProcess/cocoa/VideoFullscreenManager.h: 14 * WebProcess/cocoa/VideoFullscreenManager.messages.in: 15 * WebProcess/cocoa/VideoFullscreenManager.mm: 16 (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced): 17 r232451 adds a check for mach port disposition, which is not necessary now. 18 Because ArgumentCoder<MachSendRight>::decode() provides the check. 19 20 * UIProcess/WebPageProxy.cpp: 21 (WebKit::WebPageProxy::setTopContentInset): Replace the IPC::Attachment 22 argument with a MachSendRight. 23 * WebProcess/WebPage/WebPage.cpp: 24 (WebKit::WebPage::setTopContentInsetFenced): Ditto. 25 r232451 adds a check for mach port disposition, which is not necessary now. 26 Because ArgumentCoder<MachSendRight>::decode() provides the check. 27 * WebProcess/WebPage/WebPage.h: 28 * WebProcess/WebPage/WebPage.messages.in: 29 1 30 2020-09-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 31 -
trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
r267053 r267599 789 789 void VideoFullscreenManagerProxy::setVideoLayerFrame(PlaybackSessionContextIdentifier contextId, WebCore::FloatRect frame) 790 790 { 791 @autoreleasepool { 792 #if PLATFORM(IOS_FAMILY) 793 mach_port_name_t fencePort = [UIWindow _synchronizeDrawingAcrossProcesses]; 794 #else 795 MachSendRight fenceSendRight; 796 if (DrawingAreaProxy* drawingArea = m_page->drawingArea()) 797 fenceSendRight = drawingArea->createFence(); 798 mach_port_name_t fencePort = fenceSendRight.leakSendRight(); 799 #endif 800 801 m_page->send(Messages::VideoFullscreenManager::SetVideoLayerFrameFenced(contextId, frame, IPC::Attachment(fencePort, MACH_MSG_TYPE_MOVE_SEND))); 802 } 791 #if PLATFORM(IOS_FAMILY) 792 auto fenceSendRight = MachSendRight::adopt([UIWindow _synchronizeDrawingAcrossProcesses]); 793 #else 794 MachSendRight fenceSendRight; 795 if (DrawingAreaProxy* drawingArea = m_page->drawingArea()) 796 fenceSendRight = drawingArea->createFence(); 797 #endif 798 799 m_page->send(Messages::VideoFullscreenManager::SetVideoLayerFrameFenced(contextId, frame, fenceSendRight)); 803 800 } 804 801 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r267516 r267599 1822 1822 return; 1823 1823 #if PLATFORM(COCOA) 1824 MachSendRight fence = m_drawingArea->createFence(); 1825 1826 auto fenceAttachment = IPC::Attachment(fence.leakSendRight(), MACH_MSG_TYPE_MOVE_SEND); 1827 send(Messages::WebPage::SetTopContentInsetFenced(contentInset, fenceAttachment)); 1824 send(Messages::WebPage::SetTopContentInsetFenced(contentInset, m_drawingArea->createFence())); 1828 1825 #else 1829 1826 send(Messages::WebPage::SetTopContentInset(contentInset)); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r267516 r267599 3174 3174 3175 3175 #if PLATFORM(COCOA) 3176 void WebPage::setTopContentInsetFenced(float contentInset, IPC::Attachment fencePort) 3177 { 3178 if (fencePort.disposition() != MACH_MSG_TYPE_MOVE_SEND) { 3179 LOG(Layers, "WebPage::setTopContentInsetFenced(%g, fencePort) Received an invalid fence port: %d, disposition: %d", contentInset, fencePort.port(), fencePort.disposition()); 3180 return; 3181 } 3182 3183 m_drawingArea->addFence(MachSendRight::create(fencePort.port())); 3184 3176 void WebPage::setTopContentInsetFenced(float contentInset, const WTF::MachSendRight& machSendRight) 3177 { 3178 m_drawingArea->addFence(machSendRight); 3185 3179 setTopContentInset(contentInset); 3186 3187 deallocateSendRightSafely(fencePort.port());3188 3180 } 3189 3181 #endif -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r266829 r267599 1532 1532 1533 1533 #if PLATFORM(COCOA) 1534 void setTopContentInsetFenced(float, IPC::Attachment);1534 void setTopContentInsetFenced(float, const WTF::MachSendRight&); 1535 1535 #endif 1536 1536 void setTopContentInset(float); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r266654 r267599 35 35 36 36 #if PLATFORM(COCOA) 37 SetTopContentInsetFenced(float contentInset, IPC::Attachment fencePort)37 SetTopContentInsetFenced(float contentInset, MachSendRight machSendRight) 38 38 #endif 39 39 SetTopContentInset(float contentInset) -
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.h
r266728 r267599 41 41 42 42 namespace IPC { 43 class Attachment;44 43 class Connection; 45 44 class Decoder; 46 45 class MessageReceiver; 46 } 47 48 namespace WTF { 49 class MachSendRight; 47 50 } 48 51 … … 152 155 void didEnterFullscreen(PlaybackSessionContextIdentifier, Optional<WebCore::FloatSize>); 153 156 void didCleanupFullscreen(PlaybackSessionContextIdentifier); 154 void setVideoLayerFrameFenced(PlaybackSessionContextIdentifier, WebCore::FloatRect bounds, IPC::Attachment fencePort);157 void setVideoLayerFrameFenced(PlaybackSessionContextIdentifier, WebCore::FloatRect bounds, const WTF::MachSendRight&); 155 158 void setVideoLayerGravityEnum(PlaybackSessionContextIdentifier, unsigned gravity); 156 159 void fullscreenModeChanged(PlaybackSessionContextIdentifier, WebCore::HTMLMediaElementEnums::VideoFullscreenMode); -
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.messages.in
r266728 r267599 32 32 DidEnterFullscreen(WebKit::PlaybackSessionContextIdentifier contextId, Optional<WebCore::FloatSize> size) 33 33 DidCleanupFullscreen(WebKit::PlaybackSessionContextIdentifier contextId) 34 SetVideoLayerFrameFenced(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)34 SetVideoLayerFrameFenced(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::FloatRect bounds, MachSendRight machSendRight) 35 35 SetVideoLayerGravityEnum(WebKit::PlaybackSessionContextIdentifier contextId, unsigned gravity) 36 36 FullscreenModeChanged(WebKit::PlaybackSessionContextIdentifier contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode) -
trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm
r266728 r267599 544 544 } 545 545 546 void VideoFullscreenManager::setVideoLayerFrameFenced(PlaybackSessionContextIdentifier contextId, WebCore::FloatRect bounds, IPC::Attachment fencePort)546 void VideoFullscreenManager::setVideoLayerFrameFenced(PlaybackSessionContextIdentifier contextId, WebCore::FloatRect bounds, const WTF::MachSendRight& machSendRight) 547 547 { 548 548 LOG(Fullscreen, "VideoFullscreenManager::setVideoLayerFrameFenced(%p, %x)", this, contextId); 549 550 if (fencePort.disposition() != MACH_MSG_TYPE_MOVE_SEND) {551 LOG(Fullscreen, "VideoFullscreenManager::setVideoLayerFrameFenced(%p, %x) Received an invalid fence port: %d, disposition: %d", this, contextId, fencePort.port(), fencePort.disposition());552 return;553 }554 549 555 550 auto [model, interface] = ensureModelAndInterface(contextId); … … 561 556 562 557 if (auto* context = interface->layerHostingContext()) 563 context->setFencePort( fencePort.port());558 context->setFencePort(machSendRight.sendRight()); 564 559 model->setVideoLayerFrame(bounds); 565 deallocateSendRightSafely(fencePort.port());566 560 } 567 561
Note:
See TracChangeset
for help on using the changeset viewer.