diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 11:09:44 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-05-12 11:09:44 +0200 |
commit | cfe5ef4ac7cd59f094b538252161ad74223c47da (patch) | |
tree | e5c0ee7e70db84bd2bfc6062784006769e9df730 /dom/system/gonk/NetworkInterfaceListService.js | |
parent | 28cf922aa9af4d4b8e0a3ce91dc1270a55986909 (diff) | |
download | UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.gz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.lz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.tar.xz UXP-cfe5ef4ac7cd59f094b538252161ad74223c47da.zip |
Remove Gonk build directories
Diffstat (limited to 'dom/system/gonk/NetworkInterfaceListService.js')
-rw-r--r-- | dom/system/gonk/NetworkInterfaceListService.js | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/dom/system/gonk/NetworkInterfaceListService.js b/dom/system/gonk/NetworkInterfaceListService.js deleted file mode 100644 index 62fe046aa..000000000 --- a/dom/system/gonk/NetworkInterfaceListService.js +++ /dev/null @@ -1,110 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -const NETWORKLISTSERVICE_CONTRACTID = - "@mozilla.org/network/interface-list-service;1"; -const NETWORKLISTSERVICE_CID = - Components.ID("{3780be6e-7012-4e53-ade6-15212fb88a0d}"); - -XPCOMUtils.defineLazyServiceGetter(this, "cpmm", - "@mozilla.org/childprocessmessagemanager;1", - "nsISyncMessageSender"); - -function NetworkInterfaceListService () { -} - -NetworkInterfaceListService.prototype = { - classID: NETWORKLISTSERVICE_CID, - - QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkInterfaceListService]), - - getDataInterfaceList: function(aConditions) { - return new NetworkInterfaceList( - cpmm.sendSyncMessage( - 'NetworkInterfaceList:ListInterface', - { - excludeSupl: (aConditions & - Ci.nsINetworkInterfaceListService. - LIST_NOT_INCLUDE_SUPL_INTERFACES) != 0, - excludeMms: (aConditions & - Ci.nsINetworkInterfaceListService. - LIST_NOT_INCLUDE_MMS_INTERFACES) != 0, - excludeIms: (aConditions & - Ci.nsINetworkInterfaceListService. - LIST_NOT_INCLUDE_IMS_INTERFACES) != 0, - excludeDun: (aConditions & - Ci.nsINetworkInterfaceListService. - LIST_NOT_INCLUDE_DUN_INTERFACES) != 0, - excludeFota: (aConditions & - Ci.nsINetworkInterfaceListService. - LIST_NOT_INCLUDE_FOTA_INTERFACES) != 0 - } - )[0]); - } -}; - -function FakeNetworkInfo(aAttributes) { - this.state = aAttributes.state; - this.type = aAttributes.type; - this.name = aAttributes.name; - this.ips = aAttributes.ips; - this.prefixLengths = aAttributes.prefixLengths; - this.gateways = aAttributes.gateways; - this.dnses = aAttributes.dnses; -} -FakeNetworkInfo.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkInfo]), - - getAddresses: function (ips, prefixLengths) { - ips.value = this.ips.slice(); - prefixLengths.value = this.prefixLengths.slice(); - - return this.ips.length; - }, - - getGateways: function (count) { - if (count) { - count.value = this.gateways.length; - } - return this.gateways.slice(); - }, - - getDnses: function (count) { - if (count) { - count.value = this.dnses.length; - } - return this.dnses.slice(); - } -}; - -function NetworkInterfaceList (aInterfaceLiterals) { - this._interfaces = []; - for (let entry of aInterfaceLiterals) { - this._interfaces.push(new FakeNetworkInfo(entry)); - } -} - -NetworkInterfaceList.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkInterfaceList]), - - getNumberOfInterface: function() { - return this._interfaces.length; - }, - - getInterfaceInfo: function(index) { - if (!this._interfaces) { - return null; - } - return this._interfaces[index]; - } -}; - -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkInterfaceListService]); - |