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

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

Issue 1417513003: [Extensions] Don't allow built-in extensions code to be overridden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jochen's Created 5 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
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 console.error(message);
9 }; 9 };
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 /** 90 /**
91 * Formats the error message and invokes the error handler. 91 * Formats the error message and invokes the error handler.
92 * 92 *
93 * @param {string} message - Error message prefix. 93 * @param {string} message - Error message prefix.
94 * @param {Error|*} e - Thrown object. 94 * @param {Error|*} e - Thrown object.
95 * @param {string=} priorStackTrace - Error message suffix. 95 * @param {string=} priorStackTrace - Error message suffix.
96 * @see formatErrorMessage 96 * @see formatErrorMessage
97 */ 97 */
98 exports.handle = function(message, e, priorStackTrace) { 98 exports.$set('handle', function(message, e, priorStackTrace) {
99 message = formatErrorMessage(message, e, priorStackTrace); 99 message = formatErrorMessage(message, e, priorStackTrace);
100 handler(message, e); 100 handler(message, e);
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.$set('setHandler', function(newHandler) {
105 handler = newHandler; 105 handler = newHandler;
106 }; 106 });
107 107
108 exports.getStackTrace = getStackTrace; 108 exports.$set('getStackTrace', getStackTrace);
109 exports.getExtensionStackTrace = getExtensionStackTrace; 109 exports.$set('getExtensionStackTrace', getExtensionStackTrace);
110 exports.safeErrorToString = safeErrorToString; 110 exports.$set('safeErrorToString', safeErrorToString);
OLDNEW
« no previous file with comments | « extensions/renderer/resources/test_custom_bindings.js ('k') | extensions/renderer/resources/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698