| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_COMMON_STACK_FRAME_H_ | 5 #ifndef EXTENSIONS_COMMON_STACK_FRAME_H_ |
| 6 #define EXTENSIONS_COMMON_STACK_FRAME_H_ | 6 #define EXTENSIONS_COMMON_STACK_FRAME_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 | 16 |
| 17 struct StackFrame { | 17 struct StackFrame { |
| 18 StackFrame(); | 18 StackFrame(); |
| 19 StackFrame(const StackFrame& frame); | 19 StackFrame(const StackFrame& frame); |
| 20 StackFrame(size_t line_number, | 20 StackFrame(uint32_t line_number, |
| 21 size_t column_number, | 21 uint32_t column_number, |
| 22 const base::string16& source, | 22 const base::string16& source, |
| 23 const base::string16& function); | 23 const base::string16& function); |
| 24 ~StackFrame(); | 24 ~StackFrame(); |
| 25 | 25 |
| 26 // Construct a stack frame from a reported plain-text frame. | 26 // Construct a stack frame from a reported plain-text frame. |
| 27 static scoped_ptr<StackFrame> CreateFromText( | 27 static scoped_ptr<StackFrame> CreateFromText( |
| 28 const base::string16& frame_text); | 28 const base::string16& frame_text); |
| 29 | 29 |
| 30 bool operator==(const StackFrame& rhs) const; | 30 bool operator==(const StackFrame& rhs) const; |
| 31 | 31 |
| 32 size_t line_number; | 32 uint32_t line_number; |
| 33 size_t column_number; | 33 uint32_t column_number; |
| 34 base::string16 source; | 34 base::string16 source; |
| 35 base::string16 function; // optional | 35 base::string16 function; // optional |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 typedef std::vector<StackFrame> StackTrace; | 38 typedef std::vector<StackFrame> StackTrace; |
| 39 | 39 |
| 40 } // namespace extensions | 40 } // namespace extensions |
| 41 | 41 |
| 42 #endif // EXTENSIONS_COMMON_STACK_FRAME_H_ | 42 #endif // EXTENSIONS_COMMON_STACK_FRAME_H_ |
| 43 | 43 |
| OLD | NEW |