Reviewed by Sam.
authorkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 21:45:18 +0000 (21:45 +0000)
committerkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2007 21:45:18 +0000 (21:45 +0000)
        - Use the new IWebFrame [local] function signature and get the shared
        server correctly.

        * Drosera/win/DebuggerClient.cpp:
        (DebuggerClient::didFinishLoadForFrame):
        * Drosera/win/ServerConnection.cpp:
        (ServerConnection::attemptToCreateServerConnection):

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

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

index 2eb016b4acfb4b9b7a8a0003257ea1cef1e1779b..9c8ed38f00b2bc1ac2c503f93fdd12c61fd07022 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-08  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Sam.
+
+        - Use the new IWebFrame [local] function signature and get the shared
+        server correctly.
+
+        * Drosera/win/DebuggerClient.cpp:
+        (DebuggerClient::didFinishLoadForFrame):
+        * Drosera/win/ServerConnection.cpp:
+        (ServerConnection::attemptToCreateServerConnection):
+
 2007-11-07  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
index c4b4910d9d9ac1f4dcd547040beed8165db88205..b3855d08901c166bb83c00912c6fbc8d66a71d38 100644 (file)
@@ -64,13 +64,13 @@ HRESULT STDMETHODCALLTYPE DebuggerClient::QueryInterface(REFIID riid, void** ppv
     return S_OK;
 }
 
-ULONG STDMETHODCALLTYPE DebuggerClient::AddRef(void)
+ULONG STDMETHODCALLTYPE DebuggerClient::AddRef()
 {
     // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView.
     return 1;
 }
 
-ULONG STDMETHODCALLTYPE DebuggerClient::Release(void)
+ULONG STDMETHODCALLTYPE DebuggerClient::Release()
 {
     // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView.
     return 1;
@@ -90,13 +90,13 @@ HRESULT STDMETHODCALLTYPE DebuggerClient::didFinishLoadForFrame(
     if (FAILED(ret))
         return ret;
 
-    JSGlobalContextRef context;
-    ret = mainFrame->globalContext(&context);
-    if (FAILED(ret))
-        return ret;
+    if (!m_globalContext) {
+        JSGlobalContextRef context = mainFrame->globalContext();
+        if (!context)
+            return E_FAIL;
 
-    if (!m_globalContext)
         m_globalContext = JSGlobalContextRetain(context);
+    }
 
     if (serverConnected())
         m_debuggerDocument->server()->setGlobalContext(m_globalContext);
index 8bb06be77851bb3f3524203030f46b515aca14c7..5346acbddc0ae312871c8f66cfeb819da44739b8 100644 (file)
@@ -61,10 +61,16 @@ ServerConnection::~ServerConnection()
 
 void ServerConnection::attemptToCreateServerConnection(JSGlobalContextRef globalContextRef)
 {
-    HRESULT serverCreated = CoCreateInstance(CLSID_WebScriptDebugServer, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&m_server);
-    if (!FAILED(serverCreated)) {
-        m_server->addListener(this);
+    COMPtr<IWebScriptDebugServer> tempServer;
+    if (SUCCEEDED(CoCreateInstance(CLSID_WebScriptDebugServer, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&tempServer))) {
+        if (FAILED(tempServer->sharedWebScriptDebugServer(&m_server)))
+            return;
+
+        if (FAILED(m_server->addListener(this)))
+            return;
+
         m_serverConnected = true;
+
         if (globalContextRef)
             m_globalContext = JSGlobalContextRetain(globalContextRef);
     }