Title: [129001] trunk/Source/WebCore
Revision
129001
Author
[email protected]
Date
2012-09-19 07:11:48 -0700 (Wed, 19 Sep 2012)

Log Message

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

Patch by Jonathan Dong <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129000 => 129001)


--- trunk/Source/WebCore/ChangeLog	2012-09-19 14:09:03 UTC (rev 129000)
+++ trunk/Source/WebCore/ChangeLog	2012-09-19 14:11:48 UTC (rev 129001)
@@ -1,3 +1,27 @@
+2012-09-19  Jonathan Dong  <[email protected]>
+
+        [BlackBerry] remove static_cast which will cause video crash
+        https://bugs.webkit.org/show_bug.cgi?id=97070
+
+        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):
+
 2012-09-19  Rick Byers  <[email protected]>
 
         Do touch adjustment on GestureTapDown

Modified: trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp (129000 => 129001)


--- trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp	2012-09-19 14:09:03 UTC (rev 129000)
+++ trunk/Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp	2012-09-19 14:11:48 UTC (rev 129001)
@@ -921,12 +921,7 @@
         return false;
 
     float fullScreenMultiplier = determineFullScreenMultiplier(mediaElement);
-    float loaded = 0;
-    // FIXME: replace loaded with commented out one when buffer bug is fixed (see comment in
-    // MediaPlayerPrivateMMrenderer::percentLoaded).
-    // loaded = mediaElement->percentLoaded();
-    if (mediaElement->player() && mediaElement->player()->implementation())
-        loaded = static_cast<MediaPlayerPrivate *>(mediaElement->player()->implementation())->percentLoaded();
+    float loaded = mediaElement->percentLoaded();
     float position = mediaElement->duration() > 0 ? (mediaElement->currentTime() / mediaElement->duration()) : 0;
 
     int x = ceil(rect.x() + 2 * fullScreenMultiplier - fullScreenMultiplier / 2);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to