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

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

Issue 508283002: Revert "Typecheck JS files for chrome://extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 stack_trace_(stack_trace), 151 stack_trace_(stack_trace),
152 render_view_id_(render_view_id), 152 render_view_id_(render_view_id),
153 render_process_id_(render_process_id) { 153 render_process_id_(render_process_id) {
154 CleanUpInit(); 154 CleanUpInit();
155 } 155 }
156 156
157 RuntimeError::~RuntimeError() { 157 RuntimeError::~RuntimeError() {
158 } 158 }
159 159
160 scoped_ptr<DictionaryValue> RuntimeError::ToValue() const { 160 scoped_ptr<DictionaryValue> RuntimeError::ToValue() const {
161 // The items which are to be written into value are also described in
162 // chrome/browser/resources/extensions/extension_error_overlay.js in @typedef
163 // for RuntimeError and StackTrace. Please update them whenever you add or
164 // remove any keys here.
165 scoped_ptr<DictionaryValue> value = ExtensionError::ToValue(); 161 scoped_ptr<DictionaryValue> value = ExtensionError::ToValue();
166 value->SetString(kContextUrlKey, context_url_.spec()); 162 value->SetString(kContextUrlKey, context_url_.spec());
167 value->SetInteger(kRenderViewIdKey, render_view_id_); 163 value->SetInteger(kRenderViewIdKey, render_view_id_);
168 value->SetInteger(kRenderProcessIdKey, render_process_id_); 164 value->SetInteger(kRenderProcessIdKey, render_process_id_);
169 165
170 base::ListValue* trace_value = new base::ListValue; 166 base::ListValue* trace_value = new base::ListValue;
171 for (StackTrace::const_iterator iter = stack_trace_.begin(); 167 for (StackTrace::const_iterator iter = stack_trace_.begin();
172 iter != stack_trace_.end(); ++iter) { 168 iter != stack_trace_.end(); ++iter) {
173 DictionaryValue* frame_value = new DictionaryValue; 169 DictionaryValue* frame_value = new DictionaryValue;
174 frame_value->SetInteger(kLineNumberKey, iter->line_number); 170 frame_value->SetInteger(kLineNumberKey, iter->line_number);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // other systems), the source won't match up with the final entry in the stack 224 // other systems), the source won't match up with the final entry in the stack
229 // trace. (For instance, in a browser action error, the source is the page - 225 // trace. (For instance, in a browser action error, the source is the page -
230 // sometimes the background page - but the error is thrown from the script.) 226 // sometimes the background page - but the error is thrown from the script.)
231 // Make the source match the stack trace, since that is more likely the cause 227 // Make the source match the stack trace, since that is more likely the cause
232 // of the error. 228 // of the error.
233 if (!stack_trace_.empty() && source_ != stack_trace_[0].source) 229 if (!stack_trace_.empty() && source_ != stack_trace_[0].source)
234 source_ = stack_trace_[0].source; 230 source_ = stack_trace_[0].source;
235 } 231 }
236 232
237 } // namespace extensions 233 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | ui/webui/resources/js/cr/event_target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698