Bug 995430 - send header when user is signed into a children\'s account. r=mcmanus

This commit is contained in:
Doug Turner 2014-05-05 14:30:42 -07:00
Родитель cc10beffc2
Коммит da491f36e8
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -47,6 +47,7 @@
#include "nsCRT.h"
#include "SpdyZlibReporter.h"
#include "nsIMemoryReporter.h"
#include "nsIParentalControlsService.h"
#include "mozilla/net/NeckoChild.h"
#include "mozilla/Telemetry.h"
@ -174,6 +175,7 @@ nsHttpHandler::nsHttpHandler()
, mDoNotTrackEnabled(false)
, mDoNotTrackValue(1)
, mSafeHintEnabled(false)
, mParentalControlEnabled(false)
, mTelemetryEnabled(false)
, mAllowExperiments(true)
, mHandlerActive(false)
@ -352,6 +354,10 @@ nsHttpHandler::Init()
if (NS_FAILED(mWifiTickler->Init()))
mWifiTickler = nullptr;
nsCOMPtr<nsIParentalControlsService> pc = do_CreateInstance("@mozilla.org/parental-controls-service;1");
if (pc) {
pc->GetParentalControlsEnabled(&mParentalControlEnabled);
}
return NS_OK;
}
@ -421,7 +427,7 @@ nsHttpHandler::AddStandardRequestHeaders(nsHttpHeaderArray *request)
}
// add the "Send Hint" header
if (mSafeHintEnabled) {
if (mSafeHintEnabled || mParentalControlEnabled) {
rv = request->SetHeader(nsHttp::Prefer, NS_LITERAL_CSTRING("safe"));
if (NS_FAILED(rv)) return rv;
}

Просмотреть файл

@ -437,6 +437,7 @@ private:
// for broadcasting safe hint;
bool mSafeHintEnabled;
bool mParentalControlEnabled;
// Whether telemetry is reported or not
uint32_t mTelemetryEnabled : 1;