Reviewed by Adam.
[WebKit-https.git] / WebKitTools / Drosera / win / ServerConnection.h
index 703a6d72b41ed80b602e2e7529bbeaae624abfcd..7007c1bb92c79a381203f651e255f10a34a13488 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;
+interface IWebScriptCallFrame;
 
 typedef struct OpaqueJSContext* JSGlobalContextRef;
 
@@ -51,7 +52,8 @@ public:
 
     void applicationTerminating();
     void serverConnectionDidDie();
-    WebScriptCallFrame* currentFrame() const;
+    IWebScriptCallFrame* currentFrame() const;
+    IWebScriptCallFrame* getCallerFrame(int callFrame) const;
 
     // IUnknown
     HRESULT STDMETHODCALLTYPE QueryInterface(
@@ -63,60 +65,59 @@ public:
 
     // IWebScriptDebugListener
     HRESULT STDMETHODCALLTYPE didLoadMainResourceForDataSource(
-        /* [in] */ IWebView* view,
+        /* [in] */ IWebView*,
         /* [in] */ IWebDataSource* dataSource);
 
     HRESULT STDMETHODCALLTYPE didParseSource(
-        /* [in] */ IWebView* view,
+        /* [in] */ IWebView*,
         /* [in] */ BSTR sourceCode,
         /* [in] */ UINT baseLineNumber,
         /* [in] */ BSTR url,
         /* [in] */ int sourceID,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame* webFrame);
 
     HRESULT STDMETHODCALLTYPE failedToParseSource(
-        /* [in] */ IWebView* view,
+        /* [in] */ IWebView*,
         /* [in] */ BSTR sourceCode,
         /* [in] */ UINT baseLineNumber,
         /* [in] */ BSTR url,
         /* [in] */ BSTR error,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame*);
 
     HRESULT STDMETHODCALLTYPE didEnterCallFrame(
-        /* [in] */ IWebView* view,
+        /* [in] */ IWebView*,
         /* [in] */ IWebScriptCallFrame* frame,
         /* [in] */ int sourceID,
         /* [in] */ int lineNumber,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame*);
 
     HRESULT STDMETHODCALLTYPE willExecuteStatement(
-        /* [in] */ IWebView* view,
-        /* [in] */ IWebScriptCallFrame* frame,
+        /* [in] */ IWebView*,
+        /* [in] */ IWebScriptCallFrame*,
         /* [in] */ int sourceID,
         /* [in] */ int lineNumber,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame*);
 
     HRESULT STDMETHODCALLTYPE willLeaveCallFrame(
-        /* [in] */ IWebView* view,
+        /* [in] */ IWebView*,
         /* [in] */ IWebScriptCallFrame* frame,
         /* [in] */ int sourceID,
         /* [in] */ int lineNumber,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame*);
 
     HRESULT STDMETHODCALLTYPE exceptionWasRaised(
-        /* [in] */ IWebView* view,
-        /* [in] */ IWebScriptCallFrame* frame,
+        /* [in] */ IWebView*,
+        /* [in] */ IWebScriptCallFrame*,
         /* [in] */ int sourceID,
         /* [in] */ int lineNumber,
-        /* [in] */ IWebFrame* forWebFrame);
+        /* [in] */ IWebFrame*);
 
 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;
+    // FIXME: make this a COMPtr when the Interface exists and the destructor can be called.
+    IWebScriptCallFrame* m_currentFrame;
+    COMPtr<IWebScriptDebugServer> m_server;
     JSGlobalContextRef m_globalContext;
 };