diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/bindings/js/ScriptDebugServer.cpp | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/bindings/js/ScriptDebugServer.cpp')
-rw-r--r-- | Source/WebCore/bindings/js/ScriptDebugServer.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp index aed2ad4..32a3b2d 100644 --- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp @@ -159,7 +159,7 @@ void ScriptDebugServer::removeBreakpoint(const String& breakpointId) it->second.remove(lineNumber + 1); } -bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const +bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, const TextPosition0& position) const { if (!m_breakpointsActivated) return false; @@ -167,6 +167,9 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) co SourceIdToBreakpointsMap::const_iterator it = m_sourceIdToBreakpoints.find(sourceID); if (it == m_sourceIdToBreakpoints.end()) return false; + int lineNumber = position.m_line.convertAsOneBasedInt(); + if (lineNumber <= 0) + return false; LineToBreakpointMap::const_iterator breakIt = it->second.find(lineNumber); if (breakIt == it->second.end() || !breakIt->second.enabled) return false; @@ -405,10 +408,13 @@ void ScriptDebugServer::setJavaScriptPaused(Frame* frame, bool paused) frame->script()->setPaused(paused); Document* document = frame->document(); - if (paused) + if (paused) { + document->suspendScriptedAnimationControllerCallbacks(); document->suspendActiveDOMObjects(ActiveDOMObject::JavaScriptDebuggerPaused); - else + } else { document->resumeActiveDOMObjects(); + document->resumeScriptedAnimationControllerCallbacks(); + } setJavaScriptPaused(frame->view(), paused); } @@ -432,7 +438,7 @@ void ScriptDebugServer::setJavaScriptPaused(FrameView* view, bool paused) void ScriptDebugServer::createCallFrameAndPauseIfNeeded(const DebuggerCallFrame& debuggerCallFrame, intptr_t sourceID, int lineNumber) { - TextPosition1 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber), WTF::OneBasedNumber::base()); + TextPosition0 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased(), WTF::ZeroBasedNumber::base()); m_currentCallFrame = JavaScriptCallFrame::create(debuggerCallFrame, m_currentCallFrame, sourceID, textPosition); pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject())); } @@ -443,7 +449,7 @@ void ScriptDebugServer::updateCallFrameAndPauseIfNeeded(const DebuggerCallFrame& if (!m_currentCallFrame) return; - TextPosition1 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber), WTF::OneBasedNumber::base()); + TextPosition0 textPosition(WTF::OneBasedNumber::fromOneBasedInt(lineNumber).convertToZeroBased(), WTF::ZeroBasedNumber::base()); m_currentCallFrame->update(debuggerCallFrame, sourceID, textPosition); pauseIfNeeded(toPage(debuggerCallFrame.dynamicGlobalObject())); } @@ -458,7 +464,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page) bool pauseNow = m_pauseOnNextStatement; pauseNow |= (m_pauseOnCallFrame == m_currentCallFrame); - pauseNow |= (m_currentCallFrame->line() > 0 && hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->line())); + pauseNow |= hasBreakpoint(m_currentCallFrame->sourceID(), m_currentCallFrame->position()); if (!pauseNow) return; |