Reviewed by Sam.
authorkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 21:26:48 +0000 (21:26 +0000)
committerkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 21:26:48 +0000 (21:26 +0000)
        - Implemented server calls now the WebScriptDebugServer exists.
        - Also removed no longer needed call to initialize CG.

        * Drosera/win/Drosera.cpp: No longer initializes CG because this happens
        automatically now.
        (_tWinMain):
        * Drosera/win/ServerConnection.cpp: Now uses the COM class.
        (ServerConnection::ServerConnection):
        (ServerConnection::~ServerConnection):
        (ServerConnection::pause):
        (ServerConnection::resume):
        (ServerConnection::stepInto):
        (ServerConnection::applicationTerminating):
        (ServerConnection::serverConnectionDidDie):
        * Drosera/win/ServerConnection.h: Now uses the COM class.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Drosera/win/Drosera.cpp
WebKitTools/Drosera/win/ServerConnection.cpp
WebKitTools/Drosera/win/ServerConnection.h

index 96d28f16df39fd079724dcef7fdad3af47ca1125..09085c273bfe8f2534efe36a79542d44ec2c6fa7 100644 (file)
@@ -1,3 +1,23 @@
+2007-10-25  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Sam.
+
+        - Implemented server calls now the WebScriptDebugServer exists.
+        - Also removed no longer needed call to initialize CG.
+
+        * Drosera/win/Drosera.cpp: No longer initializes CG because this happens
+        automatically now.
+        (_tWinMain):
+        * Drosera/win/ServerConnection.cpp: Now uses the COM class.
+        (ServerConnection::ServerConnection):
+        (ServerConnection::~ServerConnection):
+        (ServerConnection::pause):
+        (ServerConnection::resume):
+        (ServerConnection::stepInto):
+        (ServerConnection::applicationTerminating):
+        (ServerConnection::serverConnectionDidDie):
+        * Drosera/win/ServerConnection.h: Now uses the COM class.
+
 2007-10-24  George Staikos  <staikos@kde.org>
 
         Unbreak Qt build.
index 5406b3beed42856b2a40eab3e13e72c272313ed3..eb67cb345bda49829059a185d978ddb6cd4c3b68 100644 (file)
@@ -50,8 +50,6 @@ static const LRESULT kNotHandledResult = -1;
 static LPCTSTR kDroseraPointerProp = TEXT("DroseraPointer");
 static HINSTANCE hInst;
 
-extern "C" BOOL InitializeCoreGraphics();
-
 ATOM registerDroseraClass(HINSTANCE hInstance);
 LRESULT CALLBACK droseraWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
 INT_PTR CALLBACK aboutWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
@@ -70,8 +68,6 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
 
     MSG msg;
 
-    InitializeCoreGraphics();
-
     Drosera drosera;
 
     HRESULT ret = drosera.init(hInstance, nCmdShow);
index 5527f04b0672f04a0958328d461783192074d0a7..5a7242f2df3993eea6d2f340cf0f0e8966299985 100644 (file)
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <JavaScriptCore/JSStringRefCF.h>
 #include <JavaScriptCore/RetainPtr.h>
+#include <WebKit/WebKit.h>
 
 // FIXME: Some of the below functionality cannot be implemented until the WebScriptDebug Server works on windows.
 ServerConnection::ServerConnection()
     : m_globalContext(0)
 {
+    HRESULT serverCreated = CoCreateInstance(CLSID_WebScriptDebugServer, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&m_server);
+    if (!FAILED(serverCreated))
+        m_server->addListener(this);
 }
 
 ServerConnection::~ServerConnection()
 {
+    if (m_server)
+        m_server->removeListener(this);
+
     if (m_globalContext)
         JSGlobalContextRelease(m_globalContext);
 }
@@ -56,24 +63,34 @@ void ServerConnection::setGlobalContext(JSGlobalContextRef globalContextRef)
 
 void ServerConnection::pause()
 {
+    if (m_server)
+        m_server->pause();
 }
 
 void ServerConnection::resume()
 {
+    if (m_server)
+        m_server->resume();
 }
 
 void ServerConnection::stepInto()
 {
+    if (m_server)
+        m_server->step();
 }
 
 // Connection Handling
 
 void ServerConnection::applicationTerminating()
 {
+    if (m_server)
+        m_server->removeListener(this);
 }
 
 void ServerConnection::serverConnectionDidDie()
 {
+    if (m_server)
+        m_server->removeListener(this);
 }
 
 // Stack & Variables
index 703a6d72b41ed80b602e2e7529bbeaae624abfcd..2beea4a22ca1e1ca789f3740d4ea00f04517f65e 100644 (file)
 #define ServerConnection_H
 
 #include <string>
+#include <WebCore/COMPtr.h>
 #include <WebKit/IWebScriptDebugListener.h>
+#include <WebKit/IWebScriptDebugServer.h>
 
 class DebuggerClient;
 class WebScriptCallFrame;
-class WebScriptDebugServer;
 
 typedef struct OpaqueJSContext* JSGlobalContextRef;
 
@@ -113,10 +114,8 @@ public:
 private:
     std::wstring m_currentServerName;
 
-    // FIXME: Change these to OwnPtrs when they are implmented such that they
-    // can be destroyed on Windows.
     WebScriptCallFrame* m_currentFrame;
-    WebScriptDebugServer* m_server;
+    COMPtr<IWebScriptDebugServer> m_server;
     JSGlobalContextRef m_globalContext;
 };