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

Side by Side Diff: extensions/renderer/resources/uncaught_exception_handler.js

Issue 678393002: Send extension console messages to the right WebFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // Handles uncaught exceptions thrown by extensions. By default this is to 5 // Handles uncaught exceptions thrown by extensions. By default this is to
6 // log an error message, but tests may override this behaviour. 6 // log an error message, but tests may override this behaviour.
7 var handler = function(message, e) { 7 var handler = function(message, e) {
8 console.error(message); 8 window.console.error(message);
not at google - send to devlin 2014/10/28 16:00:41 The use of console rather than window.console here
9 }; 9 };
10 10
11 /** 11 /**
12 * Append the error description and stack trace to |message|. 12 * Append the error description and stack trace to |message|.
13 * 13 *
14 * @param {string} message - The prefix of the error message. 14 * @param {string} message - The prefix of the error message.
15 * @param {Error|*} e - The thrown error object. This object is potentially 15 * @param {Error|*} e - The thrown error object. This object is potentially
16 * unsafe, because it could be generated by an extension. 16 * unsafe, because it could be generated by an extension.
17 * @param {string=} priorStackTrace - The stack trace to be appended to the 17 * @param {string=} priorStackTrace - The stack trace to be appended to the
18 * error message. This stack trace must not include stack frames of |e.stack|, 18 * error message. This stack trace must not include stack frames of |e.stack|,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 }; 101 };
102 102
103 // |newHandler| A function which matches |handler|. 103 // |newHandler| A function which matches |handler|.
104 exports.setHandler = function(newHandler) { 104 exports.setHandler = function(newHandler) {
105 handler = newHandler; 105 handler = newHandler;
106 }; 106 };
107 107
108 exports.getStackTrace = getStackTrace; 108 exports.getStackTrace = getStackTrace;
109 exports.getExtensionStackTrace = getExtensionStackTrace; 109 exports.getExtensionStackTrace = getExtensionStackTrace;
110 exports.safeErrorToString = safeErrorToString; 110 exports.safeErrorToString = safeErrorToString;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698