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 // chrome.runtime.messaging API implementation. | 5 // chrome.runtime.messaging API implementation. |
6 | 6 |
7 // TODO(kalman): factor requiring chrome out of here. | 7 // TODO(kalman): factor requiring chrome out of here. |
8 var chrome = requireNative('chrome').GetChrome(); | 8 var chrome = requireNative('chrome').GetChrome(); |
9 var Event = require('event_bindings').Event; | 9 var Event = require('event_bindings').Event; |
10 var lastError = require('lastError'); | 10 var lastError = require('lastError'); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 var Port = utils.expose('Port', PortImpl, { functions: [ | 370 var Port = utils.expose('Port', PortImpl, { functions: [ |
371 'disconnect', | 371 'disconnect', |
372 'postMessage' | 372 'postMessage' |
373 ], | 373 ], |
374 properties: [ | 374 properties: [ |
375 'name', | 375 'name', |
376 'onDisconnect', | 376 'onDisconnect', |
377 'onMessage' | 377 'onMessage' |
378 ] }); | 378 ] }); |
379 | 379 |
380 exports.kRequestChannel = kRequestChannel; | 380 exports.$set('kRequestChannel', kRequestChannel); |
381 exports.kMessageChannel = kMessageChannel; | 381 exports.$set('kMessageChannel', kMessageChannel); |
382 exports.kNativeMessageChannel = kNativeMessageChannel; | 382 exports.$set('kNativeMessageChannel', kNativeMessageChannel); |
383 exports.Port = Port; | 383 exports.$set('Port', Port); |
384 exports.createPort = createPort; | 384 exports.$set('createPort', createPort); |
385 exports.sendMessageImpl = sendMessageImpl; | 385 exports.$set('sendMessageImpl', sendMessageImpl); |
386 exports.sendMessageUpdateArguments = sendMessageUpdateArguments; | 386 exports.$set('sendMessageUpdateArguments', sendMessageUpdateArguments); |
387 | 387 |
388 // For C++ code to call. | 388 // For C++ code to call. |
389 exports.hasPort = hasPort; | 389 exports.$set('hasPort', hasPort); |
390 exports.dispatchOnConnect = dispatchOnConnect; | 390 exports.$set('dispatchOnConnect', dispatchOnConnect); |
391 exports.dispatchOnDisconnect = dispatchOnDisconnect; | 391 exports.$set('dispatchOnDisconnect', dispatchOnDisconnect); |
392 exports.dispatchOnMessage = dispatchOnMessage; | 392 exports.$set('dispatchOnMessage', dispatchOnMessage); |
OLD | NEW |