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

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: Joi's 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
Index: extensions/browser/extension_error.h
diff --git a/extensions/browser/extension_error.h b/extensions/browser/extension_error.h
index 1cd4a7b69bfd6f6252f0b71bf75786f923fcb684..00ecf4f9a39434ee596fa4b271bc8d629e58389e 100644
--- a/extensions/browser/extension_error.h
+++ b/extensions/browser/extension_error.h
@@ -10,7 +10,10 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
+#include "url/gurl.h"
namespace extensions {
@@ -75,42 +78,43 @@ class JavascriptRuntimeError : public ExtensionError {
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();
+
+ static scoped_ptr<StackFrame> CreateFromText(const base::string16& text);
};
- typedef std::vector<StackFrame> StackTrace;
+ typedef ScopedVector<StackFrame> StackTrace;
JavascriptRuntimeError(bool from_incognito,
const base::string16& source,
const base::string16& message,
- logging::LogSeverity level,
- const base::string16& details);
+ const base::string16& stack_trace,
+ int32 line_number,
+ const GURL& context_url,
+ logging::LogSeverity level);
virtual ~JavascriptRuntimeError();
virtual std::string PrintForTest() const OVERRIDE;
+ const GURL& context_url() const { return context_url_; }
logging::LogSeverity level() const { return level_; }
- const base::string16& execution_context_url() const {
- return execution_context_url_;
- }
const StackTrace& stack_trace() const { return stack_trace_; }
private:
- // 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();
-
+ // Parse the stack trace from either the |message| or the |stack_trace|
+ // string.
+ void GetStackTrace(const base::string16& message,
+ const base::string16& stack_trace,
+ int32 line_number);
+ // 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();
+
+ GURL context_url_;
logging::LogSeverity level_;
- base::string16 execution_context_url_;
StackTrace stack_trace_;
DISALLOW_COPY_AND_ASSIGN(JavascriptRuntimeError);

Powered by Google App Engine
This is Rietveld 408576698