void JavaScriptDebugServer::pauseIfNeeded(Page* page) { if (m_paused) return; if (!page || !hasListenersInterestedInPage(page)) return; bool pauseNow = m_pauseOnNextStatement; pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame); pauseNow |= (m_currentCallFrame->line() > 0 && hasBreakpoint(m_currentCallFrame->sourceIdentifier(), m_currentCallFrame->line())); if (!pauseNow) return; m_pauseOnCallFrame = 0; m_pauseOnNextStatement = false; m_paused = true; dispatchFunctionToListeners(&JavaScriptDebugListener::didPause, page); setJavaScriptPaused(page->group(), true); TimerBase::fireTimersInNestedEventLoop(); EventLoop loop; m_doneProcessingDebuggerEvents = false; while (!m_doneProcessingDebuggerEvents && !loop.ended()) loop.cycle(); setJavaScriptPaused(page->group(), false); m_paused = false; }
void PageScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused) { setMainThreadCallbacksPaused(paused); for (auto& page : pageGroup.pages()) setJavaScriptPaused(page, paused); }
void JavaScriptDebugServer::setJavaScriptPaused(Page* page, bool paused) { ASSERT_ARG(page, page); page->setDefersLoading(paused); for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) setJavaScriptPaused(frame, paused); }
void JavaScriptDebugServer::setJavaScriptPaused(const PageGroup& pageGroup, bool paused) { setMainThreadCallbacksPaused(paused); const HashSet<Page*>& pages = pageGroup.pages(); HashSet<Page*>::const_iterator end = pages.end(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) setJavaScriptPaused(*it, paused); }
void PageScriptDebugServer::setJavaScriptPaused(Page* page, bool paused) { ASSERT_ARG(page, page); page->setDefersLoading(paused); for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) setJavaScriptPaused(frame, paused); if (InspectorFrontendClient* frontendClient = page->inspectorController().inspectorFrontendClient()) { if (paused) frontendClient->pagePaused(); else frontendClient->pageUnpaused(); } }
void PageScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused) { ASSERT_ARG(frame, frame); if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) return; frame->script().setPaused(paused); Document* document = frame->document(); if (paused) { document->suspendScriptedAnimationControllerCallbacks(); document->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused); } else { document->resumeActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused); document->resumeScriptedAnimationControllerCallbacks(); } setJavaScriptPaused(frame->view(), paused); }
void JavaScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused) { ASSERT_ARG(frame, frame); if (!frame->script()->isEnabled()) return; frame->script()->setPaused(paused); if (JSDOMWindow* window = toJSDOMWindow(frame)) { if (paused) { OwnPtr<PausedTimeouts> timeouts; window->pauseTimeouts(timeouts); m_pausedTimeouts.set(frame, timeouts.release()); } else { OwnPtr<PausedTimeouts> timeouts(m_pausedTimeouts.take(frame)); window->resumeTimeouts(timeouts); } } setJavaScriptPaused(frame->view(), paused); }
void PageScriptDebugServer::didContinue(JSGlobalObject*) { setJavaScriptPaused(m_page.group(), false); }
void PageScriptDebugServer::didPause(JSGlobalObject*) { setJavaScriptPaused(m_page.group(), true); }