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

Side by Side Diff: extensions/renderer/resources/last_error.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: Created 5 years, 2 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 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 var GetAvailability = requireNative('v8_context').GetAvailability; 5 var GetAvailability = requireNative('v8_context').GetAvailability;
6 var GetGlobal = requireNative('sendRequest').GetGlobal; 6 var GetGlobal = requireNative('sendRequest').GetGlobal;
7 7
8 // Utility for setting chrome.*.lastError. 8 // Utility for setting chrome.*.lastError.
9 // 9 //
10 // A utility here is useful for two reasons: 10 // A utility here is useful for two reasons:
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 * @param {string=} stack - Stack trace of the call up to the error. 127 * @param {string=} stack - Stack trace of the call up to the error.
128 */ 128 */
129 function reportIfUnchecked(name, targetChrome, stack) { 129 function reportIfUnchecked(name, targetChrome, stack) {
130 if (hasAccessed(targetChrome) || !hasError(targetChrome)) 130 if (hasAccessed(targetChrome) || !hasError(targetChrome))
131 return; 131 return;
132 var message = targetChrome.runtime.lastError.message; 132 var message = targetChrome.runtime.lastError.message;
133 console.error("Unchecked runtime.lastError while running " + 133 console.error("Unchecked runtime.lastError while running " +
134 (name || "unknown") + ": " + message + (stack ? "\n" + stack : "")); 134 (name || "unknown") + ": " + message + (stack ? "\n" + stack : ""));
135 } 135 }
136 136
137 exports.clear = clear; 137 exports.$set('clear', clear);
Devlin 2015/10/23 22:08:28 Once we decide what's best here, this'll need to b
138 exports.hasAccessed = hasAccessed; 138 exports.$set('hasAccessed', hasAccessed);
139 exports.hasError = hasError; 139 exports.$set('hasError', hasError);
140 exports.set = set; 140 exports.$set('set', set);
141 exports.run = run; 141 exports.$set('run', run);
142 exports.reportIfUnchecked = reportIfUnchecked; 142 exports.$set('reportIfUnchecked', reportIfUnchecked);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698