Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: Source/bindings/v8/ScriptCallStackFactory.cpp

Issue 23717011: DevTools: Use scriptId for resolving stack frames in console messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/ScriptCallStackFactory.h ('k') | Source/core/inspector/ScriptCallFrame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptCallStackFactory.cpp
diff --git a/Source/bindings/v8/ScriptCallStackFactory.cpp b/Source/bindings/v8/ScriptCallStackFactory.cpp
index 22de5f8d8282566a7eb524c8392b7a202687caf0..6ec0e609bf86573e22bb2aed23543618d9218b55 100644
--- a/Source/bindings/v8/ScriptCallStackFactory.cpp
+++ b/Source/bindings/v8/ScriptCallStackFactory.cpp
@@ -40,6 +40,7 @@
#include "core/inspector/ScriptCallFrame.h"
#include "core/inspector/ScriptCallStack.h"
#include "core/platform/JSONValues.h"
+#include "wtf/text/StringBuilder.h"
#include <v8-debug.h>
@@ -49,6 +50,9 @@ class ScriptExecutionContext;
static ScriptCallFrame toScriptCallFrame(v8::Handle<v8::StackFrame> frame)
{
+ StringBuilder stringBuilder;
+ stringBuilder.appendNumber(frame->GetScriptId());
+ String scriptId = stringBuilder.toString();
String sourceName;
v8::Local<v8::String> sourceNameValue(frame->GetScriptNameOrSourceURL());
if (!sourceNameValue.IsEmpty())
@@ -61,7 +65,7 @@ static ScriptCallFrame toScriptCallFrame(v8::Handle<v8::StackFrame> frame)
int sourceLineNumber = frame->GetLineNumber();
int sourceColumn = frame->GetColumn();
- return ScriptCallFrame(functionName, sourceName, sourceLineNumber, sourceColumn);
+ return ScriptCallFrame(functionName, scriptId, sourceName, sourceLineNumber, sourceColumn);
}
static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vector<ScriptCallFrame>& scriptCallFrames, size_t maxStackSize, bool emptyStackIsAllowed)
@@ -78,7 +82,7 @@ static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vect
// Successfully grabbed stack trace, but there are no frames. It may happen in case
// when a bound function is called from native code for example.
// Fallback to setting lineNumber to 0, and source and function name to "undefined".
- scriptCallFrames.append(ScriptCallFrame("undefined", "undefined", 0));
+ scriptCallFrames.append(ScriptCallFrame("undefined", "", "undefined", 0));
}
}
« no previous file with comments | « Source/bindings/v8/ScriptCallStackFactory.h ('k') | Source/core/inspector/ScriptCallFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698