Changeset 129001 in webkit


Ignore:
Timestamp:
Sep 19, 2012 7:11:48 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] remove static_cast which will cause video crash
https://bugs.webkit.org/show_bug.cgi?id=97070

Patch by Jonathan Dong <Jonathan Dong> on 2012-09-19
Reviewed by Antonio Gomes.

Removed the static_cast to avoid layering violation which
will cause a runtime crash.
We won't create a real MediaPlayerPrivate object before we call
MediaPlayer::load(), so if we use player()->implementation()
before calling load() in some cases, it points to a
NullMediaPlayerPrivate object. Here we should not use static_cast,
instead we should use HTMLMediaElement::percentLoaded() to
avoid layering violation as we don't have the buffering bug which
the deleted comment refers to.

Internally reviewed by Max Feil.

Test case: media/video-size.html

  • platform/blackberry/RenderThemeBlackBerry.cpp:

(WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128999 r129001  
     12012-09-19  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
     2
     3        [BlackBerry] remove static_cast which will cause video crash
     4        https://bugs.webkit.org/show_bug.cgi?id=97070
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Removed the static_cast to avoid layering violation which
     9        will cause a runtime crash.
     10        We won't create a real MediaPlayerPrivate object before we call
     11        MediaPlayer::load(), so if we use player()->implementation()
     12        before calling load() in some cases, it points to a
     13        NullMediaPlayerPrivate object. Here we should not use static_cast,
     14        instead we should use HTMLMediaElement::percentLoaded() to
     15        avoid layering violation as we don't have the buffering bug which
     16        the deleted comment refers to.
     17
     18        Internally reviewed by Max Feil.
     19
     20        Test case: media/video-size.html
     21
     22        * platform/blackberry/RenderThemeBlackBerry.cpp:
     23        (WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):
     24
    1252012-09-19  Rick Byers  <rbyers@chromium.org>
    226
  • trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp

    r126968 r129001  
    922922
    923923    float fullScreenMultiplier = determineFullScreenMultiplier(mediaElement);
    924     float loaded = 0;
    925     // FIXME: replace loaded with commented out one when buffer bug is fixed (see comment in
    926     // MediaPlayerPrivateMMrenderer::percentLoaded).
    927     // loaded = mediaElement->percentLoaded();
    928     if (mediaElement->player() && mediaElement->player()->implementation())
    929         loaded = static_cast<MediaPlayerPrivate *>(mediaElement->player()->implementation())->percentLoaded();
     924    float loaded = mediaElement->percentLoaded();
    930925    float position = mediaElement->duration() > 0 ? (mediaElement->currentTime() / mediaElement->duration()) : 0;
    931926
Note: See TracChangeset for help on using the changeset viewer.