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

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

Issue 1997293002: Introduce SourceLocation to be used for console messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SourceLocation_h
6 #define SourceLocation_h
7
8 #include "core/CoreExport.h"
9 #include "platform/v8_inspector/public/V8StackTrace.h"
10 #include "wtf/Forward.h"
11 #include "wtf/PassOwnPtr.h"
12 #include "wtf/text/WTFString.h"
13
14 namespace blink {
15
16 class ExecutionContext;
17 class TracedValue;
18 class V8StackTrace;
19
20 class CORE_EXPORT SourceLocation {
21 public:
22 // Zero lineNumber and columnNumber mean unknown. Captures current stack tra ce.
23 static PassOwnPtr<SourceLocation> capture(const String& url, unsigned lineNu mber, unsigned columnNumber);
24
25 // Shortcut when location is unknown. Tries to capture call stack or parsing location if available.
26 static PassOwnPtr<SourceLocation> capture(ExecutionContext* = nullptr);
27
28 static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNum ber, unsigned columnNumber, PassOwnPtr<V8StackTrace>, int scriptId = 0);
29 ~SourceLocation();
30
31 String url() const { return m_url; }
32 unsigned lineNumber() const { return m_lineNumber; }
33 unsigned columnNumber() const { return m_columnNumber; }
34 PassOwnPtr<V8StackTrace> takeStackTrace() { return std::move(m_stackTrace); }
35 int scriptId() const { return m_scriptId; }
36
37 private:
38 SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber , PassOwnPtr<V8StackTrace>, int scriptId);
39
40 String m_url;
41 unsigned m_lineNumber;
42 unsigned m_columnNumber;
43 OwnPtr<V8StackTrace> m_stackTrace;
44 int m_scriptId;
45 };
46
47 } // namespace blink
48
49 #endif // SourceLocation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698