Changeset 73373 in webkit
- Timestamp:
- Dec 6, 2010 9:35:05 AM (13 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r73367 r73373 1 2010-12-03 Tony Chang <tony@chromium.org> 2 3 Reviewed by Kent Tamura. 4 5 [chromium] fix 2 bugs with inspector tests in DRT 6 https://bugs.webkit.org/show_bug.cgi?id=50492 7 8 Tasks can outlive the tasklist (even when canceled) so this was 9 causing a crash when ~WebTask() ran. Avoid this by unregistering 10 when a task is canceled. 11 12 Also fix an assert when closing devtool windows by copying some 13 logic from test_shell. 14 15 * DumpRenderTree/chromium/Task.cpp: 16 (WebTask::~WebTask): 17 (TaskList::revokeAll): 18 * DumpRenderTree/chromium/Task.h: Canceling a task now removes it from 19 the tasklist (since the task can outlive the tasklist). 20 * DumpRenderTree/chromium/TestShell.h: 21 (TestShell::devToolsWebView): 22 * DumpRenderTree/chromium/WebViewHost.cpp: 23 (WebViewHost::~WebViewHost): Don't load about:blank when closing 24 a window if the window has devtools loaded. This avoids an 25 ASSERT and matches test_shell. 26 1 27 2010-12-06 Alejandro G. Castro <alex@igalia.com> 2 28 -
trunk/WebKitTools/DumpRenderTree/chromium/Task.cpp
r70064 r73373 37 37 38 38 WebTask::WebTask(TaskList* list): m_taskList(list) { m_taskList->registerTask(this); } 39 WebTask::~WebTask() { m_taskList->unregisterTask(this); } 39 WebTask::~WebTask() 40 { 41 if (m_taskList) 42 m_taskList->unregisterTask(this); 43 } 40 44 41 45 void TaskList::unregisterTask(WebTask* task) … … 48 52 void TaskList::revokeAll() 49 53 { 50 for (unsigned i = 0; i < m_tasks.size(); ++i) 51 m_tasks[i]->cancel(); 52 m_tasks.clear(); 54 while (!m_tasks.isEmpty()) 55 m_tasks[0]->cancel(); 53 56 } 54 57 -
trunk/WebKitTools/DumpRenderTree/chromium/Task.h
r66701 r73373 46 46 virtual void cancel() = 0; 47 47 virtual ~WebTask(); 48 pr ivate:48 protected: 49 49 TaskList* m_taskList; 50 50 }; … … 72 72 runIfValid(); 73 73 } 74 virtual void cancel() { m_object = 0; } 74 virtual void cancel() 75 { 76 m_object = 0; 77 m_taskList->unregisterTask(this); 78 m_taskList = 0; 79 } 75 80 virtual void runIfValid() = 0; 76 81 protected: -
trunk/WebKitTools/DumpRenderTree/chromium/TestShell.h
r71030 r73373 164 164 DRTDevToolsAgent* drtDevToolsAgent() { return m_drtDevToolsAgent.get(); } 165 165 DRTDevToolsClient* drtDevToolsClient() { return m_drtDevToolsClient.get(); } 166 WebViewHost* devToolsWebView() { return m_devTools; } 166 167 167 168 static const int virtualWindowBorder = 3; -
trunk/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
r72206 r73373 1112 1112 WebViewHost::~WebViewHost() 1113 1113 { 1114 // Navigate to an empty page to fire all the destruction logic for the 1115 // current page. 1116 loadURLForFrame(GURL("about:blank"), WebString()); 1114 // DevTools frontend page is supposed to be navigated only once and 1115 // loading another URL in that Page is an error. 1116 if (m_shell->devToolsWebView() != this) { 1117 // Navigate to an empty page to fire all the destruction logic for the 1118 // current page. 1119 loadURLForFrame(GURL("about:blank"), WebString()); 1120 } 1117 1121 1118 1122 // Call GC twice to clean up garbage.
Note: See TracChangeset
for help on using the changeset viewer.