Changeset 66652 in webkit


Ignore:
Timestamp:
Sep 2, 2010 2:32:05 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-09-02 Jer Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

WebKit should not accept PDFs as video.
https://bugs.webkit.org/show_bug.cgi?id=45013

The code in MediaPlayerPrivate::createQTMovie has been re-arranged.
First, the component disabling is done only once. In 64-bit QTKit will
store the list of disabled components and disable them once QTKitServer
starts, so there is no need to disable them repeatedly. However,
because of a bug in 64-bit QTKit, additional requests of the exact same
component description will be ignored if QTKitServer is not yet running.
To work around this, we must provide the exact component flags for each
eat/PDF and grip/PDF component we wish to disable.

  • platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::disableComponentsOnce): Added. (WebCore::MediaPlayerPrivate::createQTMovie): Moved the component

disabling code into disableComponentsOnce.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66651 r66652  
     12010-09-02  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKit should not accept PDFs as video.
     6        https://bugs.webkit.org/show_bug.cgi?id=45013
     7
     8        The code in MediaPlayerPrivate::createQTMovie has been re-arranged.
     9        First, the component disabling is done only once. In 64-bit QTKit will
     10        store the list of disabled components and disable them once QTKitServer
     11        starts, so there is no need to disable them repeatedly.  However,
     12        because of a bug in 64-bit QTKit, additional requests of the exact same
     13        component description will be ignored if QTKitServer is not yet running.
     14        To work around this, we must provide the exact component flags for each
     15        eat/PDF and grip/PDF component we wish to disable.
     16
     17        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
     18        (WebCore::disableComponentsOnce): Added.
     19        (WebCore::MediaPlayerPrivate::createQTMovie): Moved the component
     20            disabling code into disableComponentsOnce.
     21
    1222010-09-02  Philippe Normand  <pnormand@igalia.com>
    223
  • trunk/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

    r66632 r66652  
    262262}
    263263
    264 void MediaPlayerPrivate::createQTMovie(NSURL *url, NSDictionary *movieAttributes)
    265 {
    266     // We must disable components each time we open a movie because we cannot guarantee
    267     // that the QTKitServer process hasn't disappeared on us.  eat/PDF and grip/PDF
    268     // components must be disabled twice since they are registered twice with different
    269     // flags:
    270     uint32_t componentsToDisable[9][5] = {
     264static void disableComponentsOnce()
     265{
     266    static bool sComponentsDisabled = false;
     267    if (sComponentsDisabled)
     268        return;
     269    sComponentsDisabled = true;
     270
     271    // eat/PDF and grip/PDF components must be disabled twice since they are registered twice
     272    // with different flags.  However, there is currently a bug in 64-bit QTKit (<rdar://problem/8378237>)
     273    // which causes subsequent disable component requests of exactly the same type to be ignored if
     274    // QTKitServer has not yet started.  As a result, we must pass in exactly the flags we want to
     275    // disable per component.  As a failsafe, if in the future these flags change, we will disable the
     276    // PDF components for a third time with a wildcard flags field:
     277    uint32_t componentsToDisable[11][5] = {
    271278        {'eat ', 'TEXT', 'text', 0, 0},
    272279        {'eat ', 'TXT ', 'text', 0, 0},   
    273280        {'eat ', 'utxt', 'text', 0, 0}, 
    274281        {'eat ', 'TEXT', 'tx3g', 0, 0}, 
     282        {'eat ', 'PDF ', 'vide', 0x44802, 0},
     283        {'eat ', 'PDF ', 'vide', 0x45802, 0},
    275284        {'eat ', 'PDF ', 'vide', 0, 0}, 
    276         {'eat ', 'PDF ', 'vide', 0, 0}, 
    277         {'grip', 'PDF ', 'appl', 0, 0}, 
     285        {'grip', 'PDF ', 'appl', 0x844a00, 0},
     286        {'grip', 'PDF ', 'appl', 0x845a00, 0},
    278287        {'grip', 'PDF ', 'appl', 0, 0}, 
    279288        {'imdc', 'pdf ', 'appl', 0, 0}, 
    280289    };
     290
    281291    for (size_t i = 0; i < sizeof(componentsToDisable)/sizeof(componentsToDisable[0]); ++i)
    282          wkQTMovieDisableComponent(componentsToDisable[i]);
     292        wkQTMovieDisableComponent(componentsToDisable[i]);
     293}
     294
     295void MediaPlayerPrivate::createQTMovie(NSURL *url, NSDictionary *movieAttributes)
     296{
     297    disableComponentsOnce();
    283298
    284299    [[NSNotificationCenter defaultCenter] removeObserver:m_objcObserver.get()];
Note: See TracChangeset for help on using the changeset viewer.