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

tony at chromium.org tony at chromium.org
Wed Dec 22 18:03:03 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 20743780e0f55450ab3f2be5efdeaee8618939fa
Author: tony at chromium.org <tony at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 6 17:35:05 2010 +0000

    2010-12-03  Tony Chang  <tony at chromium.org>
    
            Reviewed by Kent Tamura.
    
            [chromium] fix 2 bugs with inspector tests in DRT
            https://bugs.webkit.org/show_bug.cgi?id=50492
    
            Tasks can outlive the tasklist (even when canceled) so this was
            causing a crash when ~WebTask() ran.  Avoid this by unregistering
            when a task is canceled.
    
            Also fix an assert when closing devtool windows by copying some
            logic from test_shell.
    
            * DumpRenderTree/chromium/Task.cpp:
            (WebTask::~WebTask):
            (TaskList::revokeAll):
            * DumpRenderTree/chromium/Task.h: Canceling a task now removes it from
                the tasklist (since the task can outlive the tasklist).
            * DumpRenderTree/chromium/TestShell.h:
            (TestShell::devToolsWebView):
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::~WebViewHost): Don't load about:blank when closing
                a window if the window has devtools loaded.  This avoids an
                ASSERT and matches test_shell.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ce2b852..74b30a3 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,29 @@
+2010-12-03  Tony Chang  <tony at chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        [chromium] fix 2 bugs with inspector tests in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=50492
+
+        Tasks can outlive the tasklist (even when canceled) so this was
+        causing a crash when ~WebTask() ran.  Avoid this by unregistering
+        when a task is canceled.
+
+        Also fix an assert when closing devtool windows by copying some
+        logic from test_shell.
+
+        * DumpRenderTree/chromium/Task.cpp:
+        (WebTask::~WebTask):
+        (TaskList::revokeAll):
+        * DumpRenderTree/chromium/Task.h: Canceling a task now removes it from
+            the tasklist (since the task can outlive the tasklist).
+        * DumpRenderTree/chromium/TestShell.h:
+        (TestShell::devToolsWebView):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::~WebViewHost): Don't load about:blank when closing
+            a window if the window has devtools loaded.  This avoids an
+            ASSERT and matches test_shell.
+
 2010-12-06  Alejandro G. Castro  <alex at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebKitTools/DumpRenderTree/chromium/Task.cpp b/WebKitTools/DumpRenderTree/chromium/Task.cpp
index 5719bac..007a479 100644
--- a/WebKitTools/DumpRenderTree/chromium/Task.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/Task.cpp
@@ -36,7 +36,11 @@
 #include "webkit/support/webkit_support.h"
 
 WebTask::WebTask(TaskList* list): m_taskList(list) { m_taskList->registerTask(this); }
-WebTask::~WebTask() { m_taskList->unregisterTask(this); }
+WebTask::~WebTask()
+{
+    if (m_taskList)
+        m_taskList->unregisterTask(this);
+}
 
 void TaskList::unregisterTask(WebTask* task)
 {
@@ -47,9 +51,8 @@ void TaskList::unregisterTask(WebTask* task)
 
 void TaskList::revokeAll()
 {
-    for (unsigned i = 0; i < m_tasks.size(); ++i)
-        m_tasks[i]->cancel();
-    m_tasks.clear();
+    while (!m_tasks.isEmpty())
+        m_tasks[0]->cancel();
 }
 
 static void invokeTask(void* context)
diff --git a/WebKitTools/DumpRenderTree/chromium/Task.h b/WebKitTools/DumpRenderTree/chromium/Task.h
index 39fb8f2..f29dc7d 100644
--- a/WebKitTools/DumpRenderTree/chromium/Task.h
+++ b/WebKitTools/DumpRenderTree/chromium/Task.h
@@ -45,7 +45,7 @@ public:
     virtual void run() = 0;
     virtual void cancel() = 0;
     virtual ~WebTask();
-private:
+protected:
     TaskList* m_taskList;
 };
 
@@ -71,7 +71,12 @@ public:
         if (m_object)
             runIfValid();
     }
-    virtual void cancel() { m_object = 0; }
+    virtual void cancel()
+    {
+        m_object = 0;
+        m_taskList->unregisterTask(this);
+        m_taskList = 0;
+    }
     virtual void runIfValid() = 0;
 protected:
     T* m_object;
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index 06e77cc..1da4e17 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -163,6 +163,7 @@ public:
 
     DRTDevToolsAgent* drtDevToolsAgent() { return m_drtDevToolsAgent.get(); }
     DRTDevToolsClient* drtDevToolsClient() { return m_drtDevToolsClient.get(); }
+    WebViewHost* devToolsWebView() { return m_devTools; }
 
     static const int virtualWindowBorder = 3;
 
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index 87fbaca..6b97c74 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -1111,9 +1111,13 @@ WebViewHost::WebViewHost(TestShell* shell)
 
 WebViewHost::~WebViewHost()
 {
-    // Navigate to an empty page to fire all the destruction logic for the
-    // current page.
-    loadURLForFrame(GURL("about:blank"), WebString());
+    // DevTools frontend page is supposed to be navigated only once and
+    // loading another URL in that Page is an error.
+    if (m_shell->devToolsWebView() != this) {
+        // Navigate to an empty page to fire all the destruction logic for the
+        // current page.
+        loadURLForFrame(GURL("about:blank"), WebString());
+    }
 
     // Call GC twice to clean up garbage.
     m_shell->callJSGC();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list