[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tkent at chromium.org tkent at chromium.org
Wed Dec 22 11:43:36 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8a875a2972df8c7387a31b194e9a98e905deb09f
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 5 05:20:40 2010 +0000

    2010-08-04  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            [DRT/Chromium] Remove base/linked_ptr.h dependency
            https://bugs.webkit.org/show_bug.cgi?id=43472
    
            Replace linked_ptr<TestNavigationEntry> with RefPtr<TestNavigationEntry>.
            We need to use RefPtr<> because m_pendingEntry points an object in
            m_entries or not in m_entries.
    
            * DumpRenderTree/chromium/TestNavigationController.cpp:
            (TestNavigationEntry::create): Added.
            (TestNavigationController::activeEntry):
            (TestNavigationController::didNavigateToEntry):
            (TestNavigationController::discardPendingEntry):
            (TestNavigationController::insertEntry):
            (TestNavigationController::navigateToPendingEntry):
            * DumpRenderTree/chromium/TestNavigationController.h:
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::loadURLForFrame):
             Use TestNavigationEntry::create().
            (WebViewHost::updateURL):
             Use RefPtr<>.
            (WebViewHost::updateSessionHistory):
             Remove unnecessary static_cast<>.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64710 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 3316848..5e90958 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,33 @@
 
         Reviewed by Dimitri Glazkov.
 
+        [DRT/Chromium] Remove base/linked_ptr.h dependency
+        https://bugs.webkit.org/show_bug.cgi?id=43472
+
+        Replace linked_ptr<TestNavigationEntry> with RefPtr<TestNavigationEntry>.
+        We need to use RefPtr<> because m_pendingEntry points an object in
+        m_entries or not in m_entries.
+
+        * DumpRenderTree/chromium/TestNavigationController.cpp:
+        (TestNavigationEntry::create): Added.
+        (TestNavigationController::activeEntry):
+        (TestNavigationController::didNavigateToEntry):
+        (TestNavigationController::discardPendingEntry):
+        (TestNavigationController::insertEntry):
+        (TestNavigationController::navigateToPendingEntry):
+        * DumpRenderTree/chromium/TestNavigationController.h:
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::loadURLForFrame):
+         Use TestNavigationEntry::create().
+        (WebViewHost::updateURL):
+         Use RefPtr<>.
+        (WebViewHost::updateSessionHistory):
+         Remove unnecessary static_cast<>.
+
+2010-08-04  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
         Fix a problem that "archived test results" step doesn't work on Chromium buildbots
         https://bugs.webkit.org/show_bug.cgi?id=43333
 
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
index 8b4f954..9653c07 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
@@ -40,6 +40,17 @@ using namespace std;
 // ----------------------------------------------------------------------------
 // TestNavigationEntry
 
+PassRefPtr<TestNavigationEntry> TestNavigationEntry::create()
+{
+    return adoptRef(new TestNavigationEntry);
+}
+
+PassRefPtr<TestNavigationEntry> TestNavigationEntry::create(
+    int pageID, const WebURL& url, const WebString& title, const WebString& targetFrame)
+{
+    return adoptRef(new TestNavigationEntry(pageID, url, title, targetFrame));
+}
+
 TestNavigationEntry::TestNavigationEntry()
     : m_pageID(-1) {}
 
@@ -136,7 +147,7 @@ TestNavigationEntry* TestNavigationController::lastCommittedEntry() const
 
 TestNavigationEntry* TestNavigationController::activeEntry() const
 {
-    TestNavigationEntry* entry = m_pendingEntry;
+    TestNavigationEntry* entry = m_pendingEntry.get();
     if (!entry)
         entry = lastCommittedEntry();
     return entry;
@@ -182,14 +193,14 @@ void TestNavigationController::didNavigateToEntry(TestNavigationEntry* entry)
         m_entries[existingEntryIndex].get() : 0;
     if (!existingEntry) {
         // No existing entry, then simply ignore this navigation!
-    } else if (existingEntry == m_pendingEntry) {
+    } else if (existingEntry == m_pendingEntry.get()) {
         // The given entry might provide a new URL... e.g., navigating back to a
         // page in session history could have resulted in a new client redirect.
         existingEntry->setURL(entry->URL());
         existingEntry->setContentState(entry->contentState());
         m_lastCommittedEntryIndex = m_pendingEntryIndex;
         m_pendingEntryIndex = -1;
-        m_pendingEntry = 0;
+        m_pendingEntry.clear();
     } else if (m_pendingEntry && m_pendingEntry->pageID() == -1
                && GURL(m_pendingEntry->URL()) == GURL(existingEntry->URL().spec())) {
         // Not a new navigation
@@ -206,15 +217,12 @@ void TestNavigationController::didNavigateToEntry(TestNavigationEntry* entry)
         m_lastCommittedEntryIndex = existingEntryIndex;
     }
 
-    delete entry;
     updateMaxPageID();
 }
 
 void TestNavigationController::discardPendingEntry()
 {
-    if (m_pendingEntryIndex == -1)
-        delete m_pendingEntry;
-    m_pendingEntry = 0;
+    m_pendingEntry.clear();
     m_pendingEntryIndex = -1;
 }
 
@@ -231,7 +239,7 @@ void TestNavigationController::insertEntry(TestNavigationEntry* entry)
         }
     }
 
-    m_entries.append(linked_ptr<TestNavigationEntry>(entry));
+    m_entries.append(RefPtr<TestNavigationEntry>(entry));
     m_lastCommittedEntryIndex = static_cast<int>(m_entries.size()) - 1;
     updateMaxPageID();
 }
@@ -250,10 +258,10 @@ void TestNavigationController::navigateToPendingEntry(bool reload)
     // For session history navigations only the pending_entry_index_ is set.
     if (!m_pendingEntry) {
         ASSERT(m_pendingEntryIndex != -1);
-        m_pendingEntry = m_entries[m_pendingEntryIndex].get();
+        m_pendingEntry = m_entries[m_pendingEntryIndex];
     }
 
-    if (m_host->navigate(*m_pendingEntry, reload)) {
+    if (m_host->navigate(*m_pendingEntry.get(), reload)) {
         // Note: this is redundant if navigation completed synchronously because
         // DidNavigateToEntry call this as well.
         updateMaxPageID();
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
index 5a80550..d75c3bf 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
@@ -31,13 +31,14 @@
 #ifndef TestNavigationController_h
 #define TestNavigationController_h
 
-#include "base/linked_ptr.h"
 #include "public/WebDataSource.h"
 #include "public/WebHistoryItem.h"
 #include "public/WebString.h"
 #include "public/WebURL.h"
 #include "webkit/support/webkit_support.h"
 #include <string>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
 // Associated with browser-initated navigations to hold tracking data.
@@ -56,16 +57,17 @@ public:
 };
 
 // Stores one back/forward navigation state for the test shell.
-class TestNavigationEntry: public Noncopyable {
+class TestNavigationEntry: public RefCounted<TestNavigationEntry> {
 public:
-    TestNavigationEntry();
-    TestNavigationEntry(int pageID,
-                        const WebKit::WebURL&,
-                        const WebKit::WebString& title,
-                        const WebKit::WebString& targetFrame);
+    static PassRefPtr<TestNavigationEntry> create();
+    static PassRefPtr<TestNavigationEntry> create(
+        int pageID,
+        const WebKit::WebURL&,
+        const WebKit::WebString& title,
+        const WebKit::WebString& targetFrame);
 
     // Virtual to allow test_shell to extend the class.
-    ~TestNavigationEntry();
+    virtual ~TestNavigationEntry();
 
     // Set / Get the URI
     void setURL(const WebKit::WebURL& url) { m_url = url; }
@@ -86,6 +88,12 @@ public:
     const WebKit::WebString& targetFrame() const { return m_targetFrame; }
 
 private:
+    TestNavigationEntry();
+    TestNavigationEntry(int pageID,
+                        const WebKit::WebURL&,
+                        const WebKit::WebString& title,
+                        const WebKit::WebString& targetFrame);
+
     // Describes the current page that the tab represents. This is not relevant
     // for all tab contents types.
     int32_t m_pageID;
@@ -120,8 +128,7 @@ public:
     // Causes the controller to go to the specified index.
     void goToIndex(int);
 
-    // Causes the controller to load the specified entry.  The controller
-    // assumes ownership of the entry.
+    // Causes the controller to load the specified entry.
     // NOTE: Do not pass an entry that the controller already owns!
     void loadEntry(TestNavigationEntry*);
 
@@ -156,9 +163,9 @@ public:
     // Returns the index of the last committed entry.
     int lastCommittedEntryIndex() const { return m_lastCommittedEntryIndex; }
 
-    // Used to inform us of a navigation being committed for a tab. We will take
-    // ownership of the entry. Any entry located forward to the current entry will
-    // be deleted. The new entry becomes the current entry.
+    // Used to inform us of a navigation being committed for a tab. Any entry
+    // located forward to the current entry will be deleted. The new entry
+    // becomes the current entry.
     void didNavigateToEntry(TestNavigationEntry*);
 
     // Used to inform us to discard its pending entry.
@@ -180,14 +187,14 @@ private:
     void updateMaxPageID();
 
     // List of NavigationEntry for this tab
-    typedef Vector<linked_ptr<TestNavigationEntry> > NavigationEntryList;
+    typedef Vector<RefPtr<TestNavigationEntry> > NavigationEntryList;
     typedef NavigationEntryList::iterator NavigationEntryListIterator;
     NavigationEntryList m_entries;
 
     // An entry we haven't gotten a response for yet.  This will be discarded
     // when we navigate again.  It's used only so we know what the currently
     // displayed tab is.
-    TestNavigationEntry* m_pendingEntry;
+    RefPtr<TestNavigationEntry> m_pendingEntry;
 
     // currently visible entry
     int m_lastCommittedEntryIndex;
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index ed37a31..b761150 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -1047,7 +1047,7 @@ void WebViewHost::loadURLForFrame(const WebURL& url, const WebString& frameName)
     if (!url.isValid())
         return;
     TestShell::resizeWindowForTest(this, url);
-    navigationController()->loadEntry(new TestNavigationEntry(-1, url, WebString(), frameName));
+    navigationController()->loadEntry(TestNavigationEntry::create(-1, url, WebString(), frameName).get());
 }
 
 bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload)
@@ -1146,7 +1146,7 @@ void WebViewHost::updateURL(WebFrame* frame)
     WebDataSource* ds = frame->dataSource();
     ASSERT(ds);
     const WebURLRequest& request = ds->request();
-    OwnPtr<TestNavigationEntry> entry(new TestNavigationEntry);
+    RefPtr<TestNavigationEntry> entry(TestNavigationEntry::create());
 
     // The referrer will be empty on https->http transitions. It
     // would be nice if we could get the real referrer from somewhere.
@@ -1160,7 +1160,7 @@ void WebViewHost::updateURL(WebFrame* frame)
     if (!historyItem.isNull())
         entry->setContentState(historyItem);
 
-    navigationController()->didNavigateToEntry(entry.leakPtr());
+    navigationController()->didNavigateToEntry(entry.get());
     updateAddressBar(frame->view());
     m_lastPageIdUpdated = max(m_lastPageIdUpdated, m_pageId);
 }
@@ -1173,7 +1173,7 @@ void WebViewHost::updateSessionHistory(WebFrame* frame)
     if (m_pageId == -1)
         return;
 
-    TestNavigationEntry* entry = static_cast<TestNavigationEntry*>(navigationController()->entryWithPageID(m_pageId));
+    TestNavigationEntry* entry = navigationController()->entryWithPageID(m_pageId);
     if (!entry)
         return;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list