From 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 2 Jun 2011 12:07:03 +0100 Subject: Merge WebKit at r84325: Initial merge by git. Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b --- Source/WebCore/bindings/js/ScriptDebugServer.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'Source/WebCore/bindings/js/ScriptDebugServer.cpp') diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp index 05c0f2c..88e685f 100644 --- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp +++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp @@ -112,7 +112,7 @@ bool ScriptDebugServer::hasBreakpoint(intptr_t sourceID, const TextPosition0& po if (lineNumber <= 0) return false; LineToBreakpointMap::const_iterator breakIt = it->second.find(lineNumber); - if (breakIt == it->second.end() || !breakIt->second.enabled) + if (breakIt == it->second.end()) return false; // An empty condition counts as no condition which is equivalent to "true". @@ -189,7 +189,7 @@ void ScriptDebugServer::stepOutOfFunction() m_doneProcessingDebuggerEvents = true; } -bool ScriptDebugServer::editScriptSource(const String&, const String&, String&) +bool ScriptDebugServer::editScriptSource(const String&, const String&, String*) { // FIXME(40300): implement this. return false; @@ -214,7 +214,7 @@ void ScriptDebugServer::dispatchDidContinue(ScriptDebugListener* listener) listener->didContinue(); } -void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, ScriptWorldType worldType) +void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, bool isContentScript) { String sourceID = ustringToString(JSC::UString::number(sourceProvider->asID())); String url = ustringToString(sourceProvider->url()); @@ -225,7 +225,7 @@ void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, Sou Vector copy; copyToVector(listeners, copy); for (size_t i = 0; i < copy.size(); ++i) - copy[i]->didParseSource(sourceID, url, data, lineOffset, columnOffset, worldType); + copy[i]->didParseSource(sourceID, url, data, lineOffset, columnOffset, isContentScript); } void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, int errorLine, const String& errorMessage) @@ -240,11 +240,9 @@ void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners copy[i]->failedToParseSource(url, data, firstLine, errorLine, errorMessage); } -static ScriptWorldType currentWorldType(ExecState* exec) +static bool isContentScript(ExecState* exec) { - if (currentWorld(exec) == mainThreadNormalWorld()) - return MAIN_WORLD; - return EXTENSIONS_WORLD; + return currentWorld(exec) != mainThreadNormalWorld(); } void ScriptDebugServer::detach(JSGlobalObject* globalObject) @@ -275,10 +273,8 @@ void ScriptDebugServer::sourceParsed(ExecState* exec, SourceProvider* sourceProv bool isError = errorLine != -1; if (isError) dispatchFailedToParseSource(*listeners, sourceProvider, errorLine, ustringToString(errorMessage)); - else { - ScriptWorldType worldType = currentWorldType(exec); - dispatchDidParseSource(*listeners, sourceProvider, worldType); - } + else + dispatchDidParseSource(*listeners, sourceProvider, isContentScript(exec)); m_callingListeners = false; } -- cgit v1.1