| 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('send_request_natives').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: |
| 11 // 1. For backwards compatibility we need to set chrome.extension.lastError, | 11 // 1. For backwards compatibility we need to set chrome.extension.lastError, |
| 12 // but not all contexts actually have access to the extension namespace. | 12 // but not all contexts actually have access to the extension namespace. |
| 13 // 2. When calling across contexts, the global object that gets lastError set | 13 // 2. When calling across contexts, the global object that gets lastError set |
| 14 // needs to be that of the caller. We force callers to explicitly specify | 14 // needs to be that of the caller. We force callers to explicitly specify |
| 15 // the chrome object to try to prevent bugs here. | 15 // the chrome object to try to prevent bugs here. |
| 16 | 16 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } finally { | 115 } finally { |
| 116 clear(targetChrome); | 116 clear(targetChrome); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 exports.clear = clear; | 120 exports.clear = clear; |
| 121 exports.hasAccessed = hasAccessed; | 121 exports.hasAccessed = hasAccessed; |
| 122 exports.hasError = hasError; | 122 exports.hasError = hasError; |
| 123 exports.set = set; | 123 exports.set = set; |
| 124 exports.run = run; | 124 exports.run = run; |
| OLD | NEW |