⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242844 in webkit


Ignore:
Timestamp:
Mar 13, 2019, 12:05:36 AM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r242378. rdar://problem/48591282

Cherry-pick r242378. rdar://problem/48591281

Check contextIDs when handling WebContent messages
https://bugs.webkit.org/show_bug.cgi?id=195289
<rdar://problem/48475870>

Reviewed by Alex Christensen.

The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.

This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.

  • UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID): (WebKit::PlaybackSessionManagerProxy::currentTimeChanged): (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged): (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged): (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged): (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged): (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged): (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged): (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged): (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged): (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged): (WebKit::PlaybackSessionManagerProxy::mutedChanged): (WebKit::PlaybackSessionManagerProxy::volumeChanged): (WebKit::PlaybackSessionManagerProxy::durationChanged): (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged): (WebKit::PlaybackSessionManagerProxy::rateChanged): (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged): (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged): (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
  • UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): (WebKit::UserMediaCaptureManagerProxy::end): (WebKit::UserMediaCaptureManagerProxy::capabilities): (WebKit::UserMediaCaptureManagerProxy::setMuted): (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
  • UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): (WebKit::VideoFullscreenManagerProxy::setHasVideo): (WebKit::VideoFullscreenManagerProxy::setVideoDimensions): (WebKit::VideoFullscreenManagerProxy::enterFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreen): (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): (WebKit::VideoFullscreenManagerProxy::setInlineRect): (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer): (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen): (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline): (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
  • UIProcess/ios/EditableImageController.mm: (WebKit::EditableImageController::didCreateEditableImage): (WebKit::EditableImageController::didDestroyEditableImage): (WebKit::EditableImageController::associateWithAttachment):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

git-svn-id: https://svn.webkit.org/repository/webkit/branches/safari-607.1.40.0-branch@242501 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Source/WebKit/ChangeLog

    r242843 r242844  
     12019-03-12  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r242501. rdar://problem/48591282
     4
     5    Cherry-pick r242378. rdar://problem/48591281
     6   
     7        Check contextIDs when handling WebContent messages
     8        https://bugs.webkit.org/show_bug.cgi?id=195289
     9        <rdar://problem/48475870>
     10   
     11        Reviewed by Alex Christensen.
     12   
     13        The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
     14        We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
     15   
     16        This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
     17   
     18        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
     19        (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
     20        (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
     21        (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
     22        (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
     23        (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
     24        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
     25        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
     26        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
     27        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
     28        (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
     29        (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
     30        (WebKit::PlaybackSessionManagerProxy::mutedChanged):
     31        (WebKit::PlaybackSessionManagerProxy::volumeChanged):
     32        (WebKit::PlaybackSessionManagerProxy::durationChanged):
     33        (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
     34        (WebKit::PlaybackSessionManagerProxy::rateChanged):
     35        (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
     36        (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
     37        (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
     38        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
     39        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
     40        (WebKit::UserMediaCaptureManagerProxy::startProducingData):
     41        (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
     42        (WebKit::UserMediaCaptureManagerProxy::end):
     43        (WebKit::UserMediaCaptureManagerProxy::capabilities):
     44        (WebKit::UserMediaCaptureManagerProxy::setMuted):
     45        (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
     46        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
     47        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
     48        (WebKit::VideoFullscreenManagerProxy::setHasVideo):
     49        (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
     50        (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
     51        (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
     52        (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
     53        (WebKit::VideoFullscreenManagerProxy::setInlineRect):
     54        (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
     55        (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
     56        (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
     57        (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
     58        * UIProcess/ios/EditableImageController.mm:
     59        (WebKit::EditableImageController::didCreateEditableImage):
     60        (WebKit::EditableImageController::didDestroyEditableImage):
     61        (WebKit::EditableImageController::associateWithAttachment):
     62   
     63        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     64   
     65    git-svn-id: https://svn.webkit.org/repository/webkit/branches/safari-607.1.40.0-branch@242501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     66
     67    2019-03-05  Kocsen Chung  <kocsen_chung@apple.com>
     68
     69            Cherry-pick r242378. rdar://problem/48591281
     70
     71        Check contextIDs when handling WebContent messages
     72        https://bugs.webkit.org/show_bug.cgi?id=195289
     73        <rdar://problem/48475870>
     74
     75        Reviewed by Alex Christensen.
     76
     77        The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
     78        We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
     79
     80        This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
     81
     82        * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
     83        (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
     84        (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
     85        (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
     86        (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
     87        (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
     88        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
     89        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
     90        (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
     91        (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
     92        (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
     93        (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
     94        (WebKit::PlaybackSessionManagerProxy::mutedChanged):
     95        (WebKit::PlaybackSessionManagerProxy::volumeChanged):
     96        (WebKit::PlaybackSessionManagerProxy::durationChanged):
     97        (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
     98        (WebKit::PlaybackSessionManagerProxy::rateChanged):
     99        (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
     100        (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
     101        (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
     102        * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
     103        (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
     104        (WebKit::UserMediaCaptureManagerProxy::startProducingData):
     105        (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
     106        (WebKit::UserMediaCaptureManagerProxy::end):
     107        (WebKit::UserMediaCaptureManagerProxy::capabilities):
     108        (WebKit::UserMediaCaptureManagerProxy::setMuted):
     109        (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
     110        * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
     111        (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
     112        (WebKit::VideoFullscreenManagerProxy::setHasVideo):
     113        (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
     114        (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
     115        (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
     116        (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
     117        (WebKit::VideoFullscreenManagerProxy::setInlineRect):
     118        (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
     119        (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
     120        (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
     121        (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
     122        * UIProcess/ios/EditableImageController.mm:
     123        (WebKit::EditableImageController::didCreateEditableImage):
     124        (WebKit::EditableImageController::didDestroyEditableImage):
     125        (WebKit::EditableImageController::associateWithAttachment):
     126
     127        git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     128
     129        2019-03-04  Brent Fulgham  <bfulgham@apple.com>
     130
     131                Check contextIDs when handling WebContent messages
     132                https://bugs.webkit.org/show_bug.cgi?id=195289
     133                <rdar://problem/48475870>
     134
     135                Reviewed by Alex Christensen.
     136
     137                The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
     138                We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
     139
     140                This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
     141
     142                * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
     143                (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
     144                (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
     145                (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
     146                (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
     147                (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
     148                (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
     149                (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
     150                (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
     151                (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
     152                (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
     153                (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
     154                (WebKit::PlaybackSessionManagerProxy::mutedChanged):
     155                (WebKit::PlaybackSessionManagerProxy::volumeChanged):
     156                (WebKit::PlaybackSessionManagerProxy::durationChanged):
     157                (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
     158                (WebKit::PlaybackSessionManagerProxy::rateChanged):
     159                (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
     160                (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
     161                (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
     162                * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
     163                (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
     164                (WebKit::UserMediaCaptureManagerProxy::startProducingData):
     165                (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
     166                (WebKit::UserMediaCaptureManagerProxy::end):
     167                (WebKit::UserMediaCaptureManagerProxy::capabilities):
     168                (WebKit::UserMediaCaptureManagerProxy::setMuted):
     169                (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
     170                * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
     171                (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
     172                (WebKit::VideoFullscreenManagerProxy::setHasVideo):
     173                (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
     174                (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
     175                (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
     176                (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
     177                (WebKit::VideoFullscreenManagerProxy::setInlineRect):
     178                (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
     179                (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
     180                (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
     181                (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
     182                * UIProcess/ios/EditableImageController.mm:
     183                (WebKit::EditableImageController::didCreateEditableImage):
     184                (WebKit::EditableImageController::didDestroyEditableImage):
     185                (WebKit::EditableImageController::associateWithAttachment):
     186
    11872019-03-12  Kocsen Chung  <kocsen_chung@apple.com>
    2188
  • branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm

    r239535 r242844  
    3434#import "WebProcessProxy.h"
    3535
     36#define MESSAGE_CHECK_CONTEXTID(contextID) MESSAGE_CHECK_BASE(m_contextMap.isValidKey(contextId), m_page->process().connection())
     37
    3638namespace WebKit {
    3739using namespace WebCore;
     
    372374void PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID(uint64_t contextId)
    373375{
     376    MESSAGE_CHECK_CONTEXTID(contextID);
    374377    if (m_controlsManagerContextId == contextId)
    375378        return;
     
    397400void PlaybackSessionManagerProxy::currentTimeChanged(uint64_t contextId, double currentTime, double hostTime)
    398401{
     402    MESSAGE_CHECK_CONTEXTID(contextID);
    399403    ensureModel(contextId).currentTimeChanged(currentTime);
    400404}
     
    402406void PlaybackSessionManagerProxy::bufferedTimeChanged(uint64_t contextId, double bufferedTime)
    403407{
     408    MESSAGE_CHECK_CONTEXTID(contextID);
    404409    ensureModel(contextId).bufferedTimeChanged(bufferedTime);
    405410}
     
    407412void PlaybackSessionManagerProxy::seekableRangesVectorChanged(uint64_t contextId, Vector<std::pair<double, double>> ranges, double lastModifiedTime, double liveUpdateInterval)
    408413{
     414    MESSAGE_CHECK_CONTEXTID(contextID);
    409415    Ref<TimeRanges> timeRanges = TimeRanges::create();
    410416    for (const auto& range : ranges) {
     
    420426void PlaybackSessionManagerProxy::canPlayFastReverseChanged(uint64_t contextId, bool value)
    421427{
     428    MESSAGE_CHECK_CONTEXTID(contextID);
    422429    ensureModel(contextId).canPlayFastReverseChanged(value);
    423430}
     
    425432void PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
    426433{
     434    MESSAGE_CHECK_CONTEXTID(contextID);
    427435    ensureModel(contextId).audioMediaSelectionOptionsChanged(options, selectedIndex);
    428436}
     
    430438void PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged(uint64_t contextId, Vector<MediaSelectionOption> options, uint64_t selectedIndex)
    431439{
     440    MESSAGE_CHECK_CONTEXTID(contextID);
    432441    ensureModel(contextId).legibleMediaSelectionOptionsChanged(options, selectedIndex);
    433442}
     
    435444void PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
    436445{
     446    MESSAGE_CHECK_CONTEXTID(contextID);
    437447    ensureModel(contextId).audioMediaSelectionIndexChanged(selectedIndex);
    438448}
     
    440450void PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged(uint64_t contextId, uint64_t selectedIndex)
    441451{
     452    MESSAGE_CHECK_CONTEXTID(contextID);
    442453    ensureModel(contextId).legibleMediaSelectionIndexChanged(selectedIndex);
    443454}
     
    445456void PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged(uint64_t contextId, bool enabled, uint32_t targetType, String localizedDeviceName)
    446457{
     458    MESSAGE_CHECK_CONTEXTID(contextID);
    447459    PlaybackSessionModel::ExternalPlaybackTargetType type = static_cast<PlaybackSessionModel::ExternalPlaybackTargetType>(targetType);
    448460    ASSERT(type == PlaybackSessionModel::TargetTypeAirPlay || type == PlaybackSessionModel::TargetTypeTVOut || type == PlaybackSessionModel::TargetTypeNone);
     
    453465void PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged(uint64_t contextId, bool disabled)
    454466{
     467    MESSAGE_CHECK_CONTEXTID(contextID);
    455468    ensureModel(contextId).wirelessVideoPlaybackDisabledChanged(disabled);
    456469}
     
    458471void PlaybackSessionManagerProxy::mutedChanged(uint64_t contextId, bool muted)
    459472{
     473    MESSAGE_CHECK_CONTEXTID(contextID);
    460474    ensureModel(contextId).mutedChanged(muted);
    461475}
     
    463477void PlaybackSessionManagerProxy::volumeChanged(uint64_t contextId, double volume)
    464478{
     479    MESSAGE_CHECK_CONTEXTID(contextID);
    465480    ensureModel(contextId).volumeChanged(volume);
    466481}
     
    468483void PlaybackSessionManagerProxy::durationChanged(uint64_t contextId, double duration)
    469484{
     485    MESSAGE_CHECK_CONTEXTID(contextID);
    470486    ensureModel(contextId).durationChanged(duration);
    471487}
     
    473489void PlaybackSessionManagerProxy::playbackStartedTimeChanged(uint64_t contextId, double playbackStartedTime)
    474490{
     491    MESSAGE_CHECK_CONTEXTID(contextID);
    475492    ensureModel(contextId).playbackStartedTimeChanged(playbackStartedTime);
    476493}
     
    478495void PlaybackSessionManagerProxy::rateChanged(uint64_t contextId, bool isPlaying, double rate)
    479496{
     497    MESSAGE_CHECK_CONTEXTID(contextID);
    480498    ensureModel(contextId).rateChanged(isPlaying, rate);
    481499}
     
    483501void PlaybackSessionManagerProxy::pictureInPictureSupportedChanged(uint64_t contextId, bool supported)
    484502{
     503    MESSAGE_CHECK_CONTEXTID(contextID);
    485504    ensureModel(contextId).pictureInPictureSupportedChanged(supported);
    486505}
     
    488507void PlaybackSessionManagerProxy::pictureInPictureActiveChanged(uint64_t contextId, bool active)
    489508{
     509    MESSAGE_CHECK_CONTEXTID(contextID);
    490510    ensureModel(contextId).pictureInPictureActiveChanged(active);
    491511}
     
    493513void PlaybackSessionManagerProxy::handleControlledElementIDResponse(uint64_t contextId, String identifier) const
    494514{
     515    MESSAGE_CHECK_CONTEXTID(contextID);
    495516#if PLATFORM(MAC)
    496517    if (contextId == m_controlsManagerContextId)
     
    608629} // namespace WebKit
    609630
     631#undef MESSAGE_CHECK_CONTEXTID
     632
    610633#endif // PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
  • branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp

    r239163 r242844  
    4040#include <wtf/UniqueRef.h>
    4141
     42#define MESSAGE_CHECK_CONTEXTID(id) MESSAGE_CHECK_BASE(m_proxies.isValidKey(id), m_process.connection())
     43
    4244namespace WebKit {
    4345using namespace WebCore;
     
    140142void UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints(uint64_t id, const CaptureDevice& device, String&& hashSalt, const MediaConstraints& constraints, bool& succeeded, String& invalidConstraints, WebCore::RealtimeMediaSourceSettings& settings)
    141143{
     144    MESSAGE_CHECK_CONTEXTID(id);
     145
    142146    CaptureSourceOrError sourceOrError;
    143147    switch (device.type()) {
     
    171175void UserMediaCaptureManagerProxy::startProducingData(uint64_t id)
    172176{
     177    MESSAGE_CHECK_CONTEXTID(id);
    173178    auto iter = m_proxies.find(id);
    174179    if (iter != m_proxies.end())
     
    178183void UserMediaCaptureManagerProxy::stopProducingData(uint64_t id)
    179184{
     185    MESSAGE_CHECK_CONTEXTID(id);
    180186    auto iter = m_proxies.find(id);
    181187    if (iter != m_proxies.end())
     
    185191void UserMediaCaptureManagerProxy::capabilities(uint64_t id, WebCore::RealtimeMediaSourceCapabilities& capabilities)
    186192{
     193    MESSAGE_CHECK_CONTEXTID(id);
    187194    auto iter = m_proxies.find(id);
    188195    if (iter != m_proxies.end())
     
    192199void UserMediaCaptureManagerProxy::setMuted(uint64_t id, bool muted)
    193200{
     201    MESSAGE_CHECK_CONTEXTID(id);
    194202    auto iter = m_proxies.find(id);
    195203    if (iter != m_proxies.end())
     
    199207void UserMediaCaptureManagerProxy::applyConstraints(uint64_t id, const WebCore::MediaConstraints& constraints)
    200208{
     209    MESSAGE_CHECK_CONTEXTID(id);
    201210    auto iter = m_proxies.find(id);
    202211    if (iter == m_proxies.end())
     
    213222}
    214223
     224#undef MESSAGE_CHECK_CONTEXTID
     225
    215226#endif
  • branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm

    r239535 r242844  
    122122#endif
    123123
     124#define MESSAGE_CHECK_CONTEXTID(contextID) MESSAGE_CHECK_BASE(m_contextMap.isValidKey(contextId), m_page->process().connection())
     125
    124126namespace WebKit {
    125127using namespace WebCore;
     
    469471void VideoFullscreenManagerProxy::setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect& initialRect, float hostingDeviceScaleFactor, HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode, bool allowsPictureInPicture, bool standby)
    470472{
     473    MESSAGE_CHECK_CONTEXTID(contextId);
     474
    471475    ASSERT(videoLayerID);
    472476    RefPtr<VideoFullscreenModelContext> model;
     
    505509void VideoFullscreenManagerProxy::setHasVideo(uint64_t contextId, bool hasVideo)
    506510{
     511    MESSAGE_CHECK_CONTEXTID(contextId);
    507512    ensureInterface(contextId).hasVideoChanged(hasVideo);
    508513}
     
    510515void VideoFullscreenManagerProxy::setVideoDimensions(uint64_t contextId, const FloatSize& videoDimensions)
    511516{
     517    MESSAGE_CHECK_CONTEXTID(contextId);
    512518    ensureInterface(contextId).videoDimensionsChanged(videoDimensions);
    513519}
     
    515521void VideoFullscreenManagerProxy::enterFullscreen(uint64_t contextId)
    516522{
     523    MESSAGE_CHECK_CONTEXTID(contextId);
     524
    517525    auto& interface = ensureInterface(contextId);
    518526    interface.enterFullscreen();
     
    532540void VideoFullscreenManagerProxy::exitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
    533541{
     542    MESSAGE_CHECK_CONTEXTID(contextId);
     543
    534544#if PLATFORM(IOS_FAMILY)
    535545    ensureInterface(contextId).exitFullscreen(finalRect);
     
    544554void VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode(uint64_t contextId, WebCore::HTMLMediaElementEnums::VideoFullscreenMode targetMode)
    545555{
     556    MESSAGE_CHECK_CONTEXTID(contextId);
    546557    ensureInterface(contextId).exitFullscreenWithoutAnimationToMode(targetMode);
    547558}
     
    552563void VideoFullscreenManagerProxy::setInlineRect(uint64_t contextId, const WebCore::IntRect& inlineRect, bool visible)
    553564{
     565    MESSAGE_CHECK_CONTEXTID(contextId);
    554566    ensureInterface(contextId).setInlineRect(inlineRect, visible);
    555567}
     
    557569void VideoFullscreenManagerProxy::setHasVideoContentLayer(uint64_t contextId, bool value)
    558570{
     571    MESSAGE_CHECK_CONTEXTID(contextId);
    559572    ensureInterface(contextId).setHasVideoContentLayer(value);
    560573}
     
    576589void VideoFullscreenManagerProxy::cleanupFullscreen(uint64_t contextId)
    577590{
     591    MESSAGE_CHECK_CONTEXTID(contextId);
    578592    ensureInterface(contextId).cleanupFullscreen();
    579593}
     
    581595void VideoFullscreenManagerProxy::preparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
    582596{
     597    MESSAGE_CHECK_CONTEXTID(contextId);
    583598    m_page->fullscreenMayReturnToInline();
    584599
     
    594609void VideoFullscreenManagerProxy::preparedToExitFullscreen(uint64_t contextId)
    595610{
     611    MESSAGE_CHECK_CONTEXTID(contextId);
    596612    ensureInterface(contextId).preparedToExitFullscreen();
    597613}
     
    694710} // namespace WebKit
    695711
     712#undef MESSAGE_CHECK_CONTEXTID
     713
    696714#endif // PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
  • branches/safari-607-branch/Source/WebKit/UIProcess/ios/EditableImageController.mm

    r239628 r242844  
    3939#import <wtf/RetainPtr.h>
    4040
     41#define MESSAGE_CHECK_VIEWID(embeddedViewID) MESSAGE_CHECK_BASE(m_editableImages.isValidKey(embeddedViewID), connection())
     42
    4143namespace WebKit {
    4244
     
    7476void EditableImageController::didCreateEditableImage(WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID)
    7577{
     78    MESSAGE_CHECK_VIEWID(embeddedViewID);
    7679    ensureEditableImage(embeddedViewID);
    7780}
     
    7982void EditableImageController::didDestroyEditableImage(WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID)
    8083{
     84    MESSAGE_CHECK_VIEWID(embeddedViewID);
    8185    m_editableImages.remove(embeddedViewID);
    8286}
     
    8488void EditableImageController::associateWithAttachment(WebCore::GraphicsLayer::EmbeddedViewID embeddedViewID, const String& attachmentID)
    8589{
     90    MESSAGE_CHECK_VIEWID(embeddedViewID);
    8691    if (!m_webPageProxy)
    8792        return;
     
    151156} // namespace WebKit
    152157
     158#undef MESSAGE_CHECK_VIEWID
     159
    153160#endif // HAVE(PENCILKIT)
Note: See TracChangeset for help on using the changeset viewer.