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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/SourceLocation.h

Issue 2016123002: Remove ScriptCallStack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2006893004
Patch Set: full stack trace Created 4 years, 7 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
Index: third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
index 74cd28273101fc225ffce3a551613ee831454063..fc19cf48f8fb610977d6a5636b60593389091c35 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SourceLocation.h
@@ -17,6 +17,8 @@ class ExecutionContext;
class TracedValue;
class V8StackTrace;
+namespace protocol { namespace Runtime { class StackTrace; }}
+
class CORE_EXPORT SourceLocation {
public:
// Zero lineNumber and columnNumber mean unknown. Captures current stack trace.
@@ -27,18 +29,31 @@ public:
static PassOwnPtr<SourceLocation> fromMessage(v8::Isolate*, v8::Local<v8::Message>, ExecutionContext*);
+ static PassOwnPtr<SourceLocation> fromFunction(v8::Local<v8::Function>);
+
+ // Forces full stack trace.
+ static PassOwnPtr<SourceLocation> captureWithFullStackTrace();
+
static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0);
~SourceLocation();
- bool isEmpty() const { return m_url.isNull(); }
+ bool isUnknown() const { return m_url.isNull() && !m_scriptId && !m_lineNumber; }
const String& url() const { return m_url; }
unsigned lineNumber() const { return m_lineNumber; }
unsigned columnNumber() const { return m_columnNumber; }
- std::unique_ptr<V8StackTrace> takeStackTrace() { return std::move(m_stackTrace); }
int scriptId() const { return m_scriptId; }
- void toTracedValue(TracedValue*, const char* name) const;
+
PassOwnPtr<SourceLocation> clone() const;
+ // No-op when stack trace is unknown.
+ void toTracedValue(TracedValue*, const char* name) const;
+
+ // Could be null string when stack trace is unknown.
+ String toString() const;
+
+ // Could be null when stack trace is unknown.
+ std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObject() const;
+
private:
SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId);
static PassOwnPtr<SourceLocation> createFromNonEmptyV8StackTrace(std::unique_ptr<V8StackTrace>, int scriptId);

Powered by Google App Engine
This is Rietveld 408576698