Reviewed by Adam.
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2007 23:45:46 +0000 (23:45 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2007 23:45:46 +0000 (23:45 +0000)
        Add an implementation of IWebSecurityOrigin and a partially stubbed out
        implementation of IWebDatabaseManager.

        * ForEachCoClass.h:
        * Interfaces/IWebDatabaseManager.idl:
        * Interfaces/WebKit.idl:
        * WebDatabaseManager.cpp:
        (WebDatabaseManager::createInstance):
        (WebDatabaseManager::WebDatabaseManager):
        (WebDatabaseManager::~WebDatabaseManager):
        (WebDatabaseManager::QueryInterface):
        (WebDatabaseManager::AddRef):
        (WebDatabaseManager::Release):
        (WebDatabaseManager::sharedWebDatabaseManager):
        (WebDatabaseManager::origins):
        (WebDatabaseManager::databasesWithOrigin):
        (WebDatabaseManager::detailsForDatabaseWithOrigin):
        (WebDatabaseManager::deleteAllDatabases):
        (WebDatabaseManager::deleteDatabasesWithOrigin):
        (WebDatabaseManager::deleteDatabaseWithOrigin):
        * WebDatabaseManager.h:
        * WebKit.vcproj/WebKit.vcproj:
        * WebKitClassFactory.cpp:
        * WebSecurityOrigin.cpp: Added.
        (WebSecurityOrigin::createInstance):
        (WebSecurityOrigin::WebSecurityOrigin):
        (WebSecurityOrigin::~WebSecurityOrigin):
        (WebSecurityOrigin::QueryInterface):
        (WebSecurityOrigin::AddRef):
        (WebSecurityOrigin::Release):
        (WebSecurityOrigin::protocol):
        (WebSecurityOrigin::domain):
        (WebSecurityOrigin::port):
        (WebSecurityOrigin::usage):
        (WebSecurityOrigin::quota):
        (WebSecurityOrigin::setQuota):
        * WebSecurityOrigin.h: Added.

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

WebKit/win/ChangeLog
WebKit/win/ForEachCoClass.h
WebKit/win/Interfaces/IWebDatabaseManager.idl
WebKit/win/Interfaces/WebKit.idl
WebKit/win/WebDatabaseManager.cpp
WebKit/win/WebDatabaseManager.h
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/win/WebKitClassFactory.cpp
WebKit/win/WebSecurityOrigin.cpp [new file with mode: 0644]
WebKit/win/WebSecurityOrigin.h [new file with mode: 0644]

index 3f58a82651f3b7c961f3790d1d6f0dbac4f69046..5abadff29cf1a3701a1d0375a429fb7419a4e8c7 100644 (file)
@@ -1,3 +1,45 @@
+2007-11-26  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Adam.
+
+        Add an implementation of IWebSecurityOrigin and a partially stubbed out
+        implementation of IWebDatabaseManager.
+        
+        * ForEachCoClass.h:
+        * Interfaces/IWebDatabaseManager.idl:
+        * Interfaces/WebKit.idl:
+        * WebDatabaseManager.cpp:
+        (WebDatabaseManager::createInstance):
+        (WebDatabaseManager::WebDatabaseManager):
+        (WebDatabaseManager::~WebDatabaseManager):
+        (WebDatabaseManager::QueryInterface):
+        (WebDatabaseManager::AddRef):
+        (WebDatabaseManager::Release):
+        (WebDatabaseManager::sharedWebDatabaseManager):
+        (WebDatabaseManager::origins):
+        (WebDatabaseManager::databasesWithOrigin):
+        (WebDatabaseManager::detailsForDatabaseWithOrigin):
+        (WebDatabaseManager::deleteAllDatabases):
+        (WebDatabaseManager::deleteDatabasesWithOrigin):
+        (WebDatabaseManager::deleteDatabaseWithOrigin):
+        * WebDatabaseManager.h:
+        * WebKit.vcproj/WebKit.vcproj:
+        * WebKitClassFactory.cpp:
+        * WebSecurityOrigin.cpp: Added.
+        (WebSecurityOrigin::createInstance):
+        (WebSecurityOrigin::WebSecurityOrigin):
+        (WebSecurityOrigin::~WebSecurityOrigin):
+        (WebSecurityOrigin::QueryInterface):
+        (WebSecurityOrigin::AddRef):
+        (WebSecurityOrigin::Release):
+        (WebSecurityOrigin::protocol):
+        (WebSecurityOrigin::domain):
+        (WebSecurityOrigin::port):
+        (WebSecurityOrigin::usage):
+        (WebSecurityOrigin::quota):
+        (WebSecurityOrigin::setQuota):
+        * WebSecurityOrigin.h: Added.
+
 2007-11-26  Kevin McCullough  <kmccullough@apple.com>
 
         Reviewed by Maciej.
index e74771f43126060d7f551a85fbaf087b907b8003..50e6c648b5756d310fb4503d7056b0a75eefe345 100644 (file)
@@ -32,6 +32,7 @@
 #define FOR_EACH_COCLASS(macro) \
     macro(CFDictionaryPropertyBag) \
     macro(WebCache) \
+    macro(WebDatabaseManager) \
     macro(WebDownload) \
     macro(WebError) \
     macro(WebHistory) \
index 26133b85ffdb3301fa767116c6b4a2322cedef27..62a0ef904e959582e3221d69a34713c810535237 100644 (file)
@@ -74,7 +74,7 @@ interface IWebDatabaseManager : IUnknown
     HRESULT databasesWithOrigin([in] IWebSecurityOrigin* origin, [out, retval] IEnumVARIANT** result);
     HRESULT detailsForDatabaseWithOrigin([in] BSTR* database, [in] IWebSecurityOrigin* origin, [out, retval] IPropertyBag **result);
 
-    HRESULT deleteAlldatabases();
+    HRESULT deleteAllDatabases();
     HRESULT deleteDatabasesWithOrigin([in] IWebSecurityOrigin* origin);
     HRESULT deleteDatabaseWithOrigin([in] BSTR* databaseName, [in] IWebSecurityOrigin* origin);
 }
index 9876d722abb6475aa08026ee18b3996ce37b0c83..cbafeafb05a4a31a9c776b610029dbc0e40f2b34 100644 (file)
@@ -56,6 +56,7 @@ import "IWebView.idl";
 import "IWebViewPrivate.idl";
 import "IWebUIDelegate.idl";
 import "IWebResourceLoadDelegate.idl";
+import "IWebDatabaseManager.idl";
 import "IWebDownload.idl";
 import "IWebFrameLoadDelegate.idl";
 import "IWebPolicyDelegate.idl";
@@ -300,4 +301,13 @@ library OpenSourceWebKit
     coclass WebScriptScope {
         [default] interface IWebScriptScope;
     }
+
+#if __BUILDBOT__
+    [uuid(C2A1BFC2-1E7C-49fe-8592-D0C7FB440BC0)]
+#else
+    [uuid(1F7B8CEE-5D74-4974-8A47-C5733B422644)]
+#endif
+    coclass WebDatabaseManager {
+        [default] interface IWebDatabaseManager;
+    }
 }
index 76674d2d171a6e59b117b9f1a5125f9451cf029e..d6e77b891e72a8b1df04e24f76d12ab15a499231 100644 (file)
  */\r
 #include "config.h"\r
 #include "WebDatabaseManager.h"\r
+#include "WebKitDLL.h"\r
 \r
 #include <WebCore/DatabaseTracker.h>\r
 #include <WebCore/FileSystem.h>\r
+#include <WebCore/COMPtr.h>\r
+\r
+using namespace WebCore;\r
+\r
+static COMPtr<WebDatabaseManager> s_sharedWebDatabaseManager;
+\r
+// WebDatabaseManager --------------------------------------------------------------\r
+WebDatabaseManager* WebDatabaseManager::createInstance()\r
+{\r
+    WebDatabaseManager* manager = new WebDatabaseManager();\r
+    manager->AddRef();\r
+    return manager;    \r
+}\r
+\r
+WebDatabaseManager::WebDatabaseManager()\r
+    : m_refCount(0)\r
+{\r
+    gClassCount++;\r
+}\r
+\r
+WebDatabaseManager::~WebDatabaseManager()\r
+{\r
+    gClassCount--;\r
+}\r
+\r
+// IUnknown ------------------------------------------------------------------------\r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::QueryInterface(REFIID riid, void** ppvObject)\r
+{\r
+    *ppvObject = 0;\r
+    if (IsEqualGUID(riid, IID_IUnknown))\r
+        *ppvObject = static_cast<WebDatabaseManager*>(this);\r
+    else if (IsEqualGUID(riid, IID_IWebDatabaseManager))\r
+        *ppvObject = static_cast<WebDatabaseManager*>(this);\r
+    else\r
+        return E_NOINTERFACE;\r
+\r
+    AddRef();\r
+    return S_OK;\r
+}\r
+\r
+ULONG STDMETHODCALLTYPE WebDatabaseManager::AddRef()\r
+{\r
+    return ++m_refCount;\r
+}\r
+\r
+ULONG STDMETHODCALLTYPE WebDatabaseManager::Release()\r
+{\r
+    ULONG newRef = --m_refCount;\r
+    if (!newRef)\r
+        delete this;\r
+\r
+    return newRef;\r
+}\r
+\r
+// IWebDatabaseManager -------------------------------------------------------------\r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::sharedWebDatabaseManager( \r
+    /* [retval][out] */ IWebDatabaseManager** result)\r
+{\r
+    if (!s_sharedWebDatabaseManager)\r
+        s_sharedWebDatabaseManager.adoptRef(WebDatabaseManager::createInstance());\r
+\r
+    return s_sharedWebDatabaseManager.copyRefTo(result);\r
+}\r
+\r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::origins( \r
+    /* [retval][out] */ IEnumVARIANT** result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = 0;\r
+\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
+    \r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::databasesWithOrigin( \r
+    /* [in] */ IWebSecurityOrigin* origin,\r
+    /* [retval][out] */ IEnumVARIANT** result)\r
+{\r
+    if (!origin || !result)\r
+        return E_POINTER;\r
+\r
+    *result = 0;\r
+\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
+    \r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::detailsForDatabaseWithOrigin( \r
+    /* [in] */ BSTR* database,\r
+    /* [in] */ IWebSecurityOrigin* origin,\r
+    /* [retval][out] */ IPropertyBag** result)\r
+{\r
+    if (!database || !origin || !result)\r
+        return E_POINTER;\r
+\r
+    *result = 0;\r
+\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
+    \r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteAllDatabases()\r
+{\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
+   \r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteDatabasesWithOrigin( \r
+    /* [in] */ IWebSecurityOrigin* origin)\r
+{\r
+    if (!origin)\r
+        return E_POINTER;\r
+\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
+    \r
+HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteDatabaseWithOrigin( \r
+    /* [in] */ BSTR* databaseName,\r
+    /* [in] */ IWebSecurityOrigin* origin)\r
+{\r
+    if (!databaseName || !origin)\r
+        return E_POINTER;\r
+\r
+    if (this != s_sharedWebDatabaseManager)\r
+        return E_FAIL;\r
+\r
+    return E_NOTIMPL;\r
+}\r
 \r
 void WebKitSetWebDatabasesPathIfNecessary()\r
 {\r
index ee95a18c403f64a2b6689c33df690b12658f84a7..1d4229a57d95253f098410eb4d3259ae6033d6c2 100644 (file)
  */\r
 #ifndef WebDatabaseManager_h\r
 #define WebDatabaseManager_h\r
+\r
+#include "IWebDatabaseManager.h"\r
+\r
+class WebDatabaseManager : public IWebDatabaseManager {\r
+public:\r
+    static WebDatabaseManager* createInstance();\r
+\r
+    // IUnknown\r
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface( \r
+        /* [in] */ REFIID riid,\r
+        /* [iid_is][out] */ void** ppvObject);\r
+\r
+    virtual ULONG STDMETHODCALLTYPE AddRef();\r
+\r
+    virtual ULONG STDMETHODCALLTYPE Release();\r
+\r
+    // IWebDatabaseManager\r
+    virtual HRESULT STDMETHODCALLTYPE sharedWebDatabaseManager( \r
+        /* [retval][out] */ IWebDatabaseManager** result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE origins( \r
+        /* [retval][out] */ IEnumVARIANT** result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE databasesWithOrigin( \r
+        /* [in] */ IWebSecurityOrigin* origin,\r
+        /* [retval][out] */ IEnumVARIANT** result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE detailsForDatabaseWithOrigin( \r
+        /* [in] */ BSTR* database,\r
+        /* [in] */ IWebSecurityOrigin* origin,\r
+        /* [retval][out] */ IPropertyBag** result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE deleteAllDatabases();\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE deleteDatabasesWithOrigin( \r
+        /* [in] */ IWebSecurityOrigin* origin);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE deleteDatabaseWithOrigin( \r
+        /* [in] */ BSTR* databaseName,\r
+        /* [in] */ IWebSecurityOrigin* origin);\r
+private:\r
+    WebDatabaseManager();\r
+    ~WebDatabaseManager();\r
+\r
+    ULONG m_refCount;\r
+};\r
+\r
 void WebKitSetWebDatabasesPathIfNecessary();\r
 \r
 #endif\r
index 4b57bbb8b5affbde539edf207e4034f16ef816e9..f12b2d34c1de2630a004446bb48381f8364ef175 100644 (file)
                                RelativePath="..\WebScrollBar.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\WebSecurityOrigin.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\WebTextRenderer.h"\r
                                >\r
                                RelativePath="..\WebScrollBar.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\WebSecurityOrigin.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\WebTextRenderer.cpp"\r
                                >\r
index d584e0f6253688d61a15ab32e8b6729759d46af1..07f8d81375bb7925f2c15380541048c3ee4ea7f1 100644 (file)
@@ -30,6 +30,7 @@
 #include "ForEachCoClass.h"
 #include "CFDictionaryPropertyBag.h"
 #include "WebCache.h"
+#include "WebDatabaseManager.h"
 #include "WebDownload.h"
 #include "WebError.h"
 #include "WebFrame.h"
diff --git a/WebKit/win/WebSecurityOrigin.cpp b/WebKit/win/WebSecurityOrigin.cpp
new file mode 100644 (file)
index 0000000..9c22ce5
--- /dev/null
@@ -0,0 +1,149 @@
+/*\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
+#include "config.h"\r
+#include "WebSecurityOrigin.h"\r
+#include "WebKitDLL.h"\r
+\r
+#include <WebCore/BString.h>\r
+#include <WebCore/DatabaseTracker.h>\r
+\r
+using namespace WebCore;\r
+\r
+// WebSecurityOrigin ---------------------------------------------------------------\r
+WebSecurityOrigin* WebSecurityOrigin::createInstance(const SecurityOriginData& securityOriginData)\r
+{\r
+    WebSecurityOrigin* origin = new WebSecurityOrigin(securityOriginData);\r
+    origin->AddRef();\r
+    return origin;\r
+}\r
+\r
+WebSecurityOrigin::WebSecurityOrigin(const SecurityOriginData& securityOriginData)\r
+    : m_refCount(0)\r
+    , m_securityOriginData(securityOriginData)\r
+{\r
+    gClassCount++;\r
+}\r
+\r
+WebSecurityOrigin::~WebSecurityOrigin()\r
+{\r
+    gClassCount--;\r
+}\r
+\r
+// IUnknown ------------------------------------------------------------------------\r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::QueryInterface(REFIID riid, void** ppvObject)\r
+{\r
+    *ppvObject = 0;\r
+    if (IsEqualGUID(riid, IID_IUnknown))\r
+        *ppvObject = static_cast<IWebSecurityOrigin*>(this);\r
+    else if (IsEqualGUID(riid, IID_IWebSecurityOrigin))\r
+        *ppvObject = static_cast<IWebSecurityOrigin*>(this);\r
+    else\r
+        return E_NOINTERFACE;\r
+\r
+    AddRef();\r
+    return S_OK;\r
+}\r
+\r
+ULONG STDMETHODCALLTYPE WebSecurityOrigin::AddRef()\r
+{\r
+    return ++m_refCount;\r
+}\r
+\r
+ULONG STDMETHODCALLTYPE WebSecurityOrigin::Release()\r
+{\r
+    ULONG newRef = --m_refCount;\r
+    if (!newRef)\r
+        delete this;\r
+\r
+    return newRef;\r
+}\r
+\r
+// IWebSecurityOrigin --------------------------------------------------------------\r
+\r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::protocol( \r
+    /* [retval][out] */ BSTR* result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = BString(m_securityOriginData.protocol()).release();\r
+\r
+    return S_OK;\r
+}\r
+        \r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::domain( \r
+    /* [retval][out] */ BSTR* result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = BString(m_securityOriginData.host()).release();\r
+\r
+    return S_OK;\r
+}\r
+      \r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::port( \r
+    /* [retval][out] */ unsigned short* result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = m_securityOriginData.port();\r
+\r
+    return S_OK;\r
+}\r
+        \r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::usage( \r
+    /* [retval][out] */ unsigned long long* result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = DatabaseTracker::tracker().usageForOrigin(m_securityOriginData);\r
+\r
+    return S_OK;\r
+}\r
+        \r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::quota( \r
+    /* [retval][out] */ unsigned long long* result)\r
+{\r
+    if (!result)\r
+        return E_POINTER;\r
+\r
+    *result = DatabaseTracker::tracker().quotaForOrigin(m_securityOriginData);\r
+    return S_OK;\r
+}\r
+        \r
+HRESULT STDMETHODCALLTYPE WebSecurityOrigin::setQuota( \r
+    /* [in] */ unsigned long long quota) \r
+{\r
+    DatabaseTracker::tracker().setQuota(m_securityOriginData, quota);\r
+\r
+    return S_OK;\r
+}\r
diff --git a/WebKit/win/WebSecurityOrigin.h b/WebKit/win/WebSecurityOrigin.h
new file mode 100644 (file)
index 0000000..d68a7a6
--- /dev/null
@@ -0,0 +1,74 @@
+/*\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
+#ifndef WebSecurityOrigin_h\r
+#define WebSecurityOrigin_h\r
+\r
+#include "IWebSecurityOrigin.h"\r
+#include <WebCore/SecurityOriginData.h>\r
+\r
+class WebSecurityOrigin : public IWebSecurityOrigin {\r
+public:\r
+    static WebSecurityOrigin* createInstance(const WebCore::SecurityOriginData& securityOriginData);\r
+\r
+    // IUnknown\r
+    virtual HRESULT STDMETHODCALLTYPE QueryInterface( \r
+        /* [in] */ REFIID riid,\r
+        /* [iid_is][out] */ void** ppvObject);\r
+\r
+    virtual ULONG STDMETHODCALLTYPE AddRef();\r
+\r
+    virtual ULONG STDMETHODCALLTYPE Release();\r
+\r
+    // IWebSecurityOrigin\r
+    virtual HRESULT STDMETHODCALLTYPE protocol( \r
+        /* [retval][out] */ BSTR* result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE domain( \r
+        /* [retval][out] */ BSTR* result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE port( \r
+        /* [retval][out] */ unsigned short* result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE usage( \r
+        /* [retval][out] */ unsigned long long* result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE quota( \r
+        /* [retval][out] */ unsigned long long* result);\r
+        \r
+    virtual HRESULT STDMETHODCALLTYPE setQuota( \r
+        /* [in] */ unsigned long long quota);\r
+private:\r
+    WebSecurityOrigin(const WebCore::SecurityOriginData&);\r
+    ~WebSecurityOrigin();\r
+\r
+    ULONG m_refCount;\r
+    WebCore::SecurityOriginData m_securityOriginData;\r
+};\r
+\r
+#endif // WebSecurityOrigin_h\r