diff options
author | Steve Block <steveblock@google.com> | 2011-05-18 13:36:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 15:38:28 +0100 |
commit | 2fc2651226baac27029e38c9d6ef883fa32084db (patch) | |
tree | e396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/bindings/js/ScriptDebugServer.cpp | |
parent | b3725cedeb43722b3b175aaeff70552e562d2c94 (diff) | |
download | external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2 |
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/bindings/js/ScriptDebugServer.cpp')
-rw-r--r-- | Source/WebCore/bindings/js/ScriptDebugServer.cpp | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp index b516f6d..aed2ad4 100644 --- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp @@ -117,20 +117,6 @@ void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page didRemoveListener(page); } -void ScriptDebugServer::pageCreated(Page* page) -{ - ASSERT_ARG(page, page); - - if (!hasListenersInterestedInPage(page)) - return; - page->setDebugger(this); -} - -bool ScriptDebugServer::isDebuggerAlwaysEnabled() -{ - return false; -} - bool ScriptDebugServer::hasListenersInterestedInPage(Page* page) { ASSERT_ARG(page, page); @@ -138,19 +124,21 @@ bool ScriptDebugServer::hasListenersInterestedInPage(Page* page) return m_pageListenersMap.contains(page); } -String ScriptDebugServer::setBreakpoint(const String& sourceID, unsigned lineNumber, const String& condition, bool enabled, unsigned* actualLineNumber) +String ScriptDebugServer::setBreakpoint(const String& sourceID, const ScriptBreakpoint& scriptBreakpoint, int* actualLineNumber, int* actualColumnNumber) { intptr_t sourceIDValue = sourceID.toIntPtr(); if (!sourceIDValue) return ""; - BreakpointsMap::iterator it = m_breakpoints.find(sourceIDValue); - if (it == m_breakpoints.end()) - it = m_breakpoints.set(sourceIDValue, SourceBreakpoints()).first; - if (it->second.contains(lineNumber)) + SourceIdToBreakpointsMap::iterator it = m_sourceIdToBreakpoints.find(sourceIDValue); + if (it == m_sourceIdToBreakpoints.end()) + it = m_sourceIdToBreakpoints.set(sourceIDValue, LineToBreakpointMap()).first; + if (it->second.contains(scriptBreakpoint.lineNumber + 1)) return ""; - it->second.set(lineNumber, ScriptBreakpoint(enabled, condition)); - *actualLineNumber = lineNumber; - return makeString(sourceID, ":", String::number(lineNumber)); + it->second.set(scriptBreakpoint.lineNumber + 1, scriptBreakpoint); + *actualLineNumber = scriptBreakpoint.lineNumber; + // FIXME(WK53003): implement setting breakpoints by line:column. + *actualColumnNumber = 0; + return makeString(sourceID, ":", String::number(scriptBreakpoint.lineNumber)); } void ScriptDebugServer::removeBreakpoint(const String& breakpointId) @@ -166,9 +154,9 @@ void ScriptDebugServer::removeBreakpoint(const String& breakpointId) unsigned lineNumber = tokens[1].toUInt(&success); if (!success) return; - BreakpointsMap::iterator it = m_breakpoints.find(sourceIDValue); - if (it != m_breakpoints.end()) - it->second.remove(lineNumber); + SourceIdToBreakpointsMap::iterator it = m_sourceIdToBreakpoints.find(sourceIDValue); + if (it != m_sourceIdToBreakpoints.end()) + it->second.remove(lineNumber + 1); } bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const @@ -176,10 +164,10 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) co if (!m_breakpointsActivated) return false; - BreakpointsMap::const_iterator it = m_breakpoints.find(sourceID); - if (it == m_breakpoints.end()) + SourceIdToBreakpointsMap::const_iterator it = m_sourceIdToBreakpoints.find(sourceID); + if (it == m_sourceIdToBreakpoints.end()) return false; - SourceBreakpoints::const_iterator breakIt = it->second.find(lineNumber); + LineToBreakpointMap::const_iterator breakIt = it->second.find(lineNumber); if (breakIt == it->second.end() || !breakIt->second.enabled) return false; @@ -198,7 +186,7 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, unsigned lineNumber) co void ScriptDebugServer::clearBreakpoints() { - m_breakpoints.clear(); + m_sourceIdToBreakpoints.clear(); } void ScriptDebugServer::setBreakpointsActivated(bool activated) |