| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SourceLocation_h | 5 #ifndef SourceLocation_h |
| 6 #define SourceLocation_h | 6 #define SourceLocation_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/CrossThreadCopier.h" | 9 #include "platform/CrossThreadCopier.h" |
| 10 #include "platform/v8_inspector/public/V8StackTrace.h" | 10 #include "platform/v8_inspector/public/V8StackTrace.h" |
| 11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <v8.h> |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class ExecutionContext; | 18 class ExecutionContext; |
| 18 class TracedValue; | 19 class TracedValue; |
| 19 | 20 |
| 20 class CORE_EXPORT SourceLocation { | 21 class CORE_EXPORT SourceLocation { |
| 21 public: | 22 public: |
| 22 // Zero lineNumber and columnNumber mean unknown. Captures current stack tra
ce. | 23 // Zero lineNumber and columnNumber mean unknown. Captures current stack tra
ce. |
| 23 static std::unique_ptr<SourceLocation> capture(const String& url, unsigned l
ineNumber, unsigned columnNumber); | 24 static std::unique_ptr<SourceLocation> capture(const String& url, unsigned l
ineNumber, unsigned columnNumber); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 std::unique_ptr<SourceLocation> clone() const; // Safe to pass between threa
ds. | 46 std::unique_ptr<SourceLocation> clone() const; // Safe to pass between threa
ds. |
| 46 | 47 |
| 47 // No-op when stack trace is unknown. | 48 // No-op when stack trace is unknown. |
| 48 void toTracedValue(TracedValue*, const char* name) const; | 49 void toTracedValue(TracedValue*, const char* name) const; |
| 49 | 50 |
| 50 // Could be null string when stack trace is unknown. | 51 // Could be null string when stack trace is unknown. |
| 51 String toString() const; | 52 String toString() const; |
| 52 | 53 |
| 53 // Could be null when stack trace is unknown. | 54 // Could be null when stack trace is unknown. |
| 54 std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject() c
onst; | 55 std::unique_ptr<v8_inspector::protocol::Runtime::API::StackTrace> buildInspe
ctorObject() const; |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber
, std::unique_ptr<v8_inspector::V8StackTrace>, int scriptId); | 58 SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber
, std::unique_ptr<v8_inspector::V8StackTrace>, int scriptId); |
| 58 static std::unique_ptr<SourceLocation> createFromNonEmptyV8StackTrace(std::u
nique_ptr<v8_inspector::V8StackTrace>, int scriptId); | 59 static std::unique_ptr<SourceLocation> createFromNonEmptyV8StackTrace(std::u
nique_ptr<v8_inspector::V8StackTrace>, int scriptId); |
| 59 | 60 |
| 60 String m_url; | 61 String m_url; |
| 61 unsigned m_lineNumber; | 62 unsigned m_lineNumber; |
| 62 unsigned m_columnNumber; | 63 unsigned m_columnNumber; |
| 63 std::unique_ptr<v8_inspector::V8StackTrace> m_stackTrace; | 64 std::unique_ptr<v8_inspector::V8StackTrace> m_stackTrace; |
| 64 int m_scriptId; | 65 int m_scriptId; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace blink | 68 } // namespace blink |
| 68 | 69 |
| 69 #endif // SourceLocation_h | 70 #endif // SourceLocation_h |
| OLD | NEW |