Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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 EXTENSIONS_COMMON_STACK_FRAME | |
| 6 #define EXTENSIONS_COMMON_STACK_FRAME | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 /* | |
|
jam
2013/08/30 16:04:39
?
Devlin
2013/08/30 16:33:37
Dang, sorry.
| |
| 16 class StackFrame { | |
| 17 public: | |
| 18 StackFrame(); | |
| 19 StackFrame(size_t line_number, | |
| 20 size_t column_number, | |
| 21 const base::string16& source, | |
| 22 const base::string16& function); | |
| 23 ~StackFrame(); | |
| 24 | |
| 25 // Construct a stack frame from a reported plain-text frame. | |
| 26 static scoped_ptr<StackFrame> CreateFromText( | |
| 27 const base::string16& frame_text); | |
| 28 | |
| 29 size_t line_number() const { return line_number_; } | |
| 30 size_t column_number() const { return column_number_; } | |
| 31 const base::string16& source() const { return source_; } | |
| 32 const base::string16& function() const { return function_; } | |
| 33 | |
| 34 // set_ functions are for IPC use. | |
| 35 void set_line_number(size_t line_number) { line_number_ = line_number; } | |
| 36 void set_column_number(size_t column_number) { | |
| 37 column_number_ = column_number; | |
| 38 } | |
| 39 void set_source(const base::string16& source) { source_ = source; } | |
| 40 void set_function(const base::string16& function) { function_ = function; } | |
| 41 | |
| 42 bool operator==(const StackFrame& rhs) const; | |
| 43 | |
| 44 private: | |
| 45 size_t line_number_; | |
| 46 size_t column_number_; | |
| 47 base::string16 source_; | |
| 48 base::string16 function_; // optional | |
| 49 }; | |
| 50 */ | |
| 51 | |
| 52 struct StackFrame { | |
| 53 StackFrame(); | |
| 54 StackFrame(const StackFrame& frame); | |
| 55 StackFrame(size_t line_number, | |
| 56 size_t column_number, | |
| 57 const base::string16& source, | |
| 58 const base::string16& function); | |
| 59 ~StackFrame(); | |
| 60 | |
| 61 // Construct a stack frame from a reported plain-text frame. | |
| 62 static scoped_ptr<StackFrame> CreateFromText( | |
| 63 const base::string16& frame_text); | |
| 64 | |
| 65 bool operator==(const StackFrame& rhs) const; | |
| 66 | |
| 67 size_t line_number; | |
| 68 size_t column_number; | |
| 69 base::string16 source; | |
| 70 base::string16 function; // optional | |
| 71 }; | |
| 72 | |
| 73 typedef std::vector<StackFrame> StackTrace; | |
| 74 | |
| 75 } // namespace extensions | |
| 76 | |
| 77 #endif // EXTENSIONS_COMMON_STACK_FRAME | |
| 78 | |
| OLD | NEW |