зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 79425c851114 (bug 1755372) for causing build bustages on Connection.cpp. CLOSED TREE
This commit is contained in:
Родитель
f65a148d41
Коммит
1171737ea7
|
@ -1806,9 +1806,7 @@ network::Connection* Navigator::GetConnection(ErrorResult& aRv) {
|
|||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return nullptr;
|
||||
}
|
||||
nsCOMPtr<Document> doc = mWindow->GetExtantDoc();
|
||||
mConnection = network::Connection::CreateForWindow(
|
||||
mWindow, nsContentUtils::ShouldResistFingerprinting(doc));
|
||||
mConnection = network::Connection::CreateForWindow(mWindow);
|
||||
}
|
||||
|
||||
return mConnection;
|
||||
|
|
|
@ -23,13 +23,11 @@ namespace mozilla::dom::network {
|
|||
// we're not the only class with that name.
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(dom::network::Connection, DOMEventTargetHelper)
|
||||
|
||||
Connection::Connection(nsPIDOMWindowInner* aWindow,
|
||||
bool aShouldResistFingerprinting)
|
||||
Connection::Connection(nsPIDOMWindowInner* aWindow)
|
||||
: DOMEventTargetHelper(aWindow),
|
||||
mType(static_cast<ConnectionType>(kDefaultType)),
|
||||
mIsWifi(kDefaultIsWifi),
|
||||
mDHCPGateway(kDefaultDHCPGateway),
|
||||
mShouldResistFingerprinting(aShouldResistFingerprinting),
|
||||
mBeenShutDown(false) {
|
||||
Telemetry::Accumulate(Telemetry::NETWORK_CONNECTION_COUNT, 1);
|
||||
}
|
||||
|
@ -65,16 +63,16 @@ void Connection::Update(ConnectionType aType, bool aIsWifi,
|
|||
mIsWifi = aIsWifi;
|
||||
mDHCPGateway = aDHCPGateway;
|
||||
|
||||
if (aNotify && previousType != aType && !mShouldResistFingerprinting) {
|
||||
if (aNotify && previousType != aType &&
|
||||
!nsContentUtils::ShouldResistFingerprinting()) {
|
||||
DispatchTrustedEvent(CHANGE_EVENT_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
Connection* Connection::CreateForWindow(nsPIDOMWindowInner* aWindow,
|
||||
bool aShouldResistFingerprinting) {
|
||||
Connection* Connection::CreateForWindow(nsPIDOMWindowInner* aWindow) {
|
||||
MOZ_ASSERT(aWindow);
|
||||
return new ConnectionMainThread(aWindow, aShouldResistFingerprinting);
|
||||
return new ConnectionMainThread(aWindow);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -28,8 +28,7 @@ class Connection : public DOMEventTargetHelper {
|
|||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
static Connection* CreateForWindow(nsPIDOMWindowInner* aWindow,
|
||||
bool aShouldResistFingerprinting);
|
||||
static Connection* CreateForWindow(nsPIDOMWindowInner* aWindow);
|
||||
|
||||
static already_AddRefed<Connection> CreateForWorker(
|
||||
WorkerPrivate* aWorkerPrivate, ErrorResult& aRv);
|
||||
|
@ -61,7 +60,7 @@ class Connection : public DOMEventTargetHelper {
|
|||
IMPL_EVENT_HANDLER(typechange)
|
||||
|
||||
protected:
|
||||
Connection(nsPIDOMWindowInner* aWindow, bool aShouldResistFingerprinting);
|
||||
Connection(nsPIDOMWindowInner* aWindow);
|
||||
virtual ~Connection();
|
||||
|
||||
void Update(ConnectionType aType, bool aIsWifi, uint32_t aDHCPGateway,
|
||||
|
@ -86,11 +85,6 @@ class Connection : public DOMEventTargetHelper {
|
|||
uint32_t mDHCPGateway;
|
||||
|
||||
bool mBeenShutDown;
|
||||
|
||||
/**
|
||||
* If ResistFingerprinting is enabled or disabled.
|
||||
*/
|
||||
bool mShouldResistFingerprinting;
|
||||
};
|
||||
|
||||
} // namespace network
|
||||
|
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
namespace mozilla::dom::network {
|
||||
|
||||
ConnectionMainThread::ConnectionMainThread(nsPIDOMWindowInner* aWindow,
|
||||
bool aShouldResistFingerprinting)
|
||||
: Connection(aWindow, aShouldResistFingerprinting) {
|
||||
ConnectionMainThread::ConnectionMainThread(nsPIDOMWindowInner* aWindow)
|
||||
: Connection(aWindow) {
|
||||
hal::RegisterNetworkObserver(this);
|
||||
|
||||
hal::NetworkInformation networkInfo;
|
||||
|
|
|
@ -18,8 +18,7 @@ namespace network {
|
|||
class ConnectionMainThread final : public Connection,
|
||||
public hal::NetworkObserver {
|
||||
public:
|
||||
explicit ConnectionMainThread(nsPIDOMWindowInner* aWindow,
|
||||
bool aShouldResistFingerprinting);
|
||||
explicit ConnectionMainThread(nsPIDOMWindowInner* aWindow);
|
||||
|
||||
// For IObserver
|
||||
void Notify(const hal::NetworkInformation& aNetworkInfo) override;
|
||||
|
|
|
@ -140,9 +140,7 @@ class NotifyRunnable : public WorkerRunnable {
|
|||
/* static */
|
||||
already_AddRefed<ConnectionWorker> ConnectionWorker::Create(
|
||||
WorkerPrivate* aWorkerPrivate, ErrorResult& aRv) {
|
||||
bool shouldResistFingerprinting =
|
||||
aWorkerPrivate->ShouldResistFingerprinting();
|
||||
RefPtr<ConnectionWorker> c = new ConnectionWorker(shouldResistFingerprinting);
|
||||
RefPtr<ConnectionWorker> c = new ConnectionWorker();
|
||||
c->mProxy = ConnectionProxy::Create(aWorkerPrivate, c);
|
||||
if (!c->mProxy) {
|
||||
aRv.ThrowTypeError("The Worker thread is shutting down.");
|
||||
|
@ -163,8 +161,7 @@ already_AddRefed<ConnectionWorker> ConnectionWorker::Create(
|
|||
return c.forget();
|
||||
}
|
||||
|
||||
ConnectionWorker::ConnectionWorker(bool aShouldResistFingerprinting)
|
||||
: Connection(nullptr, aShouldResistFingerprinting) {
|
||||
ConnectionWorker::ConnectionWorker() : Connection(nullptr) {
|
||||
MOZ_ASSERT(IsCurrentThreadRunningWorker());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class ConnectionWorker final : public Connection {
|
|||
WorkerPrivate* aWorkerPrivate, ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
explicit ConnectionWorker(bool aShouldResistFingerprinting);
|
||||
ConnectionWorker();
|
||||
~ConnectionWorker();
|
||||
|
||||
virtual void ShutdownInternal() override;
|
||||
|
|
Загрузка…
Ссылка в новой задаче