| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This contains unprivileged javascript APIs for extensions and apps. It | 5 // This contains unprivileged javascript APIs for extensions and apps. It |
| 6 // can be loaded by any extension-related context, such as content scripts or | 6 // can be loaded by any extension-related context, such as content scripts or |
| 7 // background pages. See user_script_slave.cc for script that is loaded by | 7 // background pages. See user_script_slave.cc for script that is loaded by |
| 8 // content scripts only. | 8 // content scripts only. |
| 9 | 9 |
| 10 require('json_schema'); | 10 require('json_schema'); |
| 11 require('event_bindings'); |
| 11 var json = require('json'); | 12 var json = require('json'); |
| 12 var lastError = require('lastError'); | 13 var lastError = require('lastError'); |
| 13 var miscNatives = requireNative('miscellaneous_bindings'); | 14 var miscNatives = requireNative('miscellaneous_bindings'); |
| 14 var chrome = requireNative('chrome').GetChrome(); | |
| 15 var CloseChannel = miscNatives.CloseChannel; | 15 var CloseChannel = miscNatives.CloseChannel; |
| 16 var PortAddRef = miscNatives.PortAddRef; | 16 var PortAddRef = miscNatives.PortAddRef; |
| 17 var PortRelease = miscNatives.PortRelease; | 17 var PortRelease = miscNatives.PortRelease; |
| 18 var PostMessage = miscNatives.PostMessage; | 18 var PostMessage = miscNatives.PostMessage; |
| 19 var BindToGC = miscNatives.BindToGC; | 19 var BindToGC = miscNatives.BindToGC; |
| 20 | 20 |
| 21 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 21 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
| 22 | 22 |
| 23 var processNatives = requireNative('process'); | 23 var processNatives = requireNative('process'); |
| 24 var manifestVersion = processNatives.GetManifestVersion(); | 24 var manifestVersion = processNatives.GetManifestVersion(); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 var targetId = null; | 314 var targetId = null; |
| 315 if (lastArg >= 0) | 315 if (lastArg >= 0) |
| 316 targetId = args[lastArg--]; | 316 targetId = args[lastArg--]; |
| 317 | 317 |
| 318 if (lastArg != -1) | 318 if (lastArg != -1) |
| 319 throw new Error('Invalid arguments to ' + functionName + '.'); | 319 throw new Error('Invalid arguments to ' + functionName + '.'); |
| 320 return [targetId, request, responseCallback]; | 320 return [targetId, request, responseCallback]; |
| 321 } | 321 } |
| 322 | 322 |
| 323 exports.sendMessageUpdateArguments = sendMessageUpdateArguments; | 323 exports.sendMessageUpdateArguments = sendMessageUpdateArguments; |
| OLD | NEW |