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

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

Issue 2004423007: SourceLocation: Fix use-after-move. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect review comments. Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8_inspector/public/V8StackTrace.h" 9 #include "platform/v8_inspector/public/V8StackTrace.h"
10 #include "wtf/Forward.h" 10 #include "wtf/Forward.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 // Zero lineNumber and columnNumber mean unknown. Captures current stack tra ce. 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); 23 static PassOwnPtr<SourceLocation> capture(const String& url, unsigned lineNu mber, unsigned columnNumber);
24 24
25 // Shortcut when location is unknown. Tries to capture call stack or parsing location if available. 25 // Shortcut when location is unknown. Tries to capture call stack or parsing location if available.
26 static PassOwnPtr<SourceLocation> capture(ExecutionContext* = nullptr); 26 static PassOwnPtr<SourceLocation> capture(ExecutionContext* = nullptr);
27 27
28 static PassOwnPtr<SourceLocation> fromMessage(v8::Isolate*, v8::Local<v8::Me ssage>, ExecutionContext*); 28 static PassOwnPtr<SourceLocation> fromMessage(v8::Isolate*, v8::Local<v8::Me ssage>, ExecutionContext*);
29 29
30 static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNum ber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0); 30 static PassOwnPtr<SourceLocation> create(const String& url, unsigned lineNum ber, unsigned columnNumber, std::unique_ptr<V8StackTrace>, int scriptId = 0);
31 static PassOwnPtr<SourceLocation> createFromNonEmptyV8StackTrace(std::unique _ptr<V8StackTrace>, int scriptId = 0);
31 ~SourceLocation(); 32 ~SourceLocation();
32 33
33 bool isEmpty() const { return m_url.isNull(); } 34 bool isEmpty() const { return m_url.isNull(); }
34 String url() const { return m_url; } 35 String url() const { return m_url; }
35 unsigned lineNumber() const { return m_lineNumber; } 36 unsigned lineNumber() const { return m_lineNumber; }
36 unsigned columnNumber() const { return m_columnNumber; } 37 unsigned columnNumber() const { return m_columnNumber; }
37 std::unique_ptr<V8StackTrace> takeStackTrace() { return std::move(m_stackTra ce); } 38 std::unique_ptr<V8StackTrace> takeStackTrace() { return std::move(m_stackTra ce); }
38 int scriptId() const { return m_scriptId; } 39 int scriptId() const { return m_scriptId; }
39 void toTracedValue(TracedValue*, const char* name) const; 40 void toTracedValue(TracedValue*, const char* name) const;
40 PassOwnPtr<SourceLocation> clone() const; 41 PassOwnPtr<SourceLocation> clone() const;
41 42
42 private: 43 private:
43 SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber , std::unique_ptr<V8StackTrace>, int scriptId); 44 SourceLocation(const String& url, unsigned lineNumber, unsigned columnNumber , std::unique_ptr<V8StackTrace>, int scriptId);
44 45
45 String m_url; 46 String m_url;
46 unsigned m_lineNumber; 47 unsigned m_lineNumber;
47 unsigned m_columnNumber; 48 unsigned m_columnNumber;
48 std::unique_ptr<V8StackTrace> m_stackTrace; 49 std::unique_ptr<V8StackTrace> m_stackTrace;
49 int m_scriptId; 50 int m_scriptId;
50 }; 51 };
51 52
52 } // namespace blink 53 } // namespace blink
53 54
54 #endif // SourceLocation_h 55 #endif // SourceLocation_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/SourceLocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698