Changeset 174475 in webkit


Ignore:
Timestamp:
Oct 8, 2014, 1:26:41 PM (11 years ago)
Author:
jer.noble@apple.com
Message:

Unreviewed follow-up fix for r174460. Do not register for KVOs if the object does not respond to the requested property.

  • platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:

(-[CDMSessionMediaSourceAVFObjCObserver beginObserving:]):
(-[CDMSessionMediaSourceAVFObjCObserver stopObserving:]):
(-[CDMSessionMediaSourceAVFObjCObserver invalidate]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r174469 r174475  
     12014-10-08  Jer Noble  <jer.noble@apple.com>
     2
     3        Unreviewed follow-up fix for r174460. Do not register for KVOs if the object does not respond to the requested property.
     4
     5        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
     6        (-[CDMSessionMediaSourceAVFObjCObserver beginObserving:]):
     7        (-[CDMSessionMediaSourceAVFObjCObserver stopObserving:]):
     8        (-[CDMSessionMediaSourceAVFObjCObserver invalidate]):
     9
    1102014-10-08  Dean Jackson  <dino@apple.com>
    211
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm

    r174460 r174475  
    8888    ASSERT(!m_parsers.contains(parser));
    8989    m_parsers.add(parser);
    90     [parser addObserver:self forKeyPath:@"sessionIdentifier" options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionInitial) context:nullptr];
     90    if ([parser respondsToSelector:@selector(sessionIdentifier)])
     91        [parser addObserver:self forKeyPath:@"sessionIdentifier" options:(NSKeyValueObservingOptionNew|NSKeyValueObservingOptionInitial) context:nullptr];
    9192}
    9293
     
    9596    ASSERT(m_parsers.contains(parser));
    9697    m_parsers.remove(parser);
    97     [parser removeObserver:self forKeyPath:@"sessionIdentifier" context:nullptr];
     98    if ([parser respondsToSelector:@selector(sessionIdentifier)])
     99        [parser removeObserver:self forKeyPath:@"sessionIdentifier" context:nullptr];
    98100}
    99101
     
    101103{
    102104    m_parent = nullptr;
    103     for (auto& parser : m_parsers)
    104         [parser removeObserver:self forKeyPath:@"sessionIdentifier" context:nullptr];
     105    for (auto& parser : m_parsers) {
     106        if ([parser respondsToSelector:@selector(sessionIdentifier)])
     107            [parser removeObserver:self forKeyPath:@"sessionIdentifier" context:nullptr];
     108    }
    105109    m_parsers.clear();
    106110}
Note: See TracChangeset for help on using the changeset viewer.