[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
commit-queue at webkit.org
commit-queue at webkit.org
Sun Feb 20 22:58:25 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit f7c602e85a67d5f13dcfecf776e093dfd11adf00
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 14 21:59:45 2011 +0000
2011-01-14 Adam Klein <adamk at chromium.org>
Reviewed by Darin Fisher.
[Chromium] Replace BackForwardListClient with BackForwardControllerClient/BackForwardList
https://bugs.webkit.org/show_bug.cgi?id=42237
Remove Chromium-specific implementation from WebCore.
No tests added; this refactor should be covered by existing history-exercising tests.
* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* history/BackForwardListChromium.cpp: Removed.
* history/BackForwardListImpl.h:
2011-01-14 Adam Klein <adamk at chromium.org>
Reviewed by Darin Fisher.
[Chromium] Replace BackForwardListClient with BackForwardControllerClient/BackForwardList
https://bugs.webkit.org/show_bug.cgi?id=42237
Replace Chromium-specific BackForwardListClient in WebCore with a Chromium impl
of the BackForwardList interface.
* WebKit.gyp:
* src/BackForwardListChromium.cpp: Copied from WebKit/chromium/src/BackForwardListClientImpl.cpp.
(WebKit::BackForwardListChromium::create):
(WebKit::BackForwardListChromium::BackForwardListChromium):
(WebKit::BackForwardListChromium::~BackForwardListChromium):
(WebKit::BackForwardListChromium::addItem):
(WebKit::BackForwardListChromium::goToItem):
(WebKit::BackForwardListChromium::itemAtIndex):
(WebKit::BackForwardListChromium::backListCount):
(WebKit::BackForwardListChromium::forwardListCount):
(WebKit::BackForwardListChromium::isActive):
(WebKit::BackForwardListChromium::close):
* src/BackForwardListChromium.h: Copied from WebKit/chromium/src/BackForwardListClientImpl.h.
* src/BackForwardListClientImpl.cpp: Removed.
* src/BackForwardListClientImpl.h: Removed.
* src/FrameLoaderClientImpl.cpp:
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::loadHistoryItem):
(WebKit::WebFrameImpl::currentHistoryItem):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
* src/WebViewImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 440990e..96d4c7a 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-14 Adam Klein <adamk at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Replace BackForwardListClient with BackForwardControllerClient/BackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42237
+
+ Remove Chromium-specific implementation from WebCore.
+
+ No tests added; this refactor should be covered by existing history-exercising tests.
+
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * history/BackForwardListChromium.cpp: Removed.
+ * history/BackForwardListImpl.h:
+
2011-01-12 Satish Sampath <satish at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index 282296c..627f1c9 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -1323,9 +1323,6 @@
# Don't build IDBKeyPathBackendImpl. We have our own implementation.
['exclude', 'storage/IDBKeyPathBackendImpl\\.cpp$'],
- # Use history/BackForwardListChromium.cpp instead.
- ['exclude', 'history/BackForwardListImpl\\.cpp$'],
-
# Use loader/icon/IconDatabaseNone.cpp instead.
['exclude', 'loader/icon/IconDatabase\\.cpp$'],
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index 6552492..f4a239f 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -1589,7 +1589,6 @@
'history/BackForwardList.h',
'history/BackForwardListImpl.cpp',
'history/BackForwardListImpl.h',
- 'history/BackForwardListChromium.cpp',
'history/CachedFrame.cpp',
'history/CachedFrame.h',
'history/CachedFramePlatformData.h',
diff --git a/Source/WebCore/history/BackForwardListChromium.cpp b/Source/WebCore/history/BackForwardListChromium.cpp
deleted file mode 100644
index a22a147..0000000
--- a/Source/WebCore/history/BackForwardListChromium.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * 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:
- * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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 "BackForwardListImpl.h"
-
-#include "HistoryItem.h"
-#include "Logging.h"
-
-namespace WebCore {
-
-static const unsigned DefaultCapacity = 100;
-static const unsigned NoCurrentItemIndex = UINT_MAX;
-
-BackForwardListImpl::BackForwardListImpl(Page* page)
- : m_page(page)
- , m_client(0)
- , m_capacity(DefaultCapacity)
- , m_closed(true)
- , m_enabled(true)
-{
-}
-
-BackForwardListImpl::~BackForwardListImpl()
-{
- ASSERT(m_closed);
-}
-
-void BackForwardListImpl::addItem(PassRefPtr<HistoryItem> prpItem)
-{
- ASSERT(prpItem);
- if (m_capacity == 0 || !m_enabled)
- return;
-
- m_client->addItem(prpItem);
-}
-
-void BackForwardListImpl::goToItem(HistoryItem* item)
-{
- m_client->goToItem(item);
-}
-
-int BackForwardListImpl::capacity()
-{
- return m_capacity;
-}
-
-void BackForwardListImpl::setCapacity(int size)
-{
- m_capacity = size;
-}
-
-bool BackForwardListImpl::enabled()
-{
- return m_enabled;
-}
-
-void BackForwardListImpl::setEnabled(bool enabled)
-{
- m_enabled = enabled;
- if (!enabled) {
- int capacity = m_capacity;
- setCapacity(0);
- setCapacity(capacity);
- }
-}
-
-int BackForwardListImpl::backListCount()
-{
- return m_client->backListCount();
-}
-
-int BackForwardListImpl::forwardListCount()
-{
- return m_client->forwardListCount();
-}
-
-HistoryItem* BackForwardListImpl::itemAtIndex(int index)
-{
- return m_client->itemAtIndex(index);
-}
-
-HistoryItemVector& BackForwardListImpl::entries()
-{
- static HistoryItemVector noEntries;
- return noEntries;
-}
-
-void BackForwardListImpl::close()
-{
- if (m_client)
- m_client->close();
- m_page = 0;
- m_closed = true;
-}
-
-bool BackForwardListImpl::closed()
-{
- return m_closed;
-}
-
-void BackForwardListImpl::goBack()
-{
- ASSERT_NOT_REACHED();
-}
-
-void BackForwardListImpl::goForward()
-{
- ASSERT_NOT_REACHED();
-}
-
-void BackForwardListImpl::backListWithLimit(int, HistoryItemVector&)
-{
- ASSERT_NOT_REACHED();
-}
-
-void BackForwardListImpl::forwardListWithLimit(int, HistoryItemVector&)
-{
- ASSERT_NOT_REACHED();
-}
-
-bool BackForwardListImpl::containsItem(HistoryItem*)
-{
- ASSERT_NOT_REACHED();
- return false;
-}
-
-void BackForwardListImpl::removeItem(HistoryItem*)
-{
- ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/history/BackForwardListImpl.h b/Source/WebCore/history/BackForwardListImpl.h
index 30043fa..7b1a422 100644
--- a/Source/WebCore/history/BackForwardListImpl.h
+++ b/Source/WebCore/history/BackForwardListImpl.h
@@ -39,25 +39,6 @@ class Page;
typedef Vector<RefPtr<HistoryItem> > HistoryItemVector;
typedef HashSet<RefPtr<HistoryItem> > HistoryItemHashSet;
-// FIXME: Change Chromium to use its own BackForwardList implementation
-// and not use BackForwardListImpl at all, then remove this
-// BackForwardListClient feature entirely and just don't use this
-// class on Chromium.
-#if PLATFORM(CHROMIUM)
-// In the Chromium port, the back/forward list is managed externally.
-// See BackForwardListChromium.cpp
-class BackForwardListClient {
-public:
- virtual ~BackForwardListClient() { }
- virtual void addItem(PassRefPtr<HistoryItem>) = 0;
- virtual void goToItem(HistoryItem*) = 0;
- virtual HistoryItem* itemAtIndex(int) = 0;
- virtual int backListCount() = 0;
- virtual int forwardListCount() = 0;
- virtual void close() = 0;
-};
-#endif
-
// FIXME: After renaming BackForwardList to BackForwardClient,
// rename this to BackForwardList.
class BackForwardListImpl : public BackForwardList {
@@ -65,11 +46,6 @@ public:
static PassRefPtr<BackForwardListImpl> create(Page* page) { return adoptRef(new BackForwardListImpl(page)); }
virtual ~BackForwardListImpl();
-#if PLATFORM(CHROMIUM)
- // Must be called before any other methods.
- void setClient(BackForwardListClient* client) { m_client = client; }
-#endif
-
Page* page() { return m_page; }
virtual void addItem(PassRefPtr<HistoryItem>);
@@ -109,13 +85,9 @@ private:
virtual bool isActive() { return enabled() && capacity(); }
Page* m_page;
-#if PLATFORM(CHROMIUM)
- BackForwardListClient* m_client;
-#else
HistoryItemVector m_entries;
HistoryItemHashSet m_entryHash;
unsigned m_current;
-#endif
unsigned m_capacity;
bool m_closed;
bool m_enabled;
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 0735185..4fe16e0 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,36 @@
+2011-01-14 Adam Klein <adamk at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Replace BackForwardListClient with BackForwardControllerClient/BackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42237
+
+ Replace Chromium-specific BackForwardListClient in WebCore with a Chromium impl
+ of the BackForwardList interface.
+
+ * WebKit.gyp:
+ * src/BackForwardListChromium.cpp: Copied from WebKit/chromium/src/BackForwardListClientImpl.cpp.
+ (WebKit::BackForwardListChromium::create):
+ (WebKit::BackForwardListChromium::BackForwardListChromium):
+ (WebKit::BackForwardListChromium::~BackForwardListChromium):
+ (WebKit::BackForwardListChromium::addItem):
+ (WebKit::BackForwardListChromium::goToItem):
+ (WebKit::BackForwardListChromium::itemAtIndex):
+ (WebKit::BackForwardListChromium::backListCount):
+ (WebKit::BackForwardListChromium::forwardListCount):
+ (WebKit::BackForwardListChromium::isActive):
+ (WebKit::BackForwardListChromium::close):
+ * src/BackForwardListChromium.h: Copied from WebKit/chromium/src/BackForwardListClientImpl.h.
+ * src/BackForwardListClientImpl.cpp: Removed.
+ * src/BackForwardListClientImpl.h: Removed.
+ * src/FrameLoaderClientImpl.cpp:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::loadHistoryItem):
+ (WebKit::WebFrameImpl::currentHistoryItem):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+
2011-01-14 Kent Tamura <tkent at chromium.org>
Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 904a238..661fb8b 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -307,8 +307,8 @@
'src/AudioDestinationChromium.h',
'src/AutoFillPopupMenuClient.cpp',
'src/AutoFillPopupMenuClient.h',
- 'src/BackForwardListClientImpl.cpp',
- 'src/BackForwardListClientImpl.h',
+ 'src/BackForwardListChromium.cpp',
+ 'src/BackForwardListChromium.h',
'src/BlobRegistryProxy.cpp',
'src/BlobRegistryProxy.h',
'src/BoundObject.cpp',
diff --git a/WebKit/chromium/src/BackForwardListChromium.cpp b/WebKit/chromium/src/BackForwardListChromium.cpp
new file mode 100644
index 0000000..be2a72b
--- /dev/null
+++ b/WebKit/chromium/src/BackForwardListChromium.cpp
@@ -0,0 +1,131 @@
+/*
+ * 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 "BackForwardListChromium.h"
+
+#include "HistoryItem.h"
+#include "WebViewClient.h"
+#include "WebViewImpl.h"
+#include <wtf/text/StringConcatenate.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+const char backForwardNavigationScheme[] = "chrome-back-forward";
+
+PassRefPtr<BackForwardListChromium> BackForwardListChromium::create(WebViewImpl* webView)
+{
+ return adoptRef(new BackForwardListChromium(webView));
+}
+
+BackForwardListChromium::BackForwardListChromium(WebViewImpl* webView)
+ : m_webView(webView)
+{
+}
+
+BackForwardListChromium::~BackForwardListChromium()
+{
+}
+
+void BackForwardListChromium::addItem(PassRefPtr<HistoryItem> item)
+{
+ m_currentItem = item;
+
+ // If WebCore adds a new HistoryItem, it means this is a new navigation (ie,
+ // not a reload or back/forward).
+ m_webView->observeNewNavigation();
+
+ if (m_webView->client())
+ m_webView->client()->didAddHistoryItem();
+}
+
+void BackForwardListChromium::goToItem(HistoryItem* item)
+{
+ m_currentItem = item;
+
+ if (m_pendingHistoryItem == item)
+ m_pendingHistoryItem = 0;
+}
+
+HistoryItem* BackForwardListChromium::itemAtIndex(int index)
+{
+ if (!m_webView->client())
+ return 0;
+
+ if (!index)
+ return m_currentItem.get();
+
+ if (index > forwardListCount() || -index > backListCount())
+ return 0;
+
+ // Since we don't keep the entire back/forward list, we have no way to
+ // properly implement this method. We return a dummy entry instead that we
+ // intercept in our FrameLoaderClient implementation in case WebCore asks
+ // to navigate to this HistoryItem.
+
+ // FIXME: We should change WebCore to handle history.{back,forward,go}
+ // differently. It should perhaps just ask the FrameLoaderClient to
+ // perform those navigations.
+
+ String urlString = makeString(backForwardNavigationScheme, "://go/", String::number(index));
+ m_pendingHistoryItem = HistoryItem::create(urlString, String(), 0);
+ return m_pendingHistoryItem.get();
+}
+
+int BackForwardListChromium::backListCount()
+{
+ if (!m_webView->client())
+ return 0;
+
+ return m_webView->client()->historyBackListCount();
+}
+
+int BackForwardListChromium::forwardListCount()
+{
+ if (!m_webView->client())
+ return 0;
+
+ return m_webView->client()->historyForwardListCount();
+}
+
+bool BackForwardListChromium::isActive()
+{
+ return m_webView->client();
+}
+
+void BackForwardListChromium::close()
+{
+ m_currentItem = 0;
+ m_pendingHistoryItem = 0;
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/BackForwardListChromium.h b/WebKit/chromium/src/BackForwardListChromium.h
new file mode 100644
index 0000000..c8f6f15
--- /dev/null
+++ b/WebKit/chromium/src/BackForwardListChromium.h
@@ -0,0 +1,70 @@
+/*
+ * 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 BackForwardListChromium_h
+#define BackForwardListChromium_h
+
+#include "BackForwardList.h"
+#include "HistoryItem.h"
+
+namespace WebKit {
+class WebViewImpl;
+
+extern const char backForwardNavigationScheme[];
+
+class BackForwardListChromium : public WebCore::BackForwardList {
+public:
+ static PassRefPtr<BackForwardListChromium> create(WebViewImpl*);
+ virtual ~BackForwardListChromium();
+
+private:
+ BackForwardListChromium(WebViewImpl*);
+
+ // WebCore::BackForwardList methods:
+ virtual void addItem(PassRefPtr<WebCore::HistoryItem>);
+ virtual void goToItem(WebCore::HistoryItem*);
+ virtual WebCore::HistoryItem* itemAtIndex(int index);
+ virtual int backListCount();
+ virtual int forwardListCount();
+ virtual bool isActive();
+ virtual void close();
+
+ WebViewImpl* m_webView;
+
+ RefPtr<WebCore::HistoryItem> m_currentItem;
+
+ // The last history item that was accessed via itemAtIndex(). We keep track
+ // of this until goToItem() is called, so we can track the navigation.
+ RefPtr<WebCore::HistoryItem> m_pendingHistoryItem;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/BackForwardListClientImpl.cpp b/WebKit/chromium/src/BackForwardListClientImpl.cpp
deleted file mode 100644
index af659bc..0000000
--- a/WebKit/chromium/src/BackForwardListClientImpl.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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 "BackForwardListClientImpl.h"
-
-#include "HistoryItem.h"
-#include "WebViewClient.h"
-#include "WebViewImpl.h"
-#include <wtf/text/StringConcatenate.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-const char backForwardNavigationScheme[] = "chrome-back-forward";
-
-BackForwardListClientImpl::BackForwardListClientImpl(WebViewImpl* webView)
- : m_webView(webView)
-{
-}
-
-BackForwardListClientImpl::~BackForwardListClientImpl()
-{
-}
-
-void BackForwardListClientImpl::setCurrentHistoryItem(HistoryItem* item)
-{
- m_previousItem = m_currentItem;
- m_currentItem = item;
-}
-
-HistoryItem* BackForwardListClientImpl::previousHistoryItem() const
-{
- return m_previousItem.get();
-}
-
-void BackForwardListClientImpl::addItem(PassRefPtr<HistoryItem> item)
-{
- m_previousItem = m_currentItem;
- m_currentItem = item;
-
- // If WebCore adds a new HistoryItem, it means this is a new navigation (ie,
- // not a reload or back/forward).
- m_webView->observeNewNavigation();
-
- if (m_webView->client())
- m_webView->client()->didAddHistoryItem();
-}
-
-void BackForwardListClientImpl::goToItem(HistoryItem* item)
-{
- m_previousItem = m_currentItem;
- m_currentItem = item;
-
- if (m_pendingHistoryItem == item)
- m_pendingHistoryItem = 0;
-}
-
-HistoryItem* BackForwardListClientImpl::itemAtIndex(int index)
-{
- if (!m_webView->client())
- return 0;
-
- if (!index)
- return m_currentItem.get();
-
- if (index > forwardListCount() || -index > backListCount())
- return 0;
-
- // Since we don't keep the entire back/forward list, we have no way to
- // properly implement this method. We return a dummy entry instead that we
- // intercept in our FrameLoaderClient implementation in case WebCore asks
- // to navigate to this HistoryItem.
-
- // FIXME: We should change WebCore to handle history.{back,forward,go}
- // differently. It should perhaps just ask the FrameLoaderClient to
- // perform those navigations.
-
- String urlString = makeString(backForwardNavigationScheme, "://go/", String::number(index));
- m_pendingHistoryItem = HistoryItem::create(urlString, String(), 0);
- return m_pendingHistoryItem.get();
-}
-
-int BackForwardListClientImpl::backListCount()
-{
- if (!m_webView->client())
- return 0;
-
- return m_webView->client()->historyBackListCount();
-}
-
-int BackForwardListClientImpl::forwardListCount()
-{
- if (!m_webView->client())
- return 0;
-
- return m_webView->client()->historyForwardListCount();
-}
-
-void BackForwardListClientImpl::close()
-{
- m_currentItem = 0;
- m_previousItem = 0;
- m_pendingHistoryItem = 0;
-}
-
-} // namespace WebKit
diff --git a/WebKit/chromium/src/BackForwardListClientImpl.h b/WebKit/chromium/src/BackForwardListClientImpl.h
deleted file mode 100644
index b795ecf..0000000
--- a/WebKit/chromium/src/BackForwardListClientImpl.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 BackForwardListClientImpl_h
-#define BackForwardListClientImpl_h
-
-#include "BackForwardListImpl.h"
-
-namespace WebKit {
-class WebViewImpl;
-
-extern const char backForwardNavigationScheme[];
-
-class BackForwardListClientImpl : public WebCore::BackForwardListClient {
-public:
- BackForwardListClientImpl(WebViewImpl* webview);
- ~BackForwardListClientImpl();
-
- void setCurrentHistoryItem(WebCore::HistoryItem* item);
- WebCore::HistoryItem* previousHistoryItem() const;
-
-private:
- // WebCore::BackForwardListClient methods:
- virtual void addItem(PassRefPtr<WebCore::HistoryItem>);
- virtual void goToItem(WebCore::HistoryItem*);
- virtual WebCore::HistoryItem* itemAtIndex(int index);
- virtual int backListCount();
- virtual int forwardListCount();
- virtual void close();
-
- WebViewImpl* m_webView;
-
- RefPtr<WebCore::HistoryItem> m_previousItem;
- RefPtr<WebCore::HistoryItem> m_currentItem;
-
- // The last history item that was accessed via itemAtIndex(). We keep track
- // of this until goToItem() is called, so we can track the navigation.
- RefPtr<WebCore::HistoryItem> m_pendingHistoryItem;
-};
-
-} // namespace WebKit
-
-#endif
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index c84889e..b767450 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "FrameLoaderClientImpl.h"
+#include "BackForwardListChromium.h"
#include "Chrome.h"
#include "Document.h"
#include "DocumentLoader.h"
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index f44da9e..a13eec0 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -72,6 +72,7 @@
#include "WebFrameImpl.h"
#include "AssociatedURLLoader.h"
+#include "BackForwardController.h"
#include "Chrome.h"
#include "ChromiumBridge.h"
#include "ClipboardUtilitiesChromium.h"
@@ -890,7 +891,7 @@ void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
currentItem = HistoryItem::create();
currentItem->setLastVisitWasFailure(true);
m_frame->loader()->history()->setCurrentItem(currentItem.get());
- viewImpl()->setCurrentHistoryItem(currentItem.get());
+ m_frame->page()->backForward()->setCurrentItem(currentItem.get());
}
m_frame->loader()->history()->goToItem(
@@ -992,7 +993,7 @@ WebHistoryItem WebFrameImpl::currentHistoryItem() const
|| !m_frame->loader()->activeDocumentLoader()->isLoadingInAPISense())
m_frame->loader()->history()->saveDocumentAndScrollState();
- return WebHistoryItem(m_frame->page()->backForwardList()->currentItem());
+ return WebHistoryItem(m_frame->page()->backForward()->currentItem());
}
void WebFrameImpl::enableViewSourceMode(bool enable)
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 44efeea..bcd97c4 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -33,7 +33,7 @@
#include "AutoFillPopupMenuClient.h"
#include "AXObjectCache.h"
-#include "BackForwardListImpl.h"
+#include "BackForwardListChromium.h"
#include "Chrome.h"
#include "ChromiumBridge.h"
#include "ColorSpace.h"
@@ -274,7 +274,6 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient)
WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient)
: m_client(client)
, m_autoFillClient(autoFillClient)
- , m_backForwardListClientImpl(this)
, m_chromeClientImpl(this)
, m_contextMenuClientImpl(this)
, m_dragClientImpl(this)
@@ -338,12 +337,12 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
#endif
pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get();
pageClients.geolocationClient = m_geolocationClientProxy.get();
+ pageClients.backForwardClient = BackForwardListChromium::create(this);
m_page.set(new Page(pageClients));
m_geolocationClientProxy->setController(m_page->geolocationController());
- static_cast<BackForwardListImpl*>(m_page->backForwardList())->setClient(&m_backForwardListClientImpl);
m_page->setGroupName(pageGroupName);
m_inspectorSettingsMap.set(new SettingsMap);
@@ -2165,16 +2164,6 @@ void WebViewImpl::startDragging(const WebDragData& dragData,
m_client->startDragging(dragData, mask, dragImage, dragImageOffset);
}
-void WebViewImpl::setCurrentHistoryItem(HistoryItem* item)
-{
- m_backForwardListClientImpl.setCurrentHistoryItem(item);
-}
-
-HistoryItem* WebViewImpl::previousHistoryItem()
-{
- return m_backForwardListClientImpl.previousHistoryItem();
-}
-
void WebViewImpl::observeNewNavigation()
{
m_observedNewNavigation = true;
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index c9ecc16..bc79ec1 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -38,7 +38,6 @@
#include "WebString.h"
#include "WebView.h"
-#include "BackForwardListClientImpl.h"
#include "ChromeClientImpl.h"
#include "ContextMenuClientImpl.h"
#include "DragClientImpl.h"
@@ -239,8 +238,6 @@ public:
WebFrameImpl* mainFrameImpl();
// History related methods:
- void setCurrentHistoryItem(WebCore::HistoryItem*);
- WebCore::HistoryItem* previousHistoryItem();
void observeNewNavigation();
// Event related methods:
@@ -410,7 +407,6 @@ private:
WebViewClient* m_client;
WebAutoFillClient* m_autoFillClient;
- BackForwardListClientImpl m_backForwardListClientImpl;
ChromeClientImpl m_chromeClientImpl;
ContextMenuClientImpl m_contextMenuClientImpl;
DragClientImpl m_dragClientImpl;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list