Skip to content

Commit

Permalink
Backed out changeset 798a47cd74d5 (bug 1441391) for build bustages. C…
Browse files Browse the repository at this point in the history
…LOSED TREE
  • Loading branch information
dgluca committed Mar 9, 2018
1 parent 012e1bb commit 7847f15
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 44 deletions.
1 change: 1 addition & 0 deletions netwerk/dns/TRR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ NS_IMETHODIMP
TRR::Notify(nsITimer *aTimer)
{
if (aTimer == mTimeout) {
LOG(("TRR request for %s timed out\n", mHost.get()));
mTimeout = nullptr;
Cancel();
} else {
Expand Down
39 changes: 0 additions & 39 deletions netwerk/dns/TRRService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ TRRService::TRRService()
, mUseGET(false)
, mClearTRRBLStorage(false)
, mConfirmationState(CONFIRM_INIT)
, mRetryConfirmInterval(1000)
{
MOZ_ASSERT(NS_IsMainThread(), "wrong thread");
}
Expand Down Expand Up @@ -84,19 +83,13 @@ bool
TRRService::Enabled()
{
if (mConfirmationState == CONFIRM_INIT && !mWaitForCaptive) {
LOG(("TRRService::Enabled => CONFIRM_TRYING\n"));
mConfirmationState = CONFIRM_TRYING;
}

if (mConfirmationState == CONFIRM_TRYING) {
LOG(("TRRService::Enabled MaybeConfirm()\n"));
MaybeConfirm();
}

if (mConfirmationState != CONFIRM_OK) {
LOG(("TRRService::Enabled mConfirmationState=%d\n", (int)mConfirmationState));
}

return (mConfirmationState == CONFIRM_OK);
}

Expand Down Expand Up @@ -297,8 +290,6 @@ TRRService::MaybeConfirm()
{
if ((mMode == MODE_NATIVEONLY) || mConfirmer ||
mConfirmationState != CONFIRM_TRYING) {
LOG(("TRRService:MaybeConfirm mode=%d, mConfirmer=%p mConfirmationState=%d\n",
(int)mMode, mConfirmer, (int)mConfirmationState));
return;
}
nsAutoCString host;
Expand Down Expand Up @@ -487,24 +478,6 @@ TRRService::TRRBlacklist(const nsACString &aHost, bool privateBrowsing, bool aPa
}
}

NS_IMETHODIMP
TRRService::Notify(nsITimer *aTimer)
{
if (aTimer == mRetryConfirmTimer) {
mRetryConfirmTimer = nullptr;
if (mConfirmationState == CONFIRM_FAILED) {
LOG(("TRRService retry NS of %s\n", mConfirmationNS.get()));
mConfirmationState = CONFIRM_TRYING;
MaybeConfirm();
}
} else {
MOZ_CRASH("Unknown timer");
}

return NS_OK;
}


AHostResolver::LookupStatus
TRRService::CompleteLookup(nsHostRecord *rec, nsresult status, AddrInfo *aNewRRSet, bool pb)
{
Expand All @@ -523,18 +496,6 @@ TRRService::CompleteLookup(nsHostRecord *rec, nsresult status, AddrInfo *aNewRRS
LOG(("TRRService finishing confirmation test %s %d %X\n",
mPrivateURI.get(), (int)mConfirmationState, (unsigned int)status));
mConfirmer = nullptr;
if ((mConfirmationState == CONFIRM_FAILED) && (mMode == MODE_TRRONLY)) {
// in TRR-only mode; retry failed confirmations
NS_NewTimerWithCallback(getter_AddRefs(mRetryConfirmTimer),
this, mRetryConfirmInterval,
nsITimer::TYPE_ONE_SHOT);
if (mRetryConfirmInterval < 64000) {
// double the interval up to this point
mRetryConfirmInterval *= 2;
}
} else {
mRetryConfirmInterval = 1000;
}
return LOOKUP_OK;
}

Expand Down
6 changes: 1 addition & 5 deletions netwerk/dns/TRRService.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ namespace net {

class TRRService
: public nsIObserver
, public nsITimerCallback
, public nsSupportsWeakReference
, public AHostResolver
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSITIMERCALLBACK

TRRService();
nsresult Init();
Expand Down Expand Up @@ -81,9 +79,7 @@ class TRRService
CONFIRM_FAILED = 3
};
Atomic<ConfirmationState, Relaxed> mConfirmationState;
RefPtr<TRR> mConfirmer;
nsCOMPtr<nsITimer> mRetryConfirmTimer;
uint32_t mRetryConfirmInterval; // milliseconds until retry
RefPtr<TRR> mConfirmer;
};

extern TRRService *gTRRService;
Expand Down

0 comments on commit 7847f15

Please sign in to comment.