Title: [119661] trunk
Revision
119661
Author
[email protected]
Date
2012-06-06 18:36:12 -0700 (Wed, 06 Jun 2012)

Log Message

Source/WebKit/chromium: [Chromium] DeviceOrientation cleanup
https://bugs.webkit.org/show_bug.cgi?id=88406

Patch by Amy Ousterhout <[email protected]> on 2012-06-06
Reviewed by Kent Tamura.

Made default constructor public and added a set function for each property.
This will allow us to remove the 8-parameter constructor.

* public/WebDeviceOrientation.h:
(WebKit::WebDeviceOrientation::WebDeviceOrientation):
(WebKit::WebDeviceOrientation::setNull):
(WebKit::WebDeviceOrientation::setAlpha):
(WebKit::WebDeviceOrientation::setBeta):
(WebKit::WebDeviceOrientation::setGamma):
(WebKit::WebDeviceOrientation::setAbsolute):
(WebDeviceOrientation):

Tools: [WebKit] DeviceOrientation cleanup
https://bugs.webkit.org/show_bug.cgi?id=88406

Patch by Amy Ousterhout <[email protected]> on 2012-06-06
Reviewed by Kent Tamura.

Updated LayoutTestController to use new public default constructor in WebDeviceOrientation.h.

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::setMockDeviceOrientation):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (119660 => 119661)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-07 01:35:59 UTC (rev 119660)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-07 01:36:12 UTC (rev 119661)
@@ -1,3 +1,22 @@
+2012-06-06  Amy Ousterhout  <[email protected]>
+
+        [Chromium] DeviceOrientation cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=88406
+
+        Reviewed by Kent Tamura.
+
+        Made default constructor public and added a set function for each property.
+        This will allow us to remove the 8-parameter constructor.
+
+        * public/WebDeviceOrientation.h:
+        (WebKit::WebDeviceOrientation::WebDeviceOrientation):
+        (WebKit::WebDeviceOrientation::setNull):
+        (WebKit::WebDeviceOrientation::setAlpha):
+        (WebKit::WebDeviceOrientation::setBeta):
+        (WebKit::WebDeviceOrientation::setGamma):
+        (WebKit::WebDeviceOrientation::setAbsolute):
+        (WebDeviceOrientation):
+
 2012-06-06  James Robinson  <[email protected]>
 
         [chromium] Move implementation of WebCore::GraphicsContext3D and related from WebKit/chromium/src to WebCore/platform/chromium/support

Modified: trunk/Source/WebKit/chromium/public/WebDeviceOrientation.h (119660 => 119661)


--- trunk/Source/WebKit/chromium/public/WebDeviceOrientation.h	2012-06-07 01:35:59 UTC (rev 119660)
+++ trunk/Source/WebKit/chromium/public/WebDeviceOrientation.h	2012-06-07 01:36:12 UTC (rev 119661)
@@ -35,28 +35,66 @@
 
 class WebDeviceOrientation {
 public:
+    // FIXME: Remove once Chromium is updated.
     WebDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma, bool canProvideAbsolute = false, bool absolute = false)
-        : m_isNull(false),
-          m_canProvideAlpha(canProvideAlpha),
-          m_alpha(alpha),
-          m_canProvideBeta(canProvideBeta),
-          m_beta(beta),
-          m_canProvideGamma(canProvideGamma),
-          m_gamma(gamma),
-          m_canProvideAbsolute(canProvideAbsolute),
-          m_absolute(absolute)
+        : m_isNull(false)
+        , m_canProvideAlpha(canProvideAlpha)
+        , m_alpha(alpha)
+        , m_canProvideBeta(canProvideBeta)
+        , m_beta(beta)
+        , m_canProvideGamma(canProvideGamma)
+        , m_gamma(gamma)
+        , m_canProvideAbsolute(canProvideAbsolute)
+        , m_absolute(absolute)
     {
     }
+    WebDeviceOrientation()
+        : m_isNull(true)
+        , m_canProvideAlpha(false)
+        , m_alpha(0)
+        , m_canProvideBeta(false)
+        , m_beta(0)
+        , m_canProvideGamma(false)
+        , m_gamma(0)
+        , m_canProvideAbsolute(false)
+        , m_absolute(false)
+    {
+    }
 
     static WebDeviceOrientation nullOrientation() { return WebDeviceOrientation(); }
 
+    void setNull(bool isNull) { m_isNull = isNull; }
     bool isNull() { return m_isNull; }
+
+    void setAlpha(double alpha)
+    {
+        m_canProvideAlpha = true;
+        m_alpha = alpha;
+    }
     bool canProvideAlpha() { return m_canProvideAlpha; }
     double alpha() { return m_alpha; }
+
+    void setBeta(double beta)
+    {
+        m_canProvideBeta = true;
+        m_beta = beta;
+    }
     bool canProvideBeta() { return m_canProvideBeta; }
     double beta() { return m_beta; }
+
+    void setGamma(double gamma)
+    {
+        m_canProvideGamma = true;
+        m_gamma = gamma;
+    }
     bool canProvideGamma() { return m_canProvideGamma; }
     double gamma() { return m_gamma; }
+
+    void setAbsolute(bool absolute)
+    {
+        m_canProvideAbsolute = true;
+        m_absolute = absolute;
+    }
     bool canProvideAbsolute() {return m_canProvideAbsolute; }
     bool absolute() { return m_absolute; }
 
@@ -67,19 +105,6 @@
 #endif
 
 private:
-    WebDeviceOrientation()
-        : m_isNull(true),
-          m_canProvideAlpha(false),
-          m_alpha(0),
-          m_canProvideBeta(false),
-          m_beta(0),
-          m_canProvideGamma(false),
-          m_gamma(0),
-          m_canProvideAbsolute(false),
-          m_absolute(false)
-    {
-    }
-
     bool m_isNull;
     bool m_canProvideAlpha;
     double m_alpha;

Modified: trunk/Tools/ChangeLog (119660 => 119661)


--- trunk/Tools/ChangeLog	2012-06-07 01:35:59 UTC (rev 119660)
+++ trunk/Tools/ChangeLog	2012-06-07 01:36:12 UTC (rev 119661)
@@ -1,3 +1,15 @@
+2012-06-06  Amy Ousterhout  <[email protected]>
+
+        [WebKit] DeviceOrientation cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=88406
+
+        Reviewed by Kent Tamura.
+
+        Updated LayoutTestController to use new public default constructor in WebDeviceOrientation.h.
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::setMockDeviceOrientation):
+
 2012-05-29  Dirk Pranke  <[email protected]>
 
         webkitpy: add support for an ordered dict of test expectations

Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (119660 => 119661)


--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2012-06-07 01:35:59 UTC (rev 119660)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2012-06-07 01:36:12 UTC (rev 119661)
@@ -1874,7 +1874,15 @@
     if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber())
         return;
 
-    WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
+    WebDeviceOrientation orientation;
+    orientation.setNull(false);
+    if (arguments[0].toBoolean())
+        orientation.setAlpha(arguments[1].toDouble());
+    if (arguments[2].toBoolean())
+        orientation.setBeta(arguments[3].toDouble());
+    if (arguments[4].toBoolean())
+        orientation.setGamma(arguments[5].toDouble());
+
     // Note that we only call setOrientation on the main page's mock since this is all that the
     // tests require. If necessary, we could get a list of WebViewHosts from the TestShell and
     // call setOrientation on each DeviceOrientationClientMock.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to