Title: [123240] trunk/Tools
Revision
123240
Author
[email protected]
Date
2012-07-20 11:13:17 -0700 (Fri, 20 Jul 2012)

Log Message

[chromium] Don't include WebCore headers in TestInterfaces so it's safe to include from outside of WebCore
https://bugs.webkit.org/show_bug.cgi?id=91847

Reviewed by Adam Barth.

This allows for including the TestIntefaces.h from content shell
without introducing a dependency to WebCore/wtf

* DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp:
(TestInterfaces::Internal):
(TestInterfaces::Internal::Internal):
(TestInterfaces::Internal::~Internal):
(TestInterfaces::Internal::bindTo):
(TestInterfaces::Internal::resetAll):
(TestInterfaces::TestInterfaces):
(TestInterfaces::~TestInterfaces):
(TestInterfaces::bindTo):
(TestInterfaces::resetAll):
* DumpRenderTree/chromium/TestRunner/TestInterfaces.h:
(TestInterfaces):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (123239 => 123240)


--- trunk/Tools/ChangeLog	2012-07-20 18:11:10 UTC (rev 123239)
+++ trunk/Tools/ChangeLog	2012-07-20 18:13:17 UTC (rev 123240)
@@ -1,3 +1,26 @@
+2012-07-20  Jochen Eisinger  <[email protected]>
+
+        [chromium] Don't include WebCore headers in TestInterfaces so it's safe to include from outside of WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=91847
+
+        Reviewed by Adam Barth.
+
+        This allows for including the TestIntefaces.h from content shell
+        without introducing a dependency to WebCore/wtf
+
+        * DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp:
+        (TestInterfaces::Internal):
+        (TestInterfaces::Internal::Internal):
+        (TestInterfaces::Internal::~Internal):
+        (TestInterfaces::Internal::bindTo):
+        (TestInterfaces::Internal::resetAll):
+        (TestInterfaces::TestInterfaces):
+        (TestInterfaces::~TestInterfaces):
+        (TestInterfaces::bindTo):
+        (TestInterfaces::resetAll):
+        * DumpRenderTree/chromium/TestRunner/TestInterfaces.h:
+        (TestInterfaces):
+
 2012-07-20  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         [Qt] Make WTR use the same color palette as DRT

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp (123239 => 123240)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp	2012-07-20 18:11:10 UTC (rev 123239)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp	2012-07-20 18:13:17 UTC (rev 123240)
@@ -34,24 +34,58 @@
 #include "GamepadController.h"
 #include "platform/WebString.h"
 
+#include <wtf/OwnPtr.h>
+
 using WebKit::WebFrame;
 using WebKit::WebString;
 
-TestInterfaces::TestInterfaces()
+class TestInterfaces::Internal {
+public:
+    Internal();
+    ~Internal();
+
+    void bindTo(WebFrame*);
+    void resetAll();
+
+private:
+    OwnPtr<GamepadController> m_gamepadController;
+};
+
+TestInterfaces::Internal::Internal()
 {
     m_gamepadController = adoptPtr(new GamepadController());
 }
 
+TestInterfaces::Internal::~Internal()
+{
+}
+
+void TestInterfaces::Internal::bindTo(WebFrame* frame)
+{
+    m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+}
+
+void TestInterfaces::Internal::resetAll()
+{
+    m_gamepadController->reset();
+}
+
+TestInterfaces::TestInterfaces()
+    : m_internal(new TestInterfaces::Internal())
+{
+}
+
 TestInterfaces::~TestInterfaces()
 {
+    delete m_internal;
 }
 
 void TestInterfaces::bindTo(WebFrame* frame)
 {
-    m_gamepadController->bindToJavascript(frame, WebString::fromUTF8("gamepadController"));
+    m_internal->bindTo(frame);
 }
 
 void TestInterfaces::resetAll()
 {
-    m_gamepadController->reset();
+    m_internal->resetAll();
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h (123239 => 123240)


--- trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h	2012-07-20 18:11:10 UTC (rev 123239)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/TestInterfaces.h	2012-07-20 18:13:17 UTC (rev 123240)
@@ -31,14 +31,10 @@
 #ifndef TestInterfaces_h
 #define TestInterfaces_h
 
-#include <wtf/OwnPtr.h>
-
 namespace WebKit {
 class WebFrame;
 }
 
-class GamepadController;
-
 class TestInterfaces {
 public:
     TestInterfaces();
@@ -48,7 +44,8 @@
     void resetAll();
 
 private:
-    OwnPtr<GamepadController> m_gamepadController;
+    class Internal;
+    Internal* m_internal;
 };
 
 #endif // TestInterfaces_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to