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

Side by Side Diff: extensions/browser/extension_error.cc

Issue 23923003: Expand RuntimeErrors for ErrorConsole (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copyright fix Created 7 years, 3 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 unified diff | Download patch
« no previous file with comments | « extensions/browser/extension_error.h ('k') | extensions/common/extension_urls.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "extensions/browser/extension_error.h" 5 #include "extensions/browser/extension_error.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return ExtensionError::PrintForTest() + 93 return ExtensionError::PrintForTest() +
94 "\n Type: ManifestError"; 94 "\n Type: ManifestError";
95 } 95 }
96 96
97 bool ManifestError::IsEqualImpl(const ExtensionError* rhs) const { 97 bool ManifestError::IsEqualImpl(const ExtensionError* rhs) const {
98 // If two manifest errors have the same extension id and message (which are 98 // If two manifest errors have the same extension id and message (which are
99 // both checked in ExtensionError::IsEqual), then they are equal. 99 // both checked in ExtensionError::IsEqual), then they are equal.
100 return true; 100 return true;
101 } 101 }
102 102
103 RuntimeError::RuntimeError(bool from_incognito, 103 RuntimeError::RuntimeError(const std::string& extension_id,
104 bool from_incognito,
104 const string16& source, 105 const string16& source,
105 const string16& message, 106 const string16& message,
106 const StackTrace& stack_trace, 107 const StackTrace& stack_trace,
107 const GURL& context_url, 108 const GURL& context_url,
108 logging::LogSeverity level) 109 logging::LogSeverity level)
109 : ExtensionError(ExtensionError::RUNTIME_ERROR, 110 : ExtensionError(ExtensionError::RUNTIME_ERROR,
110 GURL(source).host(), 111 !extension_id.empty() ? extension_id : GURL(source).host(),
111 from_incognito, 112 from_incognito,
112 level, 113 level,
113 source, 114 source,
114 message), 115 message),
115 context_url_(context_url), 116 context_url_(context_url),
116 stack_trace_(stack_trace) { 117 stack_trace_(stack_trace) {
117 CleanUpInit(); 118 CleanUpInit();
118 } 119 }
119 120
120 RuntimeError::~RuntimeError() { 121 RuntimeError::~RuntimeError() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // other systems), the source won't match up with the final entry in the stack 166 // other systems), the source won't match up with the final entry in the stack
166 // trace. (For instance, in a browser action error, the source is the page - 167 // trace. (For instance, in a browser action error, the source is the page -
167 // sometimes the background page - but the error is thrown from the script.) 168 // sometimes the background page - but the error is thrown from the script.)
168 // Make the source match the stack trace, since that is more likely the cause 169 // Make the source match the stack trace, since that is more likely the cause
169 // of the error. 170 // of the error.
170 if (!stack_trace_.empty() && source_ != stack_trace_[0].source) 171 if (!stack_trace_.empty() && source_ != stack_trace_[0].source)
171 source_ = stack_trace_[0].source; 172 source_ = stack_trace_[0].source;
172 } 173 }
173 174
174 } // namespace extensions 175 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_error.h ('k') | extensions/common/extension_urls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698