Title: [116657] trunk/Source/WebKit/blackberry
Revision
116657
Author
[email protected]
Date
2012-05-10 10:15:55 -0700 (Thu, 10 May 2012)

Log Message

[BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
https://bugs.webkit.org/show_bug.cgi?id=86096

Reviewed by Rob Buis.
Patch by Antonio Gomes <[email protected]>

A Frame's FrameView has always to be checked since it is
a volatile object, and gets created and destroyed all the time.

We have been facing a particular issue, where during our automated
interaction tests, the main frame object was being pinch zoomed in
the middle of it creation, and WebKit thread was blocked by a mutex.
In practice, it is a case that would not be possible in a real
world scenario, but shows that the ASSERTs are bogus regardless.

* WebKitSupport/BackingStoreClient.cpp:
(BlackBerry::WebKit::BackingStoreClient::scrollPosition):
(BlackBerry::WebKit::BackingStoreClient::setScrollPosition):
(BlackBerry::WebKit::BackingStoreClient::maximumScrollPosition):
(BlackBerry::WebKit::BackingStoreClient::viewportSize):
(BlackBerry::WebKit::BackingStoreClient::transformedViewportSize):
(BlackBerry::WebKit::BackingStoreClient::visibleContentsRect):
(BlackBerry::WebKit::BackingStoreClient::contentsSize):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/ChangeLog (116656 => 116657)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-05-10 16:54:02 UTC (rev 116656)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-05-10 17:15:55 UTC (rev 116657)
@@ -1,3 +1,28 @@
+2012-05-10  Antonio Gomes  <[email protected]>
+
+        [BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
+        https://bugs.webkit.org/show_bug.cgi?id=86096
+
+        Reviewed by Rob Buis.
+
+        A Frame's FrameView has always to be checked since it is
+        a volatile object, and gets created and destroyed all the time.
+
+        We have been facing a particular issue, where during our automated
+        interaction tests, the main frame object was being pinch zoomed in
+        the middle of it creation, and WebKit thread was blocked by a mutex.
+        In practice, it is a case that would not be possible in a real
+        world scenario, but shows that the ASSERTs are bogus regardless.
+
+        * WebKitSupport/BackingStoreClient.cpp:
+        (BlackBerry::WebKit::BackingStoreClient::scrollPosition):
+        (BlackBerry::WebKit::BackingStoreClient::setScrollPosition):
+        (BlackBerry::WebKit::BackingStoreClient::maximumScrollPosition):
+        (BlackBerry::WebKit::BackingStoreClient::viewportSize):
+        (BlackBerry::WebKit::BackingStoreClient::transformedViewportSize):
+        (BlackBerry::WebKit::BackingStoreClient::visibleContentsRect):
+        (BlackBerry::WebKit::BackingStoreClient::contentsSize):
+
 2012-05-09  Jonathan Dong  <[email protected]>
 
         [BlackBerry] Autofill feature implementation for BlackBerry porting

Modified: trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp (116656 => 116657)


--- trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp	2012-05-10 16:54:02 UTC (rev 116656)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp	2012-05-10 17:15:55 UTC (rev 116657)
@@ -168,6 +168,9 @@
 IntPoint BackingStoreClient::scrollPosition() const
 {
     ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntPoint();
+
     return m_frame->view()->scrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
 }
 
@@ -178,7 +181,10 @@
 
 void BackingStoreClient::setScrollPosition(const IntPoint& pos)
 {
-    ASSERT(m_frame->view());
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return;
+
     if (pos == scrollPosition())
         return;
 
@@ -196,7 +202,10 @@
 
 IntPoint BackingStoreClient::maximumScrollPosition() const
 {
-    ASSERT(m_frame->view());
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntPoint();
+
     return m_frame->view()->maximumScrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
 }
 
@@ -220,7 +229,10 @@
 
 IntSize BackingStoreClient::viewportSize() const
 {
-    ASSERT(m_frame->view());
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntSize();
+
     if (isMainFrame())
         return m_webPage->d->viewportSize();
 
@@ -229,10 +241,13 @@
 
 IntSize BackingStoreClient::transformedViewportSize() const
 {
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntSize();
+
     if (isMainFrame())
         return m_webPage->d->transformedViewportSize();
 
-    ASSERT(m_frame->view());
     const IntSize untransformedViewportSize = m_frame->view()->visibleContentRect().size();
     const FloatPoint transformedBottomRight = m_webPage->d->m_transformationMatrix->mapPoint(
         FloatPoint(untransformedViewportSize.width(), untransformedViewportSize.height()));
@@ -241,7 +256,10 @@
 
 IntRect BackingStoreClient::visibleContentsRect() const
 {
-    ASSERT(m_frame->view());
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntRect();
+
     IntRect visibleContentRect = m_frame->view()->visibleContentRect();
     if (isMainFrame())
         return visibleContentRect;
@@ -273,7 +291,10 @@
 
 IntSize BackingStoreClient::contentsSize() const
 {
-    ASSERT(m_frame->view());
+    ASSERT(m_frame);
+    if (!m_frame->view())
+        return IntSize();
+
     return m_frame->view()->contentsSize();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to