Bug 917667 - Add the check of receving unknown connection type. r=gene

This commit is contained in:
John Shih 2013-09-18 14:57:28 +08:00
parent 12bccd213b
commit 4042563776

View File

@ -22,6 +22,7 @@ const TOPIC_INTERFACE_REGISTERED = "network-interface-registered";
const TOPIC_INTERFACE_UNREGISTERED = "network-interface-unregistered";
const NET_TYPE_WIFI = Ci.nsINetworkInterface.NETWORK_TYPE_WIFI;
const NET_TYPE_MOBILE = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE;
const NET_TYPE_UNKNOWN = Ci.nsINetworkInterface.NETWORK_TYPE_UNKNOWN;
// The maximum traffic amount can be saved in the |cachedAppStats|.
const MAX_CACHED_TRAFFIC = 500 * 1000 * 1000; // 500 MB
@ -424,8 +425,8 @@ this.NetworkStatsService = {
aTimeStamp + " " + aRxBytes + " " + aTxBytes);
}
// |aAppId| can not be 0 or null in this case.
if (!aAppId) {
// Check if |aAppId| and |aConnectionType| are valid.
if (!aAppId || aConnectionType == NET_TYPE_UNKNOWN) {
return;
}