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_BROWSER_EXTENSION_ERROR_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_ERROR_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_ERROR_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_ERROR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 base::string16 manifest_key_; | 90 base::string16 manifest_key_; |
91 // If present, this is a more-specific location of the error - for instance, | 91 // If present, this is a more-specific location of the error - for instance, |
92 // a specific permission which is incorrect, rather than simply "permissions". | 92 // a specific permission which is incorrect, rather than simply "permissions". |
93 base::string16 manifest_specific_; | 93 base::string16 manifest_specific_; |
94 | 94 |
95 DISALLOW_COPY_AND_ASSIGN(ManifestError); | 95 DISALLOW_COPY_AND_ASSIGN(ManifestError); |
96 }; | 96 }; |
97 | 97 |
98 class RuntimeError : public ExtensionError { | 98 class RuntimeError : public ExtensionError { |
99 public: | 99 public: |
100 RuntimeError(bool from_incognito, | 100 RuntimeError(const std::string& extension_id, // optional, sometimes unknown. |
| 101 bool from_incognito, |
101 const base::string16& source, | 102 const base::string16& source, |
102 const base::string16& message, | 103 const base::string16& message, |
103 const StackTrace& stack_trace, | 104 const StackTrace& stack_trace, |
104 const GURL& context_url, | 105 const GURL& context_url, |
105 logging::LogSeverity level); | 106 logging::LogSeverity level); |
106 virtual ~RuntimeError(); | 107 virtual ~RuntimeError(); |
107 | 108 |
108 virtual std::string PrintForTest() const OVERRIDE; | 109 virtual std::string PrintForTest() const OVERRIDE; |
109 | 110 |
110 const GURL& context_url() const { return context_url_; } | 111 const GURL& context_url() const { return context_url_; } |
111 const StackTrace& stack_trace() const { return stack_trace_; } | 112 const StackTrace& stack_trace() const { return stack_trace_; } |
112 private: | 113 private: |
113 virtual bool IsEqualImpl(const ExtensionError* rhs) const OVERRIDE; | 114 virtual bool IsEqualImpl(const ExtensionError* rhs) const OVERRIDE; |
114 | 115 |
115 // Since we piggy-back onto other error reporting systems (like V8 and | 116 // Since we piggy-back onto other error reporting systems (like V8 and |
116 // WebKit), the reported information may need to be cleaned up in order to be | 117 // WebKit), the reported information may need to be cleaned up in order to be |
117 // in a consistent format. | 118 // in a consistent format. |
118 void CleanUpInit(); | 119 void CleanUpInit(); |
119 | 120 |
120 GURL context_url_; | 121 GURL context_url_; |
121 StackTrace stack_trace_; | 122 StackTrace stack_trace_; |
122 | 123 |
123 DISALLOW_COPY_AND_ASSIGN(RuntimeError); | 124 DISALLOW_COPY_AND_ASSIGN(RuntimeError); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace extensions | 127 } // namespace extensions |
127 | 128 |
128 #endif // EXTENSIONS_BROWSER_EXTENSION_ERROR_H_ | 129 #endif // EXTENSIONS_BROWSER_EXTENSION_ERROR_H_ |
OLD | NEW |