Updates:
Status: Started
Cc: [email protected]
Comment #5 on issue 5638 by [email protected]: Closing a tab should do
fast shutdown (terminate) when possible
http://code.google.com/p/chromium/issues/detail?id=5638
(writing this down as much for my own benefit as everyone else's)
After further investigation, I have found that there are two different
variables that
track whether sudden termination is allowed. The first is on each render
view host,
and seems to only be set by the tab contents as an override when a tab is
hanging
during shutdown. The other variable is on the Render Process Host, and has
the
comment:
// True if the process can be shut down suddenly. If this is true, then
we're
// sure that all the RenderViews in the process can be shutdown
suddenly. If
// it's false, then specific RenderViews might still be allowed to be
shutdown
// suddenly by checking their SuddenTerminationAllowed() flag. This can
occur
// if one tab has an unload event listener but another tab in the same
process
// doesn't.
This comment describes the intended behavior, but not the actual behavior,
because
the SuddenTerminationChanged ViewHost message is a Control message, and not
a Routed
message, and includes no way of indicating for which render view the sudden
termination value has changed. So when the second tab that shares a process
changes
its sudden termination, the RPH does as well. Really, the RPH
allow_sudden_termination just tracks the value for the last-updated tab.
Here is the
renderer stack trace when it gets changed:
#0 WebCore::enableSuddenTermination () at
third_party/WebKit/WebCore/platform/chromium/SuddenTerminationChromium.cpp:45
#1 0x08f5954a in removeAllBeforeUnloadEventListeners (domWindow=0xbdb6958)
at
third_party/WebKit/WebCore/page/DOMWindow.cpp:173
#2 0x08f595df in WebCore::DOMWindow::removeAllEventListeners
(this=0xbdb6958) at
third_party/WebKit/WebCore/page/DOMWindow.cpp:1303
#3 0x08db1f16 in WebCore::Document::clear (this=0xbdb2220) at
third_party/WebKit/WebCore/dom/Document.cpp:1875
#4 0x08db75a4 in WebCore::Document::implicitOpen (this=0xbdb2220) at
third_party/WebKit/WebCore/dom/Document.cpp:1590
#5 0x08f1e0c0 in WebCore::FrameLoader::begin (this=0xbdb0ea4,
u...@0xff8872ac,
dispatch=false, origin=0x0)
at third_party/WebKit/WebCore/loader/FrameLoader.cpp:977
#6 0x08f20214 in WebCore::FrameLoader::init (this=0xbdb0ea4) at
third_party/WebKit/WebCore/loader/FrameLoader.cpp:313
#7 0x08f709bc in WebCore::Frame::init (this=0xbdb0e78) at
third_party/WebKit/WebCore/page/Frame.cpp:214
#8 0x0961caf0 in WebFrameImpl::InitMainFrame (this=0xbdb0d40,
webview_impl=0xbdaffd8) at webkit/glue/webframe_impl.cc:1520
#9 0x096438a3 in WebViewImpl::InitializeMainFrame (this=0xbdaffd8,
frame_client=0xbdafb98) at webkit/glue/webview_impl.cc:346
#10 0x085a2488 in RenderView::Init (this=0xbdafa80, parent_hwnd=-550954589,
modal_dialog_event=0xbd55d68, opener_id=-2,
renderer_pre...@0xff8878fc, counter=0xbd86678, routing_id=2) at
chrome/renderer/render_view.cc:310
#11 0x085a35d3 in RenderView::Create (render_thread=0xbd04ff8, parent_hwnd=-
550954589, modal_dialog_event=0xbd55d68, opener_id=-2,
renderer_pre...@0xff8878fc, webkit_pre...@0xff887910, counter=0xbd86678,
routing_id=2) at chrome/renderer/render_view.cc:264
#12 0x0858cdbc in RenderThread::OnCreateNewView (this=0xbd04ff8,
parent_hwnd=-
550954589, modal_dialog_event={<No data fields>},
renderer_pre...@0xff8878fc, webkit_pre...@0xff887910, view_id=2) at
chrome/renderer/render_thread.cc:323
It seems that WebKit assumes this is a global property since they/we choose
to call a
global static rather than somehow piping it back to the correct RenderView.
Is there
some easy way to get the "current" RenderView so we can make this a routed
message,
and do proper handling in RPH?
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---