зеркало из https://github.com/electron/electron.git
Do not override pending unresponsive counter.
This commit is contained in:
Родитель
1321fb8151
Коммит
146ce284de
|
@ -457,8 +457,12 @@ bool NativeWindow::IsPopupOrPanel(const content::WebContents* source) const {
|
||||||
|
|
||||||
void NativeWindow::RendererUnresponsive(content::WebContents* source) {
|
void NativeWindow::RendererUnresponsive(content::WebContents* source) {
|
||||||
// Schedule the unresponsive shortly later, since we may receive the
|
// Schedule the unresponsive shortly later, since we may receive the
|
||||||
// responsive event soon.
|
// responsive event soon. This could happen after the whole application had
|
||||||
// This could happen after the whole application had blocked for a while.
|
// blocked for a while.
|
||||||
|
// Also notice that when closing this event would be ignored because we have
|
||||||
|
// explicity started a close timeout counter. This is on purpose because we
|
||||||
|
// don't want the unresponsive event to be sent too early when user is closing
|
||||||
|
// the window.
|
||||||
ScheduleUnresponsiveEvent(50);
|
ScheduleUnresponsiveEvent(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,6 +560,9 @@ void NativeWindow::DevToolsAppendToFile(const std::string& url,
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::ScheduleUnresponsiveEvent(int ms) {
|
void NativeWindow::ScheduleUnresponsiveEvent(int ms) {
|
||||||
|
if (!window_unresposive_closure_.IsCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
window_unresposive_closure_.Reset(
|
window_unresposive_closure_.Reset(
|
||||||
base::Bind(&NativeWindow::NotifyWindowUnresponsive,
|
base::Bind(&NativeWindow::NotifyWindowUnresponsive,
|
||||||
weak_factory_.GetWeakPtr()));
|
weak_factory_.GetWeakPtr()));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче