[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:28:27 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit fbaf876100c57935c55f6463cc2859a8cf60959a
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 10 07:46:39 2009 +0000

    2009-11-09  Yaar Schnitman  <yaar at chromium.src>
    
            Reviewed by Dimitri Glazkov.
    
            Up-streaming Chromium API src files: WebData...WebElement
    
            https://bugs.webkit.org/show_bug.cgi?id=31276
    
            * src/WebData.cpp: Added.
            (WebKit::WebData::reset):
            (WebKit::WebData::assign):
            (WebKit::WebData::size):
            (WebKit::WebData::data):
            (WebKit::WebData::WebData):
            (WebKit::WebData::operator=):
            (WebKit::WebData::operator PassRefPtr<SharedBuffer>):
            * src/WebDataSourceImpl.cpp: Added.
            (WebKit::WebDataSourceImpl::create):
            (WebKit::WebDataSourceImpl::originalRequest):
            (WebKit::WebDataSourceImpl::request):
            (WebKit::WebDataSourceImpl::response):
            (WebKit::WebDataSourceImpl::hasUnreachableURL):
            (WebKit::WebDataSourceImpl::unreachableURL):
            (WebKit::WebDataSourceImpl::redirectChain):
            (WebKit::WebDataSourceImpl::pageTitle):
            (WebKit::WebDataSourceImpl::navigationType):
            (WebKit::WebDataSourceImpl::triggeringEventTime):
            (WebKit::WebDataSourceImpl::extraData):
            (WebKit::WebDataSourceImpl::setExtraData):
            (WebKit::WebDataSourceImpl::toWebNavigationType):
            (WebKit::WebDataSourceImpl::endOfRedirectChain):
            (WebKit::WebDataSourceImpl::clearRedirectChain):
            (WebKit::WebDataSourceImpl::appendRedirect):
            (WebKit::WebDataSourceImpl::setNextPluginLoadObserver):
            (WebKit::WebDataSourceImpl::WebDataSourceImpl):
            (WebKit::WebDataSourceImpl::~WebDataSourceImpl):
            * src/WebDataSourceImpl.h: Added.
            (WebKit::WebDataSourceImpl::fromDocumentLoader):
            (WebKit::WebDataSourceImpl::hasRedirectChain):
            (WebKit::WebDataSourceImpl::releasePluginLoadObserver):
            * src/WebDatabase.cpp: Added.
            (WebKit::WebDatabase::reset):
            (WebKit::WebDatabase::assign):
            (WebKit::WebDatabase::name):
            (WebKit::WebDatabase::displayName):
            (WebKit::WebDatabase::estimatedSize):
            (WebKit::WebDatabase::securityOrigin):
            (WebKit::WebDatabase::setObserver):
            (WebKit::WebDatabase::observer):
            (WebKit::WebDatabase::updateDatabaseSize):
            (WebKit::WebDatabase::WebDatabase):
            (WebKit::WebDatabase::operator=):
            (WebKit::WebDatabase::operator WTF::PassRefPtr<Database>):
            * src/WebDevToolsAgentPrivate.h: Added.
            * src/WebDragData.cpp: Added.
            (WebKit::WebDragData::initialize):
            (WebKit::WebDragData::reset):
            (WebKit::WebDragData::assign):
            (WebKit::WebDragData::url):
            (WebKit::WebDragData::setURL):
            (WebKit::WebDragData::urlTitle):
            (WebKit::WebDragData::setURLTitle):
            (WebKit::WebDragData::fileExtension):
            (WebKit::WebDragData::setFileExtension):
            (WebKit::WebDragData::hasFileNames):
            (WebKit::WebDragData::fileNames):
            (WebKit::WebDragData::setFileNames):
            (WebKit::WebDragData::appendToFileNames):
            (WebKit::WebDragData::plainText):
            (WebKit::WebDragData::setPlainText):
            (WebKit::WebDragData::htmlText):
            (WebKit::WebDragData::setHTMLText):
            (WebKit::WebDragData::htmlBaseURL):
            (WebKit::WebDragData::setHTMLBaseURL):
            (WebKit::WebDragData::fileContentFileName):
            (WebKit::WebDragData::setFileContentFileName):
            (WebKit::WebDragData::fileContent):
            (WebKit::WebDragData::setFileContent):
            (WebKit::WebDragData::WebDragData):
            (WebKit::WebDragData::operator=):
            (WebKit::WebDragData::operator WTF::PassRefPtr<WebCore::ChromiumDataObject>):
            (WebKit::WebDragData::ensureMutable):
            * src/WebElement.cpp: Added.
            (WebKit::WebElement::WebElement):
            (WebKit::WebElement::operator=):
            (WebKit::WebElement::operator WTF::PassRefPtr<Element>):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 67456cb..44a5264 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,90 @@
+2009-11-09  Yaar Schnitman  <yaar at chromium.src>
+
+        Reviewed by Dimitri Glazkov.
+
+        Up-streaming Chromium API src files: WebData...WebElement
+
+        https://bugs.webkit.org/show_bug.cgi?id=31276
+
+        * src/WebData.cpp: Added.
+        (WebKit::WebData::reset):
+        (WebKit::WebData::assign):
+        (WebKit::WebData::size):
+        (WebKit::WebData::data):
+        (WebKit::WebData::WebData):
+        (WebKit::WebData::operator=):
+        (WebKit::WebData::operator PassRefPtr<SharedBuffer>):
+        * src/WebDataSourceImpl.cpp: Added.
+        (WebKit::WebDataSourceImpl::create):
+        (WebKit::WebDataSourceImpl::originalRequest):
+        (WebKit::WebDataSourceImpl::request):
+        (WebKit::WebDataSourceImpl::response):
+        (WebKit::WebDataSourceImpl::hasUnreachableURL):
+        (WebKit::WebDataSourceImpl::unreachableURL):
+        (WebKit::WebDataSourceImpl::redirectChain):
+        (WebKit::WebDataSourceImpl::pageTitle):
+        (WebKit::WebDataSourceImpl::navigationType):
+        (WebKit::WebDataSourceImpl::triggeringEventTime):
+        (WebKit::WebDataSourceImpl::extraData):
+        (WebKit::WebDataSourceImpl::setExtraData):
+        (WebKit::WebDataSourceImpl::toWebNavigationType):
+        (WebKit::WebDataSourceImpl::endOfRedirectChain):
+        (WebKit::WebDataSourceImpl::clearRedirectChain):
+        (WebKit::WebDataSourceImpl::appendRedirect):
+        (WebKit::WebDataSourceImpl::setNextPluginLoadObserver):
+        (WebKit::WebDataSourceImpl::WebDataSourceImpl):
+        (WebKit::WebDataSourceImpl::~WebDataSourceImpl):
+        * src/WebDataSourceImpl.h: Added.
+        (WebKit::WebDataSourceImpl::fromDocumentLoader):
+        (WebKit::WebDataSourceImpl::hasRedirectChain):
+        (WebKit::WebDataSourceImpl::releasePluginLoadObserver):
+        * src/WebDatabase.cpp: Added.
+        (WebKit::WebDatabase::reset):
+        (WebKit::WebDatabase::assign):
+        (WebKit::WebDatabase::name):
+        (WebKit::WebDatabase::displayName):
+        (WebKit::WebDatabase::estimatedSize):
+        (WebKit::WebDatabase::securityOrigin):
+        (WebKit::WebDatabase::setObserver):
+        (WebKit::WebDatabase::observer):
+        (WebKit::WebDatabase::updateDatabaseSize):
+        (WebKit::WebDatabase::WebDatabase):
+        (WebKit::WebDatabase::operator=):
+        (WebKit::WebDatabase::operator WTF::PassRefPtr<Database>):
+        * src/WebDevToolsAgentPrivate.h: Added.
+        * src/WebDragData.cpp: Added.
+        (WebKit::WebDragData::initialize):
+        (WebKit::WebDragData::reset):
+        (WebKit::WebDragData::assign):
+        (WebKit::WebDragData::url):
+        (WebKit::WebDragData::setURL):
+        (WebKit::WebDragData::urlTitle):
+        (WebKit::WebDragData::setURLTitle):
+        (WebKit::WebDragData::fileExtension):
+        (WebKit::WebDragData::setFileExtension):
+        (WebKit::WebDragData::hasFileNames):
+        (WebKit::WebDragData::fileNames):
+        (WebKit::WebDragData::setFileNames):
+        (WebKit::WebDragData::appendToFileNames):
+        (WebKit::WebDragData::plainText):
+        (WebKit::WebDragData::setPlainText):
+        (WebKit::WebDragData::htmlText):
+        (WebKit::WebDragData::setHTMLText):
+        (WebKit::WebDragData::htmlBaseURL):
+        (WebKit::WebDragData::setHTMLBaseURL):
+        (WebKit::WebDragData::fileContentFileName):
+        (WebKit::WebDragData::setFileContentFileName):
+        (WebKit::WebDragData::fileContent):
+        (WebKit::WebDragData::setFileContent):
+        (WebKit::WebDragData::WebDragData):
+        (WebKit::WebDragData::operator=):
+        (WebKit::WebDragData::operator WTF::PassRefPtr<WebCore::ChromiumDataObject>):
+        (WebKit::WebDragData::ensureMutable):
+        * src/WebElement.cpp: Added.
+        (WebKit::WebElement::WebElement):
+        (WebKit::WebElement::operator=):
+        (WebKit::WebElement::operator WTF::PassRefPtr<Element>):
+
 2009-11-09  Nate Chapin  <japhet at chromium.org>
 
         Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/src/WebData.cpp b/WebKit/chromium/src/WebData.cpp
new file mode 100644
index 0000000..6aafe79
--- /dev/null
+++ b/WebKit/chromium/src/WebData.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebData.h"
+
+#include "SharedBuffer.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class WebDataPrivate : public SharedBuffer {
+};
+
+void WebData::reset()
+{
+    if (m_private) {
+        m_private->deref();
+        m_private = 0;
+    }
+}
+
+void WebData::assign(const WebData& other)
+{
+    WebDataPrivate* p = const_cast<WebDataPrivate*>(other.m_private);
+    if (p)
+        p->ref();
+    assign(p);
+}
+
+void WebData::assign(const char* data, size_t size)
+{
+    assign(static_cast<WebDataPrivate*>(
+        SharedBuffer::create(data, size).releaseRef()));
+}
+
+size_t WebData::size() const
+{
+    if (!m_private)
+        return 0;
+    return const_cast<WebDataPrivate*>(m_private)->size();
+}
+
+const char* WebData::data() const
+{
+    if (!m_private)
+        return 0;
+    return const_cast<WebDataPrivate*>(m_private)->data();
+}
+
+WebData::WebData(const PassRefPtr<SharedBuffer>& buffer)
+    : m_private(static_cast<WebDataPrivate*>(buffer.releaseRef()))
+{
+}
+
+WebData& WebData::operator=(const PassRefPtr<SharedBuffer>& buffer)
+{
+    assign(static_cast<WebDataPrivate*>(buffer.releaseRef()));
+    return *this;
+}
+
+WebData::operator PassRefPtr<SharedBuffer>() const
+{
+    return PassRefPtr<SharedBuffer>(const_cast<WebDataPrivate*>(m_private));
+}
+
+void WebData::assign(WebDataPrivate* p)
+{
+    // p is already ref'd for us by the caller
+    if (m_private)
+        m_private->deref();
+    m_private = p;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDataSourceImpl.cpp b/WebKit/chromium/src/WebDataSourceImpl.cpp
new file mode 100644
index 0000000..456706a
--- /dev/null
+++ b/WebKit/chromium/src/WebDataSourceImpl.cpp
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebDataSourceImpl.h"
+
+#include "WebURL.h"
+#include "WebURLError.h"
+#include "WebVector.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebPluginLoadObserver* WebDataSourceImpl::m_nextPluginLoadObserver = 0;
+
+PassRefPtr<WebDataSourceImpl> WebDataSourceImpl::create(const ResourceRequest& request, const SubstituteData& data)
+{
+    return adoptRef(new WebDataSourceImpl(request, data));
+}
+
+const WebURLRequest& WebDataSourceImpl::originalRequest() const
+{
+    m_originalRequestWrapper.bind(DocumentLoader::originalRequest());
+    return m_originalRequestWrapper;
+}
+
+const WebURLRequest& WebDataSourceImpl::request() const
+{
+    m_requestWrapper.bind(DocumentLoader::request());
+    return m_requestWrapper;
+}
+
+const WebURLResponse& WebDataSourceImpl::response() const
+{
+    m_responseWrapper.bind(DocumentLoader::response());
+    return m_responseWrapper;
+}
+
+bool WebDataSourceImpl::hasUnreachableURL() const
+{
+    return !DocumentLoader::unreachableURL().isEmpty();
+}
+
+WebURL WebDataSourceImpl::unreachableURL() const
+{
+    return DocumentLoader::unreachableURL();
+}
+
+void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const
+{
+    result.assign(m_redirectChain);
+}
+
+WebString WebDataSourceImpl::pageTitle() const
+{
+    return title();
+}
+
+WebNavigationType WebDataSourceImpl::navigationType() const
+{
+    return toWebNavigationType(triggeringAction().type());
+}
+
+double WebDataSourceImpl::triggeringEventTime() const
+{
+    if (!triggeringAction().event())
+        return 0.0;
+
+    // DOMTimeStamp uses units of milliseconds.
+    return triggeringAction().event()->timeStamp() / 1000.0;
+}
+
+WebDataSource::ExtraData* WebDataSourceImpl::extraData() const
+{
+    return m_extraData.get();
+}
+
+void WebDataSourceImpl::setExtraData(ExtraData* extraData)
+{
+    m_extraData.set(extraData);
+}
+
+WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type)
+{
+    switch (type) {
+    case NavigationTypeLinkClicked:
+        return WebNavigationTypeLinkClicked;
+    case NavigationTypeFormSubmitted:
+        return WebNavigationTypeFormSubmitted;
+    case NavigationTypeBackForward:
+        return WebNavigationTypeBackForward;
+    case NavigationTypeReload:
+        return WebNavigationTypeReload;
+    case NavigationTypeFormResubmitted:
+        return WebNavigationTypeFormResubmitted;
+    case NavigationTypeOther:
+    default:
+        return WebNavigationTypeOther;
+    }
+}
+
+const KURL& WebDataSourceImpl::endOfRedirectChain() const
+{
+    ASSERT(!m_redirectChain.isEmpty());
+    return m_redirectChain.last();
+}
+
+void WebDataSourceImpl::clearRedirectChain()
+{
+    m_redirectChain.clear();
+}
+
+void WebDataSourceImpl::appendRedirect(const KURL& url)
+{
+    m_redirectChain.append(url);
+}
+
+void WebDataSourceImpl::setNextPluginLoadObserver(PassOwnPtr<WebPluginLoadObserver> observer)
+{
+    // This call should always be followed up with the creation of a
+    // WebDataSourceImpl, so we should never leak this object.
+    m_nextPluginLoadObserver = observer.release();
+}
+
+WebDataSourceImpl::WebDataSourceImpl(const ResourceRequest& request, const SubstituteData& data)
+    : DocumentLoader(request, data)
+{
+    if (m_nextPluginLoadObserver) {
+        // When a new frame is created, it initially gets a data source for an
+        // empty document.  Then it is navigated to the source URL of the
+        // frame, which results in a second data source being created.  We want
+        // to wait to attach the WebPluginLoadObserver to that data source.
+        if (!request.url().isEmpty()) {
+            ASSERT(m_nextPluginLoadObserver->url() == request.url());
+            m_pluginLoadObserver.set(m_nextPluginLoadObserver);
+            m_nextPluginLoadObserver = 0;
+        }
+    }
+}
+
+WebDataSourceImpl::~WebDataSourceImpl()
+{
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDataSourceImpl.h b/WebKit/chromium/src/WebDataSourceImpl.h
new file mode 100644
index 0000000..8860fe4
--- /dev/null
+++ b/WebKit/chromium/src/WebDataSourceImpl.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 WebDataSourceImpl_h
+#define WebDataSourceImpl_h
+
+// FIXME: This relative path is a temporary hack to support using this
+// header from webkit/glue.
+#include "../public/WebDataSource.h"
+
+#include "DocumentLoader.h"
+#include "KURL.h"
+
+#include "WebPluginLoadObserver.h"
+#include "WrappedResourceRequest.h"
+#include "WrappedResourceResponse.h"
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+
+namespace WebKit {
+
+class WebPluginLoadObserver;
+
+class WebDataSourceImpl : public WebCore::DocumentLoader, public WebDataSource {
+public:
+    static PassRefPtr<WebDataSourceImpl> create(const WebCore::ResourceRequest&,
+                                                const WebCore::SubstituteData&);
+
+    static WebDataSourceImpl* fromDocumentLoader(WebCore::DocumentLoader* loader)
+    {
+        return static_cast<WebDataSourceImpl*>(loader);
+    }
+
+    // WebDataSource methods:
+    virtual const WebURLRequest& originalRequest() const;
+    virtual const WebURLRequest& request() const;
+    virtual const WebURLResponse& response() const;
+    virtual bool hasUnreachableURL() const;
+    virtual WebURL unreachableURL() const;
+    virtual void redirectChain(WebVector<WebURL>&) const;
+    virtual WebString pageTitle() const;
+    virtual WebNavigationType navigationType() const;
+    virtual double triggeringEventTime() const;
+    virtual ExtraData* extraData() const;
+    virtual void setExtraData(ExtraData*);
+
+    static WebNavigationType toWebNavigationType(WebCore::NavigationType type);
+
+    bool hasRedirectChain() const { return !m_redirectChain.isEmpty(); }
+    const WebCore::KURL& endOfRedirectChain() const;
+    void clearRedirectChain();
+    void appendRedirect(const WebCore::KURL& url);
+
+    PassOwnPtr<WebPluginLoadObserver> releasePluginLoadObserver() { return m_pluginLoadObserver.release(); }
+    static void setNextPluginLoadObserver(PassOwnPtr<WebPluginLoadObserver>);
+
+private:
+    WebDataSourceImpl(const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
+    ~WebDataSourceImpl();
+
+    // Mutable because the const getters will magically sync these to the
+    // latest version from WebKit.
+    mutable WrappedResourceRequest m_originalRequestWrapper;
+    mutable WrappedResourceRequest m_requestWrapper;
+    mutable WrappedResourceResponse m_responseWrapper;
+
+    // Lists all intermediate URLs that have redirected for the current provisional load.
+    // See WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad for a
+    // description of who modifies this when to keep it up to date.
+    Vector<WebCore::KURL> m_redirectChain;
+
+    OwnPtr<ExtraData> m_extraData;
+    OwnPtr<WebPluginLoadObserver> m_pluginLoadObserver;
+
+    static WebPluginLoadObserver* m_nextPluginLoadObserver;
+};
+
+} // namespace WebKit
+
+#endif  // WebDataSourceImpl_h
diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp
new file mode 100644
index 0000000..d702eaf
--- /dev/null
+++ b/WebKit/chromium/src/WebDatabase.cpp
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebDatabase.h"
+
+#include "Database.h"
+#include "DatabaseThread.h"
+#include "Document.h"
+#include "KURL.h"
+#include "SecurityOrigin.h"
+#include "WebDatabaseObserver.h"
+#include "WebString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static WebDatabaseObserver* databaseObserver = 0;
+
+class WebDatabasePrivate : public Database {
+};
+
+void WebDatabase::reset()
+{
+    assign(0);
+}
+
+void WebDatabase::assign(const WebDatabase& other)
+{
+    WebDatabasePrivate* d = const_cast<WebDatabasePrivate*>(other.m_private);
+    if (d)
+        d->ref();
+    assign(d);
+}
+
+WebString WebDatabase::name() const
+{
+    if (m_private)
+        return m_private->stringIdentifier();
+
+    return WebString::fromUTF8("null");
+}
+
+WebString WebDatabase::displayName() const
+{
+// FIXME: add the Database::displayName() method.
+//     if (m_private)
+//         return m_private->displayName();
+
+    return WebString::fromUTF8("null");
+}
+
+unsigned long WebDatabase::estimatedSize() const
+{
+// FIXME: add the Database::estimatedSize() method.
+//    if (m_private)
+//        return m_private->estimatedSize();
+
+    return -1;
+}
+
+WebSecurityOrigin WebDatabase::securityOrigin() const
+{
+// FIXME: add the Database::threadSafeSecurityOrigin() method.
+//     if (m_private)
+//         return WebSecurityOrigin(m_private->threadSafeSecurityOrigin());
+
+    return WebSecurityOrigin();
+}
+
+void WebDatabase::setObserver(WebDatabaseObserver* observer)
+{
+    databaseObserver = observer;
+}
+
+WebDatabaseObserver* WebDatabase::observer()
+{
+    return databaseObserver;
+}
+
+void WebDatabase::updateDatabaseSize(
+    const WebString& originIdentifier, const WebString& databaseName,
+    unsigned long long databaseSize, unsigned long long spaceAvailable)
+{
+// FIXME: add the QuotaTracker class.
+//     WebCore::QuotaTracker::instance().updateDatabaseSize(
+//         originIdentifier, databaseName, databaseSize, spaceAvailable);
+}
+
+WebDatabase::WebDatabase(const WTF::PassRefPtr<Database>& database)
+    : m_private(static_cast<WebDatabasePrivate*>(database.releaseRef()))
+{
+}
+
+WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<Database>& database)
+{
+    assign(static_cast<WebDatabasePrivate*>(database.releaseRef()));
+    return *this;
+}
+
+WebDatabase::operator WTF::PassRefPtr<Database>() const
+{
+    return PassRefPtr<Database>(const_cast<WebDatabasePrivate*>(m_private));
+}
+
+void WebDatabase::assign(WebDatabasePrivate* d)
+{
+    // d is already ref'd for us by the caller
+    if (m_private)
+        m_private->deref();
+    m_private = d;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDevToolsAgentPrivate.h b/WebKit/chromium/src/WebDevToolsAgentPrivate.h
new file mode 100644
index 0000000..0c1c67e
--- /dev/null
+++ b/WebKit/chromium/src/WebDevToolsAgentPrivate.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 WebDevToolsAgentPrivate_h
+#define WebDevToolsAgentPrivate_h
+
+// FIXME: This relative path is a temporary hack to support using this
+// header from webkit/glue.
+#include "../public/WebDevToolsAgent.h"
+
+namespace WebKit {
+class WebFrameImpl;
+
+class WebDevToolsAgentPrivate : public WebDevToolsAgent {
+public:
+    // Notifications from FrameLoaderClientImpl:
+
+    // The window object for the frame has been cleared of any extra properties
+    // that may have been set by script from the previously loaded document.
+    virtual void didClearWindowObject(WebFrameImpl*) = 0;
+
+    // The provisional datasource is now committed.  The first part of the
+    // response body has been received, and the encoding of the response body
+    // is known.
+    virtual void didCommitProvisionalLoad(WebFrameImpl*, bool isNewNavigation) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/WebDragData.cpp b/WebKit/chromium/src/WebDragData.cpp
new file mode 100644
index 0000000..4af1119
--- /dev/null
+++ b/WebKit/chromium/src/WebDragData.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebDragData.h"
+
+#include "ChromiumDataObject.h"
+#include "WebData.h"
+#include "WebString.h"
+#include "WebURL.h"
+#include "WebVector.h"
+
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class WebDragDataPrivate : public ChromiumDataObject {
+};
+
+void WebDragData::initialize()
+{
+    assign(static_cast<WebDragDataPrivate*>(ChromiumDataObject::create().releaseRef()));
+}
+
+void WebDragData::reset()
+{
+    assign(0);
+}
+
+void WebDragData::assign(const WebDragData& other)
+{
+    WebDragDataPrivate* p = const_cast<WebDragDataPrivate*>(other.m_private);
+    if (p)
+        p->ref();
+    assign(p);
+}
+
+WebURL WebDragData::url() const
+{
+    ASSERT(!isNull());
+    return m_private->url;
+}
+
+void WebDragData::setURL(const WebURL& url)
+{
+    ensureMutable();
+    m_private->url = url;
+}
+
+WebString WebDragData::urlTitle() const
+{
+    ASSERT(!isNull());
+    return m_private->urlTitle;
+}
+
+void WebDragData::setURLTitle(const WebString& urlTitle)
+{
+    ensureMutable();
+    m_private->urlTitle = urlTitle;
+}
+
+WebString WebDragData::fileExtension() const
+{
+    ASSERT(!isNull());
+    return m_private->fileExtension;
+}
+
+void WebDragData::setFileExtension(const WebString& fileExtension)
+{
+    ensureMutable();
+    m_private->fileExtension = fileExtension;
+}
+
+bool WebDragData::hasFileNames() const
+{
+    ASSERT(!isNull());
+    return !m_private->filenames.isEmpty();
+}
+
+void WebDragData::fileNames(WebVector<WebString>& fileNames) const
+{
+    ASSERT(!isNull());
+    fileNames = m_private->filenames;
+}
+
+void WebDragData::setFileNames(const WebVector<WebString>& fileNames)
+{
+    ensureMutable();
+    m_private->filenames.clear();
+    m_private->filenames.append(fileNames.data(), fileNames.size());
+}
+
+void WebDragData::appendToFileNames(const WebString& fileName)
+{
+    ensureMutable();
+    m_private->filenames.append(fileName);
+}
+
+WebString WebDragData::plainText() const
+{
+    ASSERT(!isNull());
+    return m_private->plainText;
+}
+
+void WebDragData::setPlainText(const WebString& plainText)
+{
+    ensureMutable();
+    m_private->plainText = plainText;
+}
+
+WebString WebDragData::htmlText() const
+{
+    ASSERT(!isNull());
+    return m_private->textHtml;
+}
+
+void WebDragData::setHTMLText(const WebString& htmlText)
+{
+    ensureMutable();
+    m_private->textHtml = htmlText;
+}
+
+WebURL WebDragData::htmlBaseURL() const
+{
+    ASSERT(!isNull());
+    return m_private->htmlBaseUrl;
+}
+
+void WebDragData::setHTMLBaseURL(const WebURL& htmlBaseURL)
+{
+    ensureMutable();
+    m_private->htmlBaseUrl = htmlBaseURL;
+}
+
+WebString WebDragData::fileContentFileName() const
+{
+    ASSERT(!isNull());
+    return m_private->fileContentFilename;
+}
+
+void WebDragData::setFileContentFileName(const WebString& fileName)
+{
+    ensureMutable();
+    m_private->fileContentFilename = fileName;
+}
+
+WebData WebDragData::fileContent() const
+{
+    ASSERT(!isNull());
+    return WebData(m_private->fileContent);
+}
+
+void WebDragData::setFileContent(const WebData& fileContent)
+{
+    ensureMutable();
+    m_private->fileContent = fileContent;
+}
+
+WebDragData::WebDragData(const WTF::PassRefPtr<WebCore::ChromiumDataObject>& data)
+    : m_private(static_cast<WebDragDataPrivate*>(data.releaseRef()))
+{
+}
+
+WebDragData& WebDragData::operator=(const WTF::PassRefPtr<WebCore::ChromiumDataObject>& data)
+{
+    assign(static_cast<WebDragDataPrivate*>(data.releaseRef()));
+    return *this;
+}
+
+WebDragData::operator WTF::PassRefPtr<WebCore::ChromiumDataObject>() const
+{
+    return PassRefPtr<ChromiumDataObject>(const_cast<WebDragDataPrivate*>(m_private));
+}
+
+void WebDragData::assign(WebDragDataPrivate* p)
+{
+    // p is already ref'd for us by the caller
+    if (m_private)
+        m_private->deref();
+    m_private = p;
+}
+
+void WebDragData::ensureMutable()
+{
+    ASSERT(!isNull());
+    if (!m_private->hasOneRef())
+        assign(static_cast<WebDragDataPrivate*>(m_private->copy().releaseRef()));
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebElement.cpp b/WebKit/chromium/src/WebElement.cpp
new file mode 100644
index 0000000..3f13ee1
--- /dev/null
+++ b/WebKit/chromium/src/WebElement.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebElement.h"
+
+#include "Element.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebElement::WebElement(const WTF::PassRefPtr<WebCore::Element>& elem)
+    : WebNode(elem.releaseRef())
+{
+}
+
+WebElement& WebElement::operator=(const WTF::PassRefPtr<WebCore::Element>& elem)
+{
+    WebNode::assign(elem.releaseRef());
+    return *this;
+}
+
+WebElement::operator WTF::PassRefPtr<Element>() const
+{
+    return PassRefPtr<Element>(static_cast<Element*>(m_private));
+}
+
+} // namespace WebKit
+

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list