+2007-10-29 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Adam and Maciej.
+
+ - Added the IWebScriptScope interface which is used by Drosera to get
+ information and run contextually significant code with respect to the
+ current JS stack frame.
+
+ * Interfaces/IWebScriptCallFrame.idl: Line endings changed, not sure why
+ but the real changes were to change the return type of scopeChain() and
+ the return type and name of evaluateWebScript() to
+ stringByEvaluatingJavaScriptFromString().
+ * Interfaces/IWebScriptScope.idl: Added.
+ * WebKit.vcproj/Interfaces.vcproj: Added the new interface.
+ * WebKit.vcproj/WebKit.vcproj: Added the files for the new class.
+ * WebKit.vcproj/WebKitGUID.vcproj: Added the new interfaces.
+ * WebScriptCallFrame.cpp: Changed the return type to E_NOTIMPL and
+ asserted so it would be obvious if I accidentally try to use one of
+ these functions before it's implemented.
+ (WebScriptCallFrame::caller):
+ (WebScriptCallFrame::scopeChain):
+ (WebScriptCallFrame::functionName):
+ (WebScriptCallFrame::stringByEvaluatingJavaScriptFromString):
+ * WebScriptCallFrame.h: Changed the return types mentioned above.
+ * WebScriptDebugServer.cpp: Also changed the return type to E_NOTIMPL.
+ (WebScriptDebugServer::addListener):
+ (WebScriptDebugServer::removeListener):
+ (WebScriptDebugServer::step):
+ (WebScriptDebugServer::pause):
+ (WebScriptDebugServer::resume):
+ (WebScriptDebugServer::isPaused):
+ * WebScriptScope.cpp: Added.
+ (WebScriptScope::WebScriptScope):
+ (WebScriptScope::~WebScriptScope):
+ (WebScriptScope::QueryInterface):
+ (WebScriptScope::AddRef):
+ (WebScriptScope::Release):
+ (WebScriptScope::getVariableNames):
+ (WebScriptScope::getValueForVariable):
+ * WebScriptScope.h: Added.
+
2007-10-28 Darin Adler <darin@apple.com>
- try to fix Windows build
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-cpp_quote("/*")
-cpp_quote(" * Copyright (C) 2007 Apple Inc. All rights reserved.")
-cpp_quote(" *")
-cpp_quote(" * Redistribution and use in source and binary forms, with or without")
-cpp_quote(" * modification, are permitted provided that the following conditions")
-cpp_quote(" * are met:")
-cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
-cpp_quote(" * notice, this list of conditions and the following disclaimer.")
-cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
-cpp_quote(" * notice, this list of conditions and the following disclaimer in the")
-cpp_quote(" * documentation and/or other materials provided with the distribution.")
-cpp_quote(" * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of")
-cpp_quote(" * its contributors may be used to endorse or promote products derived")
-cpp_quote(" * from this software without specific prior written permission.")
-cpp_quote(" *")
-cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
-cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
-cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
-cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
-cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
-cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
-cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
-cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
-cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
-cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
-cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
-cpp_quote(" */")
-
-import "oaidl.idl";
-import "ocidl.idl";
-
-[
- object,
- oleautomation,
- uuid(029D0676-162A-4140-8917-9574E09F66EB),
- pointer_default(unique)
-]
-interface IWebScriptCallFrame : IUnknown
-{
- HRESULT caller([out, retval] IWebScriptCallFrame**);
- HRESULT scopeChain([out, retval] VARIANT*);
- HRESULT functionName([out, retval] BSTR*);
- HRESULT evaluateWebScript([in] BSTR script, [out, retval] VARIANT*);
+/*\r
+ * Copyright (C) 2007 Apple Inc. All rights reserved.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ *\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer. \r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution. \r
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of\r
+ * its contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission. \r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY\r
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\r
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+cpp_quote("/*")\r
+cpp_quote(" * Copyright (C) 2007 Apple Inc. All rights reserved.")\r
+cpp_quote(" *")\r
+cpp_quote(" * Redistribution and use in source and binary forms, with or without")\r
+cpp_quote(" * modification, are permitted provided that the following conditions")\r
+cpp_quote(" * are met:")\r
+cpp_quote(" * 1. Redistributions of source code must retain the above copyright")\r
+cpp_quote(" * notice, this list of conditions and the following disclaimer.")\r
+cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")\r
+cpp_quote(" * notice, this list of conditions and the following disclaimer in the")\r
+cpp_quote(" * documentation and/or other materials provided with the distribution.")\r
+cpp_quote(" * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of")\r
+cpp_quote(" * its contributors may be used to endorse or promote products derived")\r
+cpp_quote(" * from this software without specific prior written permission.")\r
+cpp_quote(" *")\r
+cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")\r
+cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")\r
+cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")\r
+cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR")\r
+cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")\r
+cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")\r
+cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")\r
+cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")\r
+cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")\r
+cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")\r
+cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")\r
+cpp_quote(" */")\r
+\r
+import "oaidl.idl";\r
+import "ocidl.idl";\r
+\r
+[\r
+ object,\r
+ oleautomation,\r
+ uuid(029D0676-162A-4140-8917-9574E09F66EB),\r
+ pointer_default(unique)\r
+]\r
+interface IWebScriptCallFrame : IUnknown\r
+{\r
+ HRESULT caller([out, retval] IWebScriptCallFrame**);\r
+ HRESULT scopeChain([out, retval] IEnumVARIANT**);\r
+ HRESULT functionName([out, retval] BSTR*);\r
+ HRESULT stringByEvaluatingJavaScriptFromString([in] BSTR script, [out, retval] BSTR*);\r
}\r
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+cpp_quote("/*")
+cpp_quote(" * Copyright (C) 2007 Apple Inc. All rights reserved.")
+cpp_quote(" *")
+cpp_quote(" * Redistribution and use in source and binary forms, with or without")
+cpp_quote(" * modification, are permitted provided that the following conditions")
+cpp_quote(" * are met:")
+cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
+cpp_quote(" * notice, this list of conditions and the following disclaimer.")
+cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
+cpp_quote(" * notice, this list of conditions and the following disclaimer in the")
+cpp_quote(" * documentation and/or other materials provided with the distribution.")
+cpp_quote(" * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of")
+cpp_quote(" * its contributors may be used to endorse or promote products derived")
+cpp_quote(" * from this software without specific prior written permission.")
+cpp_quote(" *")
+cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
+cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
+cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
+cpp_quote(" * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
+cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
+cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
+cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
+cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
+cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
+cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
+cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
+cpp_quote(" */")
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+ object,
+ oleautomation,
+ uuid(FF347C48-1966-460c-8EEE-09FCA5F3C708),
+ pointer_default(unique)
+]
+interface IWebScriptScope : IUnknown
+{
+ HRESULT variableNames([out, retval] IEnumVARIANT**);
+ HRESULT valueForVariable([in] BSTR key, [out, retval] BSTR* value);
+}
RelativePath="..\Interfaces\IWebScriptObject.idl"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\Interfaces\IWebScriptScope.idl"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\Interfaces\IWebScrollBarDelegatePrivate.idl"\r
>\r
RelativePath="..\WebScriptObject.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\WebScriptScope.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\WebScrollBar.h"\r
>\r
RelativePath="..\WebScriptObject.cpp"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\WebScriptScope.cpp"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\WebScrollBar.cpp"\r
>\r
RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebScriptObject_i.c"\r
>\r
</File>\r
+ <File\r
+ RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebScriptScope_i.c"\r
+ >\r
+ </File>\r
<File\r
RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebScrollBarDelegatePrivate_i.c"\r
>\r
#include "WebKitDLL.h"
#include "WebScriptCallFrame.h"
+#include <wtf/Assertions.h>
+
// WebScriptCallFrame ------------------------------------------------------------
WebScriptCallFrame::WebScriptCallFrame()
HRESULT STDMETHODCALLTYPE WebScriptCallFrame::caller(
/* [out, retval] */ IWebScriptCallFrame**)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptCallFrame::scopeChain(
- /* [out, retval] */ VARIANT*)
+ /* [out, retval] */ IEnumVARIANT**)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptCallFrame::functionName(
/* [out, retval] */ BSTR*)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
-HRESULT STDMETHODCALLTYPE WebScriptCallFrame::evaluateWebScript(
+HRESULT STDMETHODCALLTYPE WebScriptCallFrame::stringByEvaluatingJavaScriptFromString(
/* [in] */ BSTR,
- /* [out, retval] */ VARIANT*)
+ /* [out, retval] */ BSTR*)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
/* [out, retval] */ IWebScriptCallFrame**);
virtual HRESULT STDMETHODCALLTYPE scopeChain(
- /* [out, retval] */ VARIANT*);
+ /* [out, retval] */ IEnumVARIANT**);
virtual HRESULT STDMETHODCALLTYPE functionName(
/* [out, retval] */ BSTR*);
- virtual HRESULT STDMETHODCALLTYPE evaluateWebScript(
+ virtual HRESULT STDMETHODCALLTYPE stringByEvaluatingJavaScriptFromString(
/* [in] */ BSTR script,
- /* [out, retval] */ VARIANT*);
+ /* [out, retval] */ BSTR*);
private:
ULONG m_refCount;
#include "WebScriptDebugServer.h"
#include "WebView.h"
+#include <wtf/Assertions.h>
#include <wtf/Vector.h>
static Vector<IWebView*> sViews;
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::addListener(
/* [in] */ const IWebScriptDebugListener*)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::removeListener(
/* [in] */ const IWebScriptDebugListener*)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::step()
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::pause()
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::resume()
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE WebScriptDebugServer::isPaused(
/* [out, retval] */ BOOL*)
{
- return S_OK;
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
}
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WebKitDLL.h"
+
+#include "WebScriptScope.h"
+
+#include <wtf/Assertions.h>
+
+// WebScriptScope ------------------------------------------------------------
+
+WebScriptScope::WebScriptScope()
+: m_refCount(0)
+{
+ gClassCount++;
+}
+
+WebScriptScope::~WebScriptScope()
+{
+ gClassCount--;
+}
+
+// IUnknown -------------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebScriptScope::QueryInterface(REFIID riid, void** ppvObject)
+{
+ *ppvObject = 0;
+ if (IsEqualGUID(riid, IID_IUnknown))
+ *ppvObject = static_cast<IWebScriptScope*>(this);
+ else if (IsEqualGUID(riid, IID_IWebScriptScope))
+ *ppvObject = static_cast<IWebScriptScope*>(this);
+ else
+ return E_NOINTERFACE;
+
+ AddRef();
+ return S_OK;
+}
+
+ULONG STDMETHODCALLTYPE WebScriptScope::AddRef(void)
+{
+ return ++m_refCount;
+}
+
+ULONG STDMETHODCALLTYPE WebScriptScope::Release(void)
+{
+ ULONG newRef = --m_refCount;
+ if (!newRef)
+ delete(this);
+
+ return newRef;
+}
+
+// WebScriptScope ------------------------------------------------------------
+
+HRESULT STDMETHODCALLTYPE WebScriptScope::variableNames(
+ /* [out, retval] */ IEnumVARIANT**)
+{
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE WebScriptScope::valueForVariable(
+ /* [in] */ BSTR /*key*/,
+ /* [out, retval] */ BSTR* /*value*/)
+{
+ ASSERT_NOT_REACHED();
+ return E_NOTIMPL;
+}
--- /dev/null
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebScriptScope_H
+#define WebScriptScope_H
+
+#include "IWebScriptScope.h"
+
+class WebScriptScope : public IWebScriptScope {
+public:
+ WebScriptScope();
+ virtual ~WebScriptScope();
+
+ // IUnknown
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef(void);
+ virtual ULONG STDMETHODCALLTYPE Release(void);
+
+ // IWebScriptScope
+ virtual HRESULT STDMETHODCALLTYPE variableNames(
+ /* [out, retval] */ IEnumVARIANT**);
+
+ virtual HRESULT STDMETHODCALLTYPE valueForVariable(
+ /* [in] */ BSTR key,
+ /* [out, retval] */ BSTR* value);
+
+protected:
+ ULONG m_refCount;
+};
+
+#endif