[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
podivilov at chromium.org
podivilov at chromium.org
Sun Feb 20 23:16:29 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 0c47cc7cde6a7463410ce7c32fa5fa88401d945a
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 19 17:01:12 2011 +0000
2011-01-19 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [JSC] scripts have incorrect starting line (always 1).
https://bugs.webkit.org/show_bug.cgi?id=52721
* inspector/debugger-scripts-expected.txt: Added.
* inspector/debugger-scripts.html: Added.
2011-01-19 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [JSC] scripts have incorrect starting line (always 1).
https://bugs.webkit.org/show_bug.cgi?id=52721
* debugger/Debugger.cpp:
(JSC::Debugger::recompileAllJSFunctions):
* debugger/Debugger.h:
* parser/Parser.h:
(JSC::Parser::parse):
* parser/SourceCode.h:
(JSC::SourceCode::SourceCode):
* parser/SourceProvider.h:
(JSC::SourceProvider::startPosition):
2011-01-19 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [JSC] scripts have incorrect starting line (always 1).
https://bugs.webkit.org/show_bug.cgi?id=52721
Test: inspector/debugger-scripts.html
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidParseSource):
(WebCore::ScriptDebugServer::dispatchFailedToParseSource):
(WebCore::ScriptDebugServer::sourceParsed):
* bindings/js/ScriptDebugServer.h:
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
* bindings/js/StringSourceProvider.h:
(WebCore::StringSourceProvider::create):
(WebCore::StringSourceProvider::startPosition):
(WebCore::StringSourceProvider::StringSourceProvider):
2011-01-19 Pavel Podivilov <podivilov at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: [JSC] scripts have incorrect starting line (always 1).
https://bugs.webkit.org/show_bug.cgi?id=52721
* WebView/WebScriptDebugger.h:
* WebView/WebScriptDebugger.mm:
(toNSString):
(WebScriptDebugger::sourceParsed):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 97da7a2..39e2a14 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2011-01-19 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [JSC] scripts have incorrect starting line (always 1).
+ https://bugs.webkit.org/show_bug.cgi?id=52721
+
+ * inspector/debugger-scripts-expected.txt: Added.
+ * inspector/debugger-scripts.html: Added.
+
2011-01-19 Jeremy Orlow <jorlow at chromium.org>
This test changed slightly, so rebaseline it. The offsets seem off
diff --git a/LayoutTests/inspector/debugger-scripts-expected.txt b/LayoutTests/inspector/debugger-scripts-expected.txt
new file mode 100644
index 0000000..d2e319d
--- /dev/null
+++ b/LayoutTests/inspector/debugger-scripts-expected.txt
@@ -0,0 +1,11 @@
+Tests that valid parsed script notifications are received by front-end. Bug 52721
+
+Debugger was enabled.
+script 1:
+ offset: 5:8
+ length: 1096
+script 2:
+ offset: 38:21
+ length: 50
+Debugger was disabled.
+
diff --git a/LayoutTests/inspector/debugger-scripts.html b/LayoutTests/inspector/debugger-scripts.html
new file mode 100644
index 0000000..b69f2b2
--- /dev/null
+++ b/LayoutTests/inspector/debugger-scripts.html
@@ -0,0 +1,54 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test2.js"></script>
+<script src="../http/tests/inspector/debugger-test2.js"></script>
+
+<script>
+var test = function()
+{
+ var scripts = [];
+ InspectorTest.startDebuggerTest(step1);
+
+ function step1()
+ {
+ WebInspector.debuggerModel.queryScripts(function(script) { step2({ data: script.sourceID }) });
+ WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, step2);
+ }
+
+ function step2(event)
+ {
+ var script = WebInspector.debuggerModel.scriptForSourceID(event.data);
+ if (script.sourceURL !== WebInspector.mainResource.url)
+ return;
+ scripts.push(script);
+ if (scripts.length === 2)
+ step3();
+ }
+
+ function step3()
+ {
+ scripts.sort(function(x, y) { return x.lineOffset - y.lineOffset });
+ for (var i = 0; i < scripts.length; ++i) {
+ InspectorTest.addResult("script " + (i + 1) + ":");
+ InspectorTest.addResult(" offset: " + scripts[i].lineOffset + ":" + scripts[i].columnOffset);
+ InspectorTest.addResult(" length: " + scripts[i].length);
+ }
+ InspectorTest.completeDebuggerTest();
+ }
+}
+</script> <script>
+function doStuff()
+{
+}
+
+window.onload = runTest;
+</script>
+
+</head>
+
+<p>
+Tests that valid parsed script notifications are received by front-end.
+<a href="https://bugs.webkit.org/show_bug.cgi?id=52721">Bug 52721</a>
+</p>
+
+</html>
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index a8c401f..7c9ea31 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-19 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [JSC] scripts have incorrect starting line (always 1).
+ https://bugs.webkit.org/show_bug.cgi?id=52721
+
+ * debugger/Debugger.cpp:
+ (JSC::Debugger::recompileAllJSFunctions):
+ * debugger/Debugger.h:
+ * parser/Parser.h:
+ (JSC::Parser::parse):
+ * parser/SourceCode.h:
+ (JSC::SourceCode::SourceCode):
+ * parser/SourceProvider.h:
+ (JSC::SourceProvider::startPosition):
+
2011-01-19 Csaba Osztrogonác <ossy at webkit.org>
Reviewed by Laszlo Gombos and Tor Arne Vestbø.
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 6b24c5a..23b9361 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -94,7 +94,7 @@ void Debugger::recompileAllJSFunctions(JSGlobalData* globalData)
// JavaScript in the inspector.
SourceProviderMap::const_iterator end = sourceProviders.end();
for (SourceProviderMap::const_iterator iter = sourceProviders.begin(); iter != end; ++iter)
- sourceParsed(iter->second, SourceCode(iter->first), -1, UString());
+ sourceParsed(iter->second, iter->first, -1, UString());
}
JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSGlobalObject* globalObject)
diff --git a/Source/JavaScriptCore/debugger/Debugger.h b/Source/JavaScriptCore/debugger/Debugger.h
index 3b9bec4..ec5cf37 100644
--- a/Source/JavaScriptCore/debugger/Debugger.h
+++ b/Source/JavaScriptCore/debugger/Debugger.h
@@ -31,7 +31,7 @@ namespace JSC {
class JSGlobalData;
class JSGlobalObject;
class JSValue;
- class SourceCode;
+ class SourceProvider;
class UString;
class Debugger {
@@ -41,7 +41,7 @@ namespace JSC {
void attach(JSGlobalObject*);
virtual void detach(JSGlobalObject*);
- virtual void sourceParsed(ExecState*, const SourceCode&, int errorLineNumber, const UString& errorMessage) = 0;
+ virtual void sourceParsed(ExecState*, SourceProvider*, int errorLineNumber, const UString& errorMessage) = 0;
virtual void exception(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber, bool hasHandler) = 0;
virtual void atStatement(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0;
virtual void callEvent(const DebuggerCallFrame&, intptr_t sourceID, int lineNumber) = 0;
diff --git a/Source/JavaScriptCore/parser/Parser.h b/Source/JavaScriptCore/parser/Parser.h
index 213827b..b257b68 100644
--- a/Source/JavaScriptCore/parser/Parser.h
+++ b/Source/JavaScriptCore/parser/Parser.h
@@ -119,7 +119,7 @@ namespace JSC {
m_funcDeclarations = 0;
if (debugger && !ParsedNode::scopeIsFunction)
- debugger->sourceParsed(debuggerExecState, source, errLine, errMsg);
+ debugger->sourceParsed(debuggerExecState, source.provider(), errLine, errMsg);
return result.release();
}
diff --git a/Source/JavaScriptCore/parser/SourceCode.h b/Source/JavaScriptCore/parser/SourceCode.h
index a3ce759..9ba4da3 100644
--- a/Source/JavaScriptCore/parser/SourceCode.h
+++ b/Source/JavaScriptCore/parser/SourceCode.h
@@ -31,7 +31,6 @@
#include "SourceProvider.h"
#include <wtf/RefPtr.h>
-#include <wtf/text/TextPosition.h>
namespace JSC {
@@ -42,34 +41,22 @@ namespace JSC {
, m_startChar(0)
, m_endChar(0)
, m_firstLine(0)
- , m_firstColumn(0)
{
}
- SourceCode(PassRefPtr<SourceProvider> provider, int firstLine = 1, int firstColumn = 1)
+ SourceCode(PassRefPtr<SourceProvider> provider, int firstLine = 1)
: m_provider(provider)
, m_startChar(0)
, m_endChar(m_provider->length())
, m_firstLine(std::max(firstLine, 1))
- , m_firstColumn(std::max(firstColumn, 1))
{
}
- SourceCode(PassRefPtr<SourceProvider> provider, int start, int end, int firstLine, int firstColumn = 1)
+ SourceCode(PassRefPtr<SourceProvider> provider, int start, int end, int firstLine)
: m_provider(provider)
, m_startChar(start)
, m_endChar(end)
, m_firstLine(std::max(firstLine, 1))
- , m_firstColumn(std::max(firstColumn, 1))
- {
- }
-
- SourceCode(PassRefPtr<SourceProvider> provider, const TextPosition1& startPosition)
- : m_provider(provider)
- , m_startChar(0)
- , m_endChar(m_provider->length())
- , m_firstLine(startPosition.m_line.oneBasedInt())
- , m_firstColumn(startPosition.m_column.oneBasedInt())
{
}
@@ -83,7 +70,6 @@ namespace JSC {
bool isNull() const { return !m_provider; }
SourceProvider* provider() const { return m_provider.get(); }
int firstLine() const { return m_firstLine; }
- int firstColumn() const { return m_firstColumn; }
int startOffset() const { return m_startChar; }
int endOffset() const { return m_endChar; }
const UChar* data() const { return m_provider->data() + m_startChar; }
@@ -94,7 +80,6 @@ namespace JSC {
int m_startChar;
int m_endChar;
int m_firstLine;
- int m_firstColumn;
};
inline SourceCode makeSource(const UString& source, const UString& url = UString(), int firstLine = 1)
diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h
index 5ff1d14..3648126 100644
--- a/Source/JavaScriptCore/parser/SourceProvider.h
+++ b/Source/JavaScriptCore/parser/SourceProvider.h
@@ -31,6 +31,7 @@
#include "UString.h"
#include <wtf/RefCounted.h>
+#include <wtf/text/TextPosition.h>
namespace JSC {
@@ -48,6 +49,7 @@ namespace JSC {
virtual int length() const = 0;
const UString& url() { return m_url; }
+ virtual TextPosition1 startPosition() const { return TextPosition1::minimumPosition(); }
intptr_t asID() { return reinterpret_cast<intptr_t>(this); }
bool isValid() const { return m_validated; }
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 75937b5..0320eff 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2011-01-19 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [JSC] scripts have incorrect starting line (always 1).
+ https://bugs.webkit.org/show_bug.cgi?id=52721
+
+ Test: inspector/debugger-scripts.html
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::dispatchDidParseSource):
+ (WebCore::ScriptDebugServer::dispatchFailedToParseSource):
+ (WebCore::ScriptDebugServer::sourceParsed):
+ * bindings/js/ScriptDebugServer.h:
+ * bindings/js/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/js/StringSourceProvider.h:
+ (WebCore::StringSourceProvider::create):
+ (WebCore::StringSourceProvider::startPosition):
+ (WebCore::StringSourceProvider::StringSourceProvider):
+
2011-01-19 Satish Sampath <satish at chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.cpp b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
index b23641f..b516f6d 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -48,7 +48,7 @@
#include "ScrollView.h"
#include "Widget.h"
#include <debugger/DebuggerCallFrame.h>
-#include <parser/SourceCode.h>
+#include <parser/SourceProvider.h>
#include <runtime/JSLock.h>
#include <wtf/text/StringConcatenate.h>
#include <wtf/MainThread.h>
@@ -282,23 +282,25 @@ void ScriptDebugServer::dispatchDidContinue(ScriptDebugListener* listener)
listener->didContinue();
}
-void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, ScriptWorldType worldType)
+void ScriptDebugServer::dispatchDidParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, ScriptWorldType worldType)
{
- String sourceID = ustringToString(JSC::UString::number(source.provider()->asID()));
- String url = ustringToString(source.provider()->url());
- String data = ustringToString(JSC::UString(source.data(), source.length()));
+ String sourceID = ustringToString(JSC::UString::number(sourceProvider->asID()));
+ String url = ustringToString(sourceProvider->url());
+ String data = ustringToString(JSC::UString(sourceProvider->data(), sourceProvider->length()));
+ int lineOffset = sourceProvider->startPosition().m_line.convertAsZeroBasedInt();
+ int columnOffset = sourceProvider->startPosition().m_column.convertAsZeroBasedInt();
Vector<ScriptDebugListener*> copy;
copyToVector(listeners, copy);
for (size_t i = 0; i < copy.size(); ++i)
- copy[i]->didParseSource(sourceID, url, data, source.firstLine() - 1, source.firstColumn() - 1, worldType);
+ copy[i]->didParseSource(sourceID, url, data, lineOffset, columnOffset, worldType);
}
-void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, const SourceCode& source, int errorLine, const String& errorMessage)
+void ScriptDebugServer::dispatchFailedToParseSource(const ListenerSet& listeners, SourceProvider* sourceProvider, int errorLine, const String& errorMessage)
{
- String url = ustringToString(source.provider()->url());
- String data = ustringToString(JSC::UString(source.data(), source.length()));
- int firstLine = source.firstLine();
+ String url = ustringToString(sourceProvider->url());
+ String data = ustringToString(JSC::UString(sourceProvider->data(), sourceProvider->length()));
+ int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
Vector<ScriptDebugListener*> copy;
copyToVector(listeners, copy);
@@ -335,7 +337,7 @@ void ScriptDebugServer::detach(JSGlobalObject* globalObject)
Debugger::detach(globalObject);
}
-void ScriptDebugServer::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMessage)
+void ScriptDebugServer::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const UString& errorMessage)
{
if (m_callingListeners)
return;
@@ -353,9 +355,9 @@ void ScriptDebugServer::sourceParsed(ExecState* exec, const SourceCode& source,
if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
ASSERT(!pageListeners->isEmpty());
if (isError)
- dispatchFailedToParseSource(*pageListeners, source, errorLine, ustringToString(errorMessage));
+ dispatchFailedToParseSource(*pageListeners, sourceProvider, errorLine, ustringToString(errorMessage));
else
- dispatchDidParseSource(*pageListeners, source, worldType);
+ dispatchDidParseSource(*pageListeners, sourceProvider, worldType);
}
m_callingListeners = false;
diff --git a/Source/WebCore/bindings/js/ScriptDebugServer.h b/Source/WebCore/bindings/js/ScriptDebugServer.h
index 9d380fb..de274db 100644
--- a/Source/WebCore/bindings/js/ScriptDebugServer.h
+++ b/Source/WebCore/bindings/js/ScriptDebugServer.h
@@ -115,8 +115,8 @@ private:
void dispatchFunctionToListeners(const ListenerSet& listeners, JavaScriptExecutionCallback callback);
void dispatchDidPause(ScriptDebugListener*);
void dispatchDidContinue(ScriptDebugListener*);
- void dispatchDidParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, enum ScriptWorldType);
- void dispatchFailedToParseSource(const ListenerSet& listeners, const JSC::SourceCode& source, int errorLine, const String& errorMessage);
+ void dispatchDidParseSource(const ListenerSet& listeners, JSC::SourceProvider*, enum ScriptWorldType);
+ void dispatchFailedToParseSource(const ListenerSet& listeners, JSC::SourceProvider*, int errorLine, const String& errorMessage);
void createCallFrameAndPauseIfNeeded(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
void updateCallFrameAndPauseIfNeeded(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
@@ -124,7 +124,7 @@ private:
virtual void detach(JSC::JSGlobalObject*);
- virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg);
+ virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const JSC::UString& errorMsg);
virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int firstLine);
virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h
index 6cf3987..373db31 100644
--- a/Source/WebCore/bindings/js/ScriptSourceCode.h
+++ b/Source/WebCore/bindings/js/ScriptSourceCode.h
@@ -43,8 +43,8 @@ namespace WebCore {
class ScriptSourceCode {
public:
ScriptSourceCode(const String& source, const KURL& url = KURL(), const TextPosition1& startPosition = TextPosition1::minimumPosition())
- : m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string()))
- , m_code(m_provider, startPosition)
+ : m_provider(StringSourceProvider::create(source, url.isNull() ? String() : url.string(), startPosition))
+ , m_code(m_provider, startPosition.m_line.oneBasedInt())
, m_url(url)
{
}
diff --git a/Source/WebCore/bindings/js/StringSourceProvider.h b/Source/WebCore/bindings/js/StringSourceProvider.h
index 478c1d1..e23fe5c 100644
--- a/Source/WebCore/bindings/js/StringSourceProvider.h
+++ b/Source/WebCore/bindings/js/StringSourceProvider.h
@@ -37,20 +37,26 @@ namespace WebCore {
class StringSourceProvider : public ScriptSourceProvider {
public:
- static PassRefPtr<StringSourceProvider> create(const String& source, const String& url) { return adoptRef(new StringSourceProvider(source, url)); }
+ static PassRefPtr<StringSourceProvider> create(const String& source, const String& url, const TextPosition1& startPosition = TextPosition1::minimumPosition())
+ {
+ return adoptRef(new StringSourceProvider(source, url, startPosition));
+ }
+ virtual TextPosition1 startPosition() const { return m_startPosition; }
JSC::UString getRange(int start, int end) const { return JSC::UString(m_source.characters() + start, end - start); }
const UChar* data() const { return m_source.characters(); }
int length() const { return m_source.length(); }
const String& source() const { return m_source; }
private:
- StringSourceProvider(const String& source, const String& url)
+ StringSourceProvider(const String& source, const String& url, const TextPosition1& startPosition)
: ScriptSourceProvider(stringToUString(url))
+ , m_startPosition(startPosition)
, m_source(source)
{
}
+ TextPosition1 m_startPosition;
String m_source;
};
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index f0f9020..974caec 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-19 Pavel Podivilov <podivilov at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [JSC] scripts have incorrect starting line (always 1).
+ https://bugs.webkit.org/show_bug.cgi?id=52721
+
+ * WebView/WebScriptDebugger.h:
+ * WebView/WebScriptDebugger.mm:
+ (toNSString):
+ (WebScriptDebugger::sourceParsed):
+
2011-01-19 Levi Weintraub <leviw at google.com>
Reviewed by Ryosuke Niwa.
diff --git a/Source/WebKit/mac/WebView/WebScriptDebugger.h b/Source/WebKit/mac/WebView/WebScriptDebugger.h
index c4147a2..73c9466 100644
--- a/Source/WebKit/mac/WebView/WebScriptDebugger.h
+++ b/Source/WebKit/mac/WebView/WebScriptDebugger.h
@@ -53,7 +53,7 @@ public:
void initGlobalCallFrame(const JSC::DebuggerCallFrame&);
- virtual void sourceParsed(JSC::ExecState*, const JSC::SourceCode&, int errorLine, const JSC::UString& errorMsg);
+ virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const JSC::UString& errorMsg);
virtual void callEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
virtual void atStatement(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
virtual void returnEvent(const JSC::DebuggerCallFrame&, intptr_t sourceID, int lineNumber);
diff --git a/Source/WebKit/mac/WebView/WebScriptDebugger.mm b/Source/WebKit/mac/WebView/WebScriptDebugger.mm
index 25ef4b7..533f033 100644
--- a/Source/WebKit/mac/WebView/WebScriptDebugger.mm
+++ b/Source/WebKit/mac/WebView/WebScriptDebugger.mm
@@ -34,7 +34,7 @@
#import "WebViewInternal.h"
#import <JavaScriptCore/DebuggerCallFrame.h>
#import <JavaScriptCore/JSGlobalObject.h>
-#import <JavaScriptCore/SourceCode.h>
+#import <JavaScriptCore/SourceProvider.h>
#import <WebCore/DOMWindow.h>
#import <WebCore/Frame.h>
#import <WebCore/JSDOMWindow.h>
@@ -57,11 +57,11 @@ NSString *toNSString(const UString& s)
return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.characters()) length:s.length()];
}
-static NSString *toNSString(const SourceCode& s)
+static NSString *toNSString(SourceProvider* s)
{
- if (!s.length())
+ if (!s->length())
return nil;
- return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.length()];
+ return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s->data()) length:s->length()];
}
// convert UString to NSURL
@@ -104,15 +104,16 @@ void WebScriptDebugger::initGlobalCallFrame(const DebuggerCallFrame& debuggerCal
}
// callbacks - relay to delegate
-void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source, int errorLine, const UString& errorMsg)
+void WebScriptDebugger::sourceParsed(ExecState* exec, SourceProvider* sourceProvider, int errorLine, const UString& errorMsg)
{
if (m_callingDelegate)
return;
m_callingDelegate = true;
- NSString *nsSource = toNSString(source);
- NSURL *nsURL = toNSURL(source.provider()->url());
+ NSString *nsSource = toNSString(sourceProvider);
+ NSURL *nsURL = toNSURL(sourceProvider->url());
+ int firstLine = sourceProvider->startPosition().m_line.oneBasedInt();
WebFrame *webFrame = toWebFrame(exec->dynamicGlobalObject());
WebView *webView = [webFrame webView];
@@ -121,9 +122,9 @@ void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source,
if (errorLine == -1) {
if (implementations->didParseSourceFunc) {
if (implementations->didParseSourceExpectsBaseLineNumber)
- CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:), nsSource, source.firstLine(), nsURL, source.provider()->asID(), webFrame);
+ CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:baseLineNumber:fromURL:sourceId:forWebFrame:), nsSource, firstLine, nsURL, sourceProvider->asID(), webFrame);
else
- CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:), nsSource, [nsURL absoluteString], source.provider()->asID(), webFrame);
+ CallScriptDebugDelegate(implementations->didParseSourceFunc, webView, @selector(webView:didParseSource:fromURL:sourceId:forWebFrame:), nsSource, [nsURL absoluteString], sourceProvider->asID(), webFrame);
}
} else {
NSString* nsErrorMessage = toNSString(errorMsg);
@@ -131,7 +132,7 @@ void WebScriptDebugger::sourceParsed(ExecState* exec, const SourceCode& source,
NSError *error = [[NSError alloc] initWithDomain:WebScriptErrorDomain code:WebScriptGeneralErrorCode userInfo:info];
if (implementations->failedToParseSourceFunc)
- CallScriptDebugDelegate(implementations->failedToParseSourceFunc, webView, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:), nsSource, source.firstLine(), nsURL, error, webFrame);
+ CallScriptDebugDelegate(implementations->failedToParseSourceFunc, webView, @selector(webView:failedToParseSource:baseLineNumber:fromURL:withError:forWebFrame:), nsSource, firstLine, nsURL, error, webFrame);
[error release];
[info release];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list