Bug 1686616 - make HttpActivityDistributor use Components instead of Services. r=kmag,necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D105525
This commit is contained in:
Alexis Beingessner 2021-02-18 13:26:30 +00:00
parent 442e2d6fa1
commit 972f085576
3 changed files with 6 additions and 3 deletions

View File

@ -12,6 +12,7 @@
#include "HttpTransactionChild.h"
#include "HttpConnectionMgrChild.h"
#include "mozilla/Assertions.h"
#include "mozilla/Components.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/ipc/CrashReporterClient.h"
#include "mozilla/ipc/BackgroundChild.h"
@ -381,7 +382,7 @@ mozilla::ipc::IPCResult
SocketProcessChild::RecvOnHttpActivityDistributorActivated(
const bool& aIsActivated) {
if (nsCOMPtr<nsIHttpActivityObserver> distributor =
services::GetHttpActivityDistributor()) {
components::HttpActivityDistributor::Service()) {
distributor->SetIsActive(aIsActivated);
}
return IPC_OK();

View File

@ -10,6 +10,7 @@
#include "CachePushChecker.h"
#include "HttpTransactionParent.h"
#include "SocketProcessHost.h"
#include "mozilla/Components.h"
#include "mozilla/dom/MemoryReportRequest.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/IPCStreamAlloc.h"
@ -276,7 +277,7 @@ mozilla::ipc::IPCResult SocketProcessParent::RecvObserveHttpActivity(
const uint32_t& aActivitySubtype, const PRTime& aTimestamp,
const uint64_t& aExtraSizeData, const nsCString& aExtraStringData) {
nsCOMPtr<nsIHttpActivityDistributor> activityDistributor =
services::GetHttpActivityDistributor();
components::HttpActivityDistributor::Service();
MOZ_ASSERT(activityDistributor);
Unused << activityDistributor->ObserveActivityWithArgs(

View File

@ -15,6 +15,7 @@
#include "NSSErrorsService.h"
#include "TunnelUtils.h"
#include "base/basictypes.h"
#include "mozilla/Components.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/Tokenizer.h"
#include "mozilla/StaticPrefs_network.h"
@ -289,7 +290,7 @@ nsresult nsHttpTransaction::Init(
mTrafficCategory = trafficCategory;
mActivityDistributor = services::GetHttpActivityDistributor();
mActivityDistributor = components::HttpActivityDistributor::Service();
if (!mActivityDistributor) {
return NS_ERROR_NOT_AVAILABLE;
}