Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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); |
| OLD | NEW |