mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 677166 - Part 5 - Use a pref for connection.metered. r=sicking
This commit is contained in:
parent
5889593b3a
commit
a280e39ab5
@ -39,4 +39,5 @@
|
||||
[scriptable, uuid(0bd0bcc8-ca92-43fa-97bd-aec8d79edb24)]
|
||||
interface nsIDOMMozConnection : nsISupports
|
||||
{
|
||||
readonly attribute boolean metered;
|
||||
};
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "Connection.h"
|
||||
#include "nsIDOMClassInfo.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
DOMCI_DATA(MozConnection, mozilla::dom::network::Connection)
|
||||
|
||||
@ -44,6 +45,9 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
namespace network {
|
||||
|
||||
const char* Connection::sMeteredPrefName = "dom.network.metered";
|
||||
const bool Connection::sMeteredDefaultValue = false;
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(Connection)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMozConnection)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
@ -53,6 +57,14 @@ NS_INTERFACE_MAP_END
|
||||
NS_IMPL_ADDREF(Connection)
|
||||
NS_IMPL_RELEASE(Connection)
|
||||
|
||||
NS_IMETHODIMP
|
||||
Connection::GetMetered(bool* aMetered)
|
||||
{
|
||||
*aMetered = Preferences::GetBool(sMeteredPrefName,
|
||||
sMeteredDefaultValue);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
} // namespace network
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -49,6 +49,10 @@ class Connection : public nsIDOMMozConnection
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMMOZCONNECTION
|
||||
|
||||
private:
|
||||
static const char* sMeteredPrefName;
|
||||
static const bool sMeteredDefaultValue;
|
||||
};
|
||||
|
||||
} // namespace network
|
||||
|
@ -3416,6 +3416,7 @@ pref("profiler.entries", 100000);
|
||||
|
||||
// Network API
|
||||
pref("dom.network.enabled", true);
|
||||
pref("dom.network.metered", false);
|
||||
#ifdef XP_WIN
|
||||
// On 32-bit Windows, fire a low-memory notification if we have less than this
|
||||
// many mb of virtual address space available.
|
||||
|
Loading…
Reference in New Issue
Block a user