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

Unified Diff: extensions/browser/extension_error.h

Issue 23007021: Report Javascript Runtime Errors to the Error Console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_feldman
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | extensions/browser/extension_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_error.h
diff --git a/extensions/browser/extension_error.h b/extensions/browser/extension_error.h
index c5be1696e71ab1d9ba99bee385b31621cbe7b1da..6ee7791f66c603497fe6be5697c4cdcc8db2a59d 100644
--- a/extensions/browser/extension_error.h
+++ b/extensions/browser/extension_error.h
@@ -11,6 +11,8 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/strings/string16.h"
+#include "extensions/common/stack_frame.h"
+#include "url/gurl.h"
namespace extensions {
@@ -83,52 +85,27 @@ class ManifestError : public ExtensionError {
class RuntimeError : public ExtensionError {
public:
- struct StackFrame {
- size_t line_number;
- size_t column_number;
- // This is stored as a string (rather than a url) since it can be a
- // Chrome script file (e.g., event_bindings.js).
- base::string16 url;
- base::string16 function; // optional
-
- // STL-Required constructor
- StackFrame();
-
- StackFrame(size_t frame_line,
- size_t frame_column,
- const base::string16& frame_url,
- const base::string16& frame_function /* can be empty */);
-
- ~StackFrame();
-
- bool operator==(const StackFrame& rhs) const;
- };
- typedef std::vector<StackFrame> StackTrace;
-
RuntimeError(bool from_incognito,
const base::string16& source,
const base::string16& message,
- logging::LogSeverity level,
- const base::string16& details);
+ const StackTrace& stack_trace,
+ const GURL& context_url,
+ logging::LogSeverity level);
virtual ~RuntimeError();
virtual std::string PrintForTest() const OVERRIDE;
- const base::string16& execution_context_url() const {
- return execution_context_url_;
- }
+ const GURL& context_url() const { return context_url_; }
const StackTrace& stack_trace() const { return stack_trace_; }
private:
virtual bool IsEqualImpl(const ExtensionError* rhs) const OVERRIDE;
- // Parse the JSON |details| passed to the error. This includes a stack trace
- // and an execution context url.
- void ParseDetails(const base::string16& details);
- // Try to determine the ID of the extension. This may be obtained through the
- // reported source, or through the execution context url.
- void DetermineExtensionID();
+ // Since we piggy-back onto other error reporting systems (like V8 and
+ // WebKit), the reported information may need to be cleaned up in order to be
+ // in a consistent format.
+ void CleanUpInit();
- base::string16 execution_context_url_;
+ GURL context_url_;
StackTrace stack_trace_;
DISALLOW_COPY_AND_ASSIGN(RuntimeError);
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | extensions/browser/extension_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698