Merge m-c to autoland. a=merge

This commit is contained in:
Ryan VanderMeulen 2017-05-25 16:44:01 -04:00
commit d3f265330e
87 changed files with 26561 additions and 18384 deletions

View File

@ -37,7 +37,6 @@ python/**
rdf/**
servo/**
startupcache/**
testing/**
tools/update-packaging/**
uriloader/**
view/**
@ -295,6 +294,19 @@ security/nss/**
services/sync/modules/constants.js
services/sync/services-sync.js
# testing/ exclusions
testing/firefox-ui/**
testing/marionette/**
testing/mochitest/**
testing/modules/**
testing/mozbase/**
testing/profiles/**
testing/specialpowers/**
testing/talos/**
testing/web-platform/**
testing/xpcshell/moz-http2/**
testing/xpcshell/node-http2/**
# Third party services
services/common/kinto-http-client.js
services/common/kinto-offline-client.js

View File

@ -132,8 +132,6 @@ AboutRedirector::NewChannel(nsIURI* aURI,
nsIChannel** result)
{
NS_ENSURE_ARG_POINTER(aURI);
NS_ENSURE_ARG_POINTER(aLoadInfo);
NS_ASSERTION(result, "must not be null");
nsAutoCString path = GetAboutModuleName(aURI);
@ -174,22 +172,26 @@ AboutRedirector::NewChannel(nsIURI* aURI,
NS_ENSURE_SUCCESS(rv, rv);
// If tempURI links to an external URI (i.e. something other than
// chrome:// or resource://) then set the result principal URI on the
// load info which forces the channel prncipal to reflect the displayed
// chrome:// or resource://) then set the LOAD_REPLACE flag on the
// channel which forces the channel owner to reflect the displayed
// URL rather then being the systemPrincipal.
bool isUIResource = false;
rv = NS_URIChainHasFlags(tempURI, nsIProtocolHandler::URI_IS_UI_RESOURCE,
&isUIResource);
NS_ENSURE_SUCCESS(rv, rv);
nsLoadFlags loadFlags = isUIResource
? static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL)
: static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);
rv = NS_NewChannelInternal(getter_AddRefs(tempChannel),
tempURI,
aLoadInfo);
aLoadInfo,
nullptr, // aLoadGroup
nullptr, // aCallbacks
loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
if (!isUIResource) {
aLoadInfo->SetResultPrincipalURI(tempURI);
}
tempChannel->SetOriginalURI(aURI);
NS_ADDREF(*result = tempChannel);

View File

@ -339,6 +339,6 @@ menuitem[cmd="cmd_clearhistory"][disabled] {
.search-setting-button-compact > .button-box > .button-icon {
list-style-image: url("chrome://browser/skin/gear.svg");
filter: url(chrome://global/skin/filters.svg#fill);
-moz-context-properties: fill;
fill: currentColor;
}

View File

@ -322,6 +322,6 @@
.search-setting-button-compact > .button-box > .button-icon {
list-style-image: url("chrome://browser/skin/gear.svg");
filter: url(chrome://global/skin/filters.svg#fill);
-moz-context-properties: fill;
fill: currentColor;
}

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 32 32">
<path id="glyphShape-gear" d="M28,16c0-1.7,0.9-3.1,2-3.3c-0.4-1.5-0.9-2.9-1.7-4.2c-0.9,0.7-2.6,0.3-3.8-0.9c-1.2-1.2-1.6-2.8-0.9-3.8 c-1.3-0.8-2.7-1.4-4.2-1.7c-0.2,1.1-1.6,2-3.3,2S13,3.1,12.8,2c-1.5,0.4-2.9,0.9-4.2,1.7c0.7,0.9,0.3,2.6-0.9,3.8 c-1.4,1.1-3,1.5-4,0.9C2.9,9.7,2.4,11.2,2,12.7c1.1,0.2,2,1.6,2,3.3s-0.9,3.1-2,3.3c0.4,1.5,0.9,2.9,1.7,4.2 c0.9-0.7,2.6-0.3,3.8,0.9c1.2,1.2,1.6,2.8,0.9,3.8c1.3,0.8,2.7,1.4,4.2,1.7c0.2-1.1,1.6-2,3.3-2s3.1,0.9,3.3,2 c1.5-0.4,2.9-0.9,4.2-1.7c-0.7-0.9-0.3-2.6,0.9-3.8c1.3-1.2,2.8-1.6,3.8-0.9c0.8-1.3,1.4-2.7,1.7-4.2C28.9,19.1,28,17.7,28,16z M16,24c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8S20.4,24,16,24z"/>
<path fill="context-fill" d="M28,16c0-1.7,0.9-3.1,2-3.3c-0.4-1.5-0.9-2.9-1.7-4.2c-0.9,0.7-2.6,0.3-3.8-0.9c-1.2-1.2-1.6-2.8-0.9-3.8 c-1.3-0.8-2.7-1.4-4.2-1.7c-0.2,1.1-1.6,2-3.3,2S13,3.1,12.8,2c-1.5,0.4-2.9,0.9-4.2,1.7c0.7,0.9,0.3,2.6-0.9,3.8 c-1.4,1.1-3,1.5-4,0.9C2.9,9.7,2.4,11.2,2,12.7c1.1,0.2,2,1.6,2,3.3s-0.9,3.1-2,3.3c0.4,1.5,0.9,2.9,1.7,4.2 c0.9-0.7,2.6-0.3,3.8,0.9c1.2,1.2,1.6,2.8,0.9,3.8c1.3,0.8,2.7,1.4,4.2,1.7c0.2-1.1,1.6-2,3.3-2s3.1,0.9,3.3,2 c1.5-0.4,2.9-0.9,4.2-1.7c-0.7-0.9-0.3-2.6,0.9-3.8c1.3-1.2,2.8-1.6,3.8-0.9c0.8-1.3,1.4-2.7,1.7-4.2C28.9,19.1,28,17.7,28,16z M16,24c-4.4,0-8-3.6-8-8s3.6-8,8-8s8,3.6,8,8S20.4,24,16,24z"/>
</svg>

Before

Width:  |  Height:  |  Size: 983 B

After

Width:  |  Height:  |  Size: 943 B

View File

@ -335,6 +335,6 @@
.search-setting-button-compact > .button-box > .button-icon {
list-style-image: url("chrome://browser/skin/gear.svg");
filter: url(chrome://global/skin/filters.svg#fill);
-moz-context-properties: fill;
fill: currentColor;
}

View File

@ -105,8 +105,6 @@ nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
nsresult rv;
NS_ENSURE_ARG_POINTER(aURI);
NS_ENSURE_ARG_POINTER(aLoadInfo);
NS_PRECONDITION(aResult, "Null out param");
#ifdef DEBUG
@ -147,12 +145,6 @@ nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
return rv;
}
// We don't want to allow the inner protocol handler modify the result principal URI
// since we want either |aURI| or anything pre-set by upper layers to prevail.
nsCOMPtr<nsIURI> savedResultPrincipalURI;
rv = aLoadInfo->GetResultPrincipalURI(getter_AddRefs(savedResultPrincipalURI));
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewChannelInternal(getter_AddRefs(result),
resolvedURI,
aLoadInfo);
@ -176,8 +168,9 @@ nsChromeProtocolHandler::NewChannel2(nsIURI* aURI,
// Make sure that the channel remembers where it was
// originally loaded from.
rv = aLoadInfo->SetResultPrincipalURI(savedResultPrincipalURI);
NS_ENSURE_SUCCESS(rv, rv);
nsLoadFlags loadFlags = 0;
result->GetLoadFlags(&loadFlags);
result->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE);
rv = result->SetOriginalURI(aURI);
if (NS_FAILED(rv)) return rv;

View File

@ -26,7 +26,6 @@ AboutURL.prototype = {
newChannel: function (aURI, aLoadInfo) {
let chan = Services.io.newChannelFromURIWithLoadInfo(this.uri, aLoadInfo);
chan.owner = Services.scriptSecurityManager.getSystemPrincipal();
chan.originalURI = aURI;
return chan;
},

View File

@ -158,7 +158,6 @@ nsAboutRedirector::NewChannel(nsIURI* aURI,
nsIChannel** aResult)
{
NS_ENSURE_ARG_POINTER(aURI);
NS_ENSURE_ARG_POINTER(aLoadInfo);
NS_ASSERTION(aResult, "must not be null");
nsAutoCString path;
@ -175,14 +174,9 @@ nsAboutRedirector::NewChannel(nsIURI* aURI,
rv = NS_NewURI(getter_AddRefs(tempURI), kRedirMap[i].url);
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewChannelInternal(getter_AddRefs(tempChannel),
tempURI,
aLoadInfo);
NS_ENSURE_SUCCESS(rv, rv);
// If tempURI links to an external URI (i.e. something other than
// chrome:// or resource://) then set result principal URI on the
// load info which forces the channel principal to reflect the displayed
// chrome:// or resource://) then set the LOAD_REPLACE flag on the
// channel which forces the channel owner to reflect the displayed
// URL rather then being the systemPrincipal.
bool isUIResource = false;
rv = NS_URIChainHasFlags(tempURI, nsIProtocolHandler::URI_IS_UI_RESOURCE,
@ -191,9 +185,17 @@ nsAboutRedirector::NewChannel(nsIURI* aURI,
bool isAboutBlank = NS_IsAboutBlank(tempURI);
if (!isUIResource && !isAboutBlank) {
aLoadInfo->SetResultPrincipalURI(tempURI);
}
nsLoadFlags loadFlags = isUIResource || isAboutBlank
? static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL)
: static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);
rv = NS_NewChannelInternal(getter_AddRefs(tempChannel),
tempURI,
aLoadInfo,
nullptr, // aLoadGroup
nullptr, // aCallbacks
loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
tempChannel->SetOriginalURI(aURI);

View File

@ -11168,12 +11168,6 @@ nsDocShell::DoURILoad(nsIURI* aURI,
if (aOriginalURI) {
channel->SetOriginalURI(aOriginalURI);
// The LOAD_REPLACE flag and its handling here will be removed as part
// of bug 1319110. For now preserve its restoration here to not break
// any code expecting it being set specially on redirected channels.
// If the flag has originally been set to change result of
// NS_GetFinalChannelURI it won't have any effect and also won't cause
// any harm.
if (aLoadReplace) {
uint32_t loadFlags;
channel->GetLoadFlags(&loadFlags);

View File

@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/ImageBitmap.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/dom/ImageBitmapBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/StructuredCloneTags.h"
@ -175,10 +175,14 @@ CropAndCopyDataSourceSurface(DataSourceSurface* aSurface, const IntRect& aCropRe
+ surfPortion.x * bytesPerPixel;
uint8_t* dstBufferPtr = dstMap.GetData() + dest.y * dstMap.GetStride()
+ dest.x * bytesPerPixel;
const uint32_t copiedBytesPerRaw = surfPortion.width * bytesPerPixel;
CheckedInt<uint32_t> copiedBytesPerRaw =
CheckedInt<uint32_t>(surfPortion.width) * bytesPerPixel;
if (!copiedBytesPerRaw.isValid()) {
return nullptr;
}
for (int i = 0; i < surfPortion.height; ++i) {
memcpy(dstBufferPtr, srcBufferPtr, copiedBytesPerRaw);
memcpy(dstBufferPtr, srcBufferPtr, copiedBytesPerRaw.value());
srcBufferPtr += srcMap.GetStride();
dstBufferPtr += dstMap.GetStride();
}

View File

@ -35,7 +35,7 @@ NS_IMPL_ISUPPORTS(PresentationIPCService,
PresentationIPCService::PresentationIPCService()
{
ContentChild* contentChild = ContentChild::GetSingleton();
if (NS_WARN_IF(!contentChild)) {
if (NS_WARN_IF(!contentChild || contentChild->IsShuttingDown())) {
return;
}
sPresentationChild = new PresentationChild(this);

View File

@ -1595,6 +1595,12 @@ PRThreadFromThread(nsIThread* aThread)
return result;
}
class SimpleWorkerHolder final : public WorkerHolder
{
public:
virtual bool Notify(Status aStatus) { return true; }
};
} /* anonymous namespace */
NS_IMPL_ISUPPORTS_INHERITED0(MainThreadReleaseRunnable, Runnable)
@ -4579,11 +4585,21 @@ WorkerPrivate::Constructor(JSContext* aCx,
const nsACString& aServiceWorkerScope,
WorkerLoadInfo* aLoadInfo, ErrorResult& aRv)
{
// If this is a sub-worker, we need to keep the parent worker alive until this
// one is registered.
UniquePtr<SimpleWorkerHolder> holder;
WorkerPrivate* parent = NS_IsMainThread() ?
nullptr :
GetCurrentThreadWorkerPrivate();
if (parent) {
parent->AssertIsOnWorkerThread();
holder.reset(new SimpleWorkerHolder());
if (!holder->HoldWorker(parent, Canceling)) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
} else {
AssertIsOnMainThread();
}

View File

@ -22,6 +22,8 @@
#include "SkTemplates.h"
#include "SkUtils.h"
#include "mozilla/Assertions.h"
///////////////////////////////////////////////////////////////////////////////
/*
@ -1008,6 +1010,8 @@ static inline void aaa_walk_convex_edges(SkAnalyticEdge* prevHead,
SkAnalyticEdge* riteE = (SkAnalyticEdge*) leftE->fNext;
SkAnalyticEdge* currE = (SkAnalyticEdge*) riteE->fNext;
bool currENullInit = !currE, currEChanged = false;
SkFixed y = SkTMax(leftE->fUpperY, riteE->fUpperY);
#ifdef SK_DEBUG
@ -1020,11 +1024,17 @@ static inline void aaa_walk_convex_edges(SkAnalyticEdge* prevHead,
// a left edge but no right edge in a given y scan line) due to precision limit.
while (leftE->fLowerY <= y) { // Due to smooth jump, we may pass multiple short edges
if (update_edge(leftE, y)) {
if (!currE) {
MOZ_RELEASE_ASSERT((!currENullInit || currEChanged) || (stop_y < SkFixedFloorToInt(SK_MaxS32)), "Please help us! Use crash reporter to report me and comment what site you were viewing when this happened.");
MOZ_RELEASE_ASSERT(!currENullInit || currEChanged, "Please help us! Use crash reporter to report me and comment what site you were viewing when this happened.");
MOZ_RELEASE_ASSERT(stop_y < SkFixedFloorToInt(SK_MaxS32), "Please help us! Use crash reporter to report me and comment what site you were viewing when this happened.");
}
if (SkFixedFloorToInt(currE->fUpperY) >= stop_y) {
goto END_WALK;
}
leftE = currE;
currE = (SkAnalyticEdge*)currE->fNext;
currEChanged = true;
}
}
while (riteE->fLowerY <= y) { // Due to smooth jump, we may pass multiple short edges
@ -1034,6 +1044,7 @@ static inline void aaa_walk_convex_edges(SkAnalyticEdge* prevHead,
}
riteE = currE;
currE = (SkAnalyticEdge*)currE->fNext;
currEChanged = true;
}
}

View File

@ -617,7 +617,7 @@ imgRequestProxy* NewStaticProxy(imgRequestProxy* aThis)
{
nsCOMPtr<nsIPrincipal> currentPrincipal;
aThis->GetImagePrincipal(getter_AddRefs(currentPrincipal));
RefPtr<image::Image> image = aThis->GetImage();
RefPtr<mozilla::image::Image> image = aThis->GetImage();
return new imgRequestProxyStatic(image, currentPrincipal);
}

View File

@ -21,7 +21,6 @@
#include "nsContentUtils.h"
#include "nsString.h"
#include "nsTArray.h"
#include "URIUtils.h"
namespace mozilla {
namespace net {
@ -305,13 +304,6 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
sandboxedLoadingPrincipalInfo = sandboxedLoadingPrincipalInfoTemp;
}
OptionalURIParams optionalResultPrincipalURI = mozilla::void_t();
nsCOMPtr<nsIURI> resultPrincipalURI;
Unused << aLoadInfo->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI));
if (resultPrincipalURI) {
SerializeURI(resultPrincipalURI, optionalResultPrincipalURI);
}
nsTArray<PrincipalInfo> redirectChainIncludingInternalRedirects;
for (const nsCOMPtr<nsIPrincipal>& principal : aLoadInfo->RedirectChainIncludingInternalRedirects()) {
rv = PrincipalToPrincipalInfo(principal, redirectChainIncludingInternalRedirects.AppendElement());
@ -330,7 +322,6 @@ LoadInfoToLoadInfoArgs(nsILoadInfo *aLoadInfo,
triggeringPrincipalInfo,
principalToInheritInfo,
sandboxedLoadingPrincipalInfo,
optionalResultPrincipalURI,
aLoadInfo->GetSecurityFlags(),
aLoadInfo->InternalContentPolicyType(),
static_cast<uint32_t>(aLoadInfo->GetTainting()),
@ -394,12 +385,6 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<nsIURI> resultPrincipalURI;
if (loadInfoArgs.resultPrincipalURI().type() != OptionalURIParams::Tvoid_t) {
resultPrincipalURI = DeserializeURI(loadInfoArgs.resultPrincipalURI());
NS_ENSURE_TRUE(resultPrincipalURI, NS_ERROR_UNEXPECTED);
}
nsTArray<nsCOMPtr<nsIPrincipal>> redirectChainIncludingInternalRedirects;
for (const PrincipalInfo& principalInfo : loadInfoArgs.redirectChainIncludingInternalRedirects()) {
nsCOMPtr<nsIPrincipal> redirectedPrincipal =
@ -421,7 +406,6 @@ LoadInfoArgsToLoadInfo(const OptionalLoadInfoArgs& aOptionalLoadInfoArgs,
triggeringPrincipal,
principalToInherit,
sandboxedLoadingPrincipal,
resultPrincipalURI,
loadInfoArgs.securityFlags(),
loadInfoArgs.contentPolicyType(),
static_cast<LoadTainting>(loadInfoArgs.tainting()),

View File

@ -3737,7 +3737,11 @@ SetGCCallback(JSContext* cx, unsigned argc, Value* vp)
if (!ToInt32(cx, v, &depth))
return false;
}
if (depth > int32_t(gcstats::Statistics::MAX_NESTING - 4)) {
if (depth < 0) {
JS_ReportErrorASCII(cx, "Nesting depth cannot be negative");
return false;
}
if (depth + gcstats::MAX_PHASE_NESTING > gcstats::Statistics::MAX_SUSPENDED_PHASES) {
JS_ReportErrorASCII(cx, "Nesting depth too large, would overflow");
return false;
}

View File

@ -70,6 +70,8 @@ MarkRootsPhaseKind = PhaseKind("MARK_ROOTS", "Mark Roots", 48, [
PhaseKind("MARK_COMPARTMENTS", "Mark Compartments", 54),
])
JoinParallelTasksPhaseKind = PhaseKind("JOIN_PARALLEL_TASKS", "Join Parallel Tasks", 67)
PhaseKindGraphRoots = [
PhaseKind("MUTATOR", "Mutator Running", 0),
PhaseKind("GC_BEGIN", "Begin Callback", 1),
@ -115,6 +117,7 @@ PhaseKindGraphRoots = [
PhaseKind("SWEEP_TYPES_BEGIN", "Sweep type tables and compilations", 31),
PhaseKind("SWEEP_TYPES_END", "Free type arena", 32),
]),
JoinParallelTasksPhaseKind
]),
PhaseKind("SWEEP_OBJECT", "Sweep Object", 33),
PhaseKind("SWEEP_STRING", "Sweep String", 34),
@ -124,13 +127,15 @@ PhaseKindGraphRoots = [
PhaseKind("SWEEP_SHAPE", "Sweep Shape", 36),
PhaseKind("SWEEP_JITCODE", "Sweep JIT code", 37),
PhaseKind("FINALIZE_END", "Finalize End Callback", 38),
PhaseKind("DESTROY", "Deallocate", 39)
PhaseKind("DESTROY", "Deallocate", 39),
JoinParallelTasksPhaseKind
]),
PhaseKind("COMPACT", "Compact", 40, [
PhaseKind("COMPACT_MOVE", "Compact Move", 41),
PhaseKind("COMPACT_UPDATE", "Compact Update", 42, [
MarkRootsPhaseKind,
PhaseKind("COMPACT_UPDATE_CELLS", "Compact Update Cells", 43),
JoinParallelTasksPhaseKind
]),
]),
PhaseKind("GC_END", "End Callback", 44),
@ -226,6 +231,10 @@ for phaseKind in AllPhaseKinds:
for index, phase in enumerate(phases):
phase.name = "%s_%d" % (phaseKind.name, index + 1)
# Find the maximum phase nesting.
MaxPhaseNesting = max(phase.depth for phase in AllPhases) + 1
# Generate code.
def writeList(out, items):
@ -262,6 +271,12 @@ def generateHeader(out):
"IMPLICIT_SUSPENSION"
]
writeEnumClass(out, "Phase", "uint8_t", phaseNames, extraPhases)
out.write("\n")
#
# Generate MAX_PHASE_NESTING constant.
#
out.write("static const size_t MAX_PHASE_NESTING = %d;\n" % MaxPhaseNesting)
def generateCpp(out):
#

View File

@ -124,10 +124,10 @@ t(TimeDuration duration)
return duration.ToMilliseconds();
}
Phase
inline Phase
Statistics::currentPhase() const
{
return phaseNestingDepth ? phaseNesting[phaseNestingDepth - 1] : Phase::NONE;
return phaseStack.empty() ? Phase::NONE : phaseStack.back();
}
PhaseKind
@ -137,7 +137,7 @@ Statistics::currentPhaseKind() const
// PhaseKind::MUTATOR phase.
Phase phase = currentPhase();
MOZ_ASSERT_IF(phase == Phase::MUTATOR, phaseNestingDepth == 1);
MOZ_ASSERT_IF(phase == Phase::MUTATOR, phaseStack.length() == 1);
if (phase == Phase::NONE || phase == Phase::MUTATOR)
return PhaseKind::NONE;
@ -638,8 +638,6 @@ Statistics::Statistics(JSRuntime* rt)
nonincrementalReason_(gc::AbortReason::None),
preBytes(0),
maxPauseInInterval(0),
phaseNestingDepth(0),
suspended(0),
sliceCallback(nullptr),
nurseryCollectionCallback(nullptr),
aborted(false),
@ -648,6 +646,10 @@ Statistics::Statistics(JSRuntime* rt)
{
for (auto& count : counts)
count = 0;
PodZero(&totalTimes_);
MOZ_ALWAYS_TRUE(phaseStack.reserve(MAX_PHASE_NESTING));
MOZ_ALWAYS_TRUE(suspendedPhases.reserve(MAX_SUSPENDED_PHASES));
const char* env = getenv("MOZ_GCTIMER");
if (env) {
@ -674,8 +676,6 @@ Statistics::Statistics(JSRuntime* rt)
enableProfiling_ = true;
profileThreshold_ = TimeDuration::FromMilliseconds(atoi(env));
}
PodZero(&totalTimes_);
}
Statistics::~Statistics()
@ -952,27 +952,31 @@ void
Statistics::endSlice()
{
if (!aborted) {
slices_.back().end = TimeStamp::Now();
slices_.back().endFaults = GetPageFaultCount();
slices_.back().finalState = runtime->gc.state();
auto& slice = slices_.back();
slice.end = TimeStamp::Now();
slice.endFaults = GetPageFaultCount();
slice.finalState = runtime->gc.state();
TimeDuration sliceTime = slices_.back().end - slices_.back().start;
TimeDuration sliceTime = slice.end - slice.start;
runtime->addTelemetry(JS_TELEMETRY_GC_SLICE_MS, t(sliceTime));
runtime->addTelemetry(JS_TELEMETRY_GC_RESET, slices_.back().wasReset());
if (slices_.back().wasReset())
runtime->addTelemetry(JS_TELEMETRY_GC_RESET_REASON, uint32_t(slices_.back().resetReason));
runtime->addTelemetry(JS_TELEMETRY_GC_RESET, slice.wasReset());
if (slice.wasReset())
runtime->addTelemetry(JS_TELEMETRY_GC_RESET_REASON, uint32_t(slice.resetReason));
if (slices_.back().budget.isTimeBudget()) {
int64_t budget_ms = slices_.back().budget.timeBudget.budget;
if (slice.budget.isTimeBudget()) {
int64_t budget_ms = slice.budget.timeBudget.budget;
runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_MS, budget_ms);
if (budget_ms == runtime->gc.defaultSliceBudget())
runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime));
// Record any phase that goes more than 2x over its budget.
if (sliceTime.ToMilliseconds() > 2 * budget_ms) {
PhaseKind longest = LongestPhaseSelfTime(slices_.back().phaseTimes);
uint8_t bucket = phaseKinds[longest].telemetryBucket;
runtime->addTelemetry(JS_TELEMETRY_GC_SLOW_PHASE, bucket);
reportLongestPhase(slice.phaseTimes, JS_TELEMETRY_GC_SLOW_PHASE);
// If we spend a significant length of time waiting for parallel
// tasks then report the longest task.
TimeDuration joinTime = SumPhase(PhaseKind::JOIN_PARALLEL_TASKS, slice.phaseTimes);
if (joinTime.ToMilliseconds() > budget_ms)
reportLongestPhase(slice.parallelTimes, JS_TELEMETRY_GC_SLOW_TASK);
}
}
@ -1013,17 +1017,28 @@ Statistics::endSlice()
}
}
void
Statistics::reportLongestPhase(const PhaseTimeTable& times, int telemetryId)
{
PhaseKind longest = LongestPhaseSelfTime(times);
if (longest == PhaseKind::NONE)
return;
uint8_t bucket = phaseKinds[longest].telemetryBucket;
runtime->addTelemetry(telemetryId, bucket);
}
bool
Statistics::startTimingMutator()
{
if (phaseNestingDepth != 0) {
if (phaseStack.length() != 0) {
// Should only be called from outside of GC.
MOZ_ASSERT(phaseNestingDepth == 1);
MOZ_ASSERT(phaseNesting[0] == Phase::MUTATOR);
MOZ_ASSERT(phaseStack.length() == 1);
MOZ_ASSERT(phaseStack[0] == Phase::MUTATOR);
return false;
}
MOZ_ASSERT(suspended == 0);
MOZ_ASSERT(suspendedPhases.empty());
timedGCTime = 0;
phaseStartTimes[Phase::MUTATOR] = TimeStamp();
@ -1038,7 +1053,7 @@ bool
Statistics::stopTimingMutator(double& mutator_ms, double& gc_ms)
{
// This should only be called from outside of GC, while timing the mutator.
if (phaseNestingDepth != 1 || phaseNesting[0] != Phase::MUTATOR)
if (phaseStack.length() != 1 || phaseStack[0] != Phase::MUTATOR)
return false;
endPhase(PhaseKind::MUTATOR);
@ -1053,30 +1068,27 @@ Statistics::suspendPhases(PhaseKind suspension)
{
MOZ_ASSERT(suspension == PhaseKind::EXPLICIT_SUSPENSION ||
suspension == PhaseKind::IMPLICIT_SUSPENSION);
while (phaseNestingDepth) {
MOZ_ASSERT(suspended < mozilla::ArrayLength(suspendedPhases));
Phase parent = phaseNesting[phaseNestingDepth - 1];
suspendedPhases[suspended++] = parent;
while (!phaseStack.empty()) {
MOZ_ASSERT(suspendedPhases.length() < MAX_SUSPENDED_PHASES);
Phase parent = phaseStack.back();
suspendedPhases.infallibleAppend(parent);
recordPhaseEnd(parent);
}
suspendedPhases[suspended++] = lookupChildPhase(suspension);
suspendedPhases.infallibleAppend(lookupChildPhase(suspension));
}
void
Statistics::resumePhases()
{
suspended--;
#ifdef DEBUG
Phase popped = suspendedPhases[suspended];
MOZ_ASSERT(popped == Phase::EXPLICIT_SUSPENSION ||
popped == Phase::IMPLICIT_SUSPENSION);
#endif
MOZ_ASSERT(suspendedPhases.back() == Phase::EXPLICIT_SUSPENSION ||
suspendedPhases.back() == Phase::IMPLICIT_SUSPENSION);
suspendedPhases.popBack();
while (suspended &&
suspendedPhases[suspended - 1] != Phase::EXPLICIT_SUSPENSION &&
suspendedPhases[suspended - 1] != Phase::IMPLICIT_SUSPENSION)
while (!suspendedPhases.empty() &&
suspendedPhases.back() != Phase::EXPLICIT_SUSPENSION &&
suspendedPhases.back() != Phase::IMPLICIT_SUSPENSION)
{
Phase resumePhase = suspendedPhases[--suspended];
Phase resumePhase = suspendedPhases.popCopy();
if (resumePhase == Phase::MUTATOR)
timedGCTime += TimeStamp::Now() - timedGCStart;
recordPhaseBegin(resumePhase);
@ -1090,9 +1102,8 @@ Statistics::beginPhase(PhaseKind phaseKind)
MOZ_ASSERT(phaseKind != PhaseKind::GC_BEGIN && phaseKind != PhaseKind::GC_END);
// PhaseKind::MUTATOR is suspended while performing GC.
if (currentPhase() == Phase::MUTATOR) {
if (currentPhase() == Phase::MUTATOR)
suspendPhases(PhaseKind::IMPLICIT_SUSPENSION);
}
recordPhaseBegin(lookupChildPhase(phaseKind));
}
@ -1103,12 +1114,10 @@ Statistics::recordPhaseBegin(Phase phase)
// Guard against any other re-entry.
MOZ_ASSERT(!phaseStartTimes[phase]);
MOZ_ASSERT(phaseNestingDepth < MAX_NESTING);
MOZ_ASSERT(phaseStack.length() < MAX_PHASE_NESTING);
MOZ_ASSERT(phases[phase].parent == currentPhase());
phaseNesting[phaseNestingDepth] = phase;
phaseNestingDepth++;
phaseStack.infallibleAppend(phase);
phaseStartTimes[phase] = TimeStamp::Now();
}
@ -1120,7 +1129,7 @@ Statistics::recordPhaseEnd(Phase phase)
if (phase == Phase::MUTATOR)
timedGCStart = now;
phaseNestingDepth--;
phaseStack.popBack();
TimeDuration t = now - phaseStartTimes[phase];
if (!slices_.empty())
@ -1140,19 +1149,35 @@ Statistics::endPhase(PhaseKind phaseKind)
// When emptying the stack, we may need to return to timing the mutator
// (PhaseKind::MUTATOR).
if (phaseNestingDepth == 0 &&
suspended > 0 &&
suspendedPhases[suspended - 1] == Phase::IMPLICIT_SUSPENSION)
if (phaseStack.empty() &&
!suspendedPhases.empty() &&
suspendedPhases.back() == Phase::IMPLICIT_SUSPENSION)
{
resumePhases();
}
}
void
Statistics::recordParallelPhase(PhaseKind phaseKind, TimeDuration duration)
{
Phase phase = lookupChildPhase(phaseKind);
// Record the duration for all phases in the tree up to the root. This is
// not strictly necessary but makes the invariant that parent phase times
// include their children apply to both phaseTimes and parallelTimes.
while (phase != Phase::NONE) {
if (!slices_.empty())
slices_.back().parallelTimes[phase] += duration;
parallelTimes[phase] += duration;
phase = phases[phase].parent;
}
}
void
Statistics::endParallelPhase(PhaseKind phaseKind, const GCParallelTask* task)
{
Phase phase = lookupChildPhase(phaseKind);
phaseNestingDepth--;
phaseStack.popBack();
if (!slices_.empty())
slices_.back().phaseTimes[phase] += task->duration();

View File

@ -132,6 +132,7 @@ struct Statistics
void beginPhase(PhaseKind phaseKind);
void endPhase(PhaseKind phaseKind);
void endParallelPhase(PhaseKind phaseKind, const GCParallelTask* task);
void recordParallelPhase(PhaseKind phaseKind, TimeDuration duration);
// Occasionally, we may be in the middle of something that is tracked by
// this class, and we need to do something unusual (eg evict the nursery)
@ -205,7 +206,7 @@ struct Statistics
PhaseKind currentPhaseKind() const;
static const size_t MAX_NESTING = 20;
static const size_t MAX_SUSPENDED_PHASES = MAX_PHASE_NESTING * 3;
struct SliceData {
SliceData(SliceBudget budget, JS::gcreason::Reason reason,
@ -225,6 +226,7 @@ struct Statistics
TimeStamp start, end;
size_t startFaults, endFaults;
PhaseTimeTable phaseTimes;
PhaseTimeTable parallelTimes;
TimeDuration duration() const { return end - start; }
bool wasReset() const { return resetReason != gc::AbortReason::None; }
@ -284,6 +286,7 @@ struct Statistics
/* Total time in a given phase for this GC. */
PhaseTimeTable phaseTimes;
PhaseTimeTable parallelTimes;
/* Number of events of this type for this GC. */
EnumeratedArray<Stat,
@ -301,8 +304,7 @@ struct Statistics
mutable TimeDuration maxPauseInInterval;
/* Phases that are currently on stack. */
Array<Phase, MAX_NESTING> phaseNesting;
size_t phaseNestingDepth;
Vector<Phase, MAX_PHASE_NESTING, SystemAllocPolicy> phaseStack;
/*
* Certain phases can interrupt the phase stack, eg callback phases. When
@ -311,8 +313,7 @@ struct Statistics
* suspensions by suspending multiple stacks with a PhaseKind::SUSPENSION in
* between).
*/
Array<Phase, MAX_NESTING * 3> suspendedPhases;
size_t suspended;
Vector<Phase, MAX_SUSPENDED_PHASES, SystemAllocPolicy> suspendedPhases;
/* Sweep times for SCCs of compartments. */
Vector<TimeDuration, 0, SystemAllocPolicy> sccTimes;
@ -358,6 +359,8 @@ FOR_EACH_GC_PROFILE_TIME(DEFINE_TIME_KEY)
void sccDurations(TimeDuration* total, TimeDuration* maxPause) const;
void printStats();
void reportLongestPhase(const PhaseTimeTable& times, int telemetryId);
UniqueChars formatCompactSlicePhaseTimes(const PhaseTimeTable& phaseTimes) const;
UniqueChars formatDetailedDescription() const;
@ -392,37 +395,24 @@ struct MOZ_RAII AutoGCSlice
struct MOZ_RAII AutoPhase
{
AutoPhase(Statistics& stats, PhaseKind phaseKind)
: stats(stats), task(nullptr), phaseKind(phaseKind), enabled(true)
: stats(stats), phaseKind(phaseKind), enabled(true)
{
stats.beginPhase(phaseKind);
}
AutoPhase(Statistics& stats, bool condition, PhaseKind phaseKind)
: stats(stats), task(nullptr), phaseKind(phaseKind), enabled(condition)
{
if (enabled)
stats.beginPhase(phaseKind);
}
AutoPhase(Statistics& stats, const GCParallelTask& task, PhaseKind phaseKind)
: stats(stats), task(&task), phaseKind(phaseKind), enabled(true)
: stats(stats), phaseKind(phaseKind), enabled(condition)
{
if (enabled)
stats.beginPhase(phaseKind);
}
~AutoPhase() {
if (enabled) {
// Bug 1309651 - we only record active thread time (including time
// spent waiting to join with helper threads), but should start
// recording total work on helper threads sometime by calling
// endParallelPhase here if task is nonnull.
if (enabled)
stats.endPhase(phaseKind);
}
}
Statistics& stats;
const GCParallelTask* task;
PhaseKind phaseKind;
bool enabled;
};

View File

@ -38,7 +38,6 @@ JS::Zone::Zone(JSRuntime* rt, ZoneGroup* group)
weakCaches_(group),
gcWeakKeys_(group, SystemAllocPolicy(), rt->randomHashCodeScrambler()),
gcSweepGroupEdges_(group),
hasDeadProxies_(group),
typeDescrObjects_(group, this, SystemAllocPolicy()),
markedAtoms_(group),
atomCache_(group),

View File

@ -373,16 +373,9 @@ struct Zone : public JS::shadow::Zone,
// that can't be determined by examining this zone by itself.
js::ZoneGroupData<ZoneSet> gcSweepGroupEdges_;
// Zones with dead proxies require an extra scan through the wrapper map,
// so track whether any dead proxies are known to exist.
js::ZoneGroupData<bool> hasDeadProxies_;
public:
ZoneSet& gcSweepGroupEdges() { return gcSweepGroupEdges_.ref(); }
bool hasDeadProxies() { return hasDeadProxies_; }
void setHasDeadProxies(bool b) { hasDeadProxies_ = b; }
// Keep track of all TypeDescr and related objects in this compartment.
// This is used by the GC to trace them all first when compacting, since the
// TypedObject trace hook may access these objects.

View File

@ -0,0 +1,6 @@
const root3 = newGlobal();
function test(constructor) {
if (!nukeCCW(root3.load)) {}
}
test(Map);
test(Set);

View File

@ -959,8 +959,6 @@ struct JSCompartment
void findOutgoingEdges(js::gc::ZoneComponentFinder& finder);
MOZ_MUST_USE bool findDeadProxyZoneEdges(bool* foundAny);
js::DtoaCache dtoaCache;
js::NewProxyCache newProxyCache;

View File

@ -130,6 +130,7 @@ enum {
JS_TELEMETRY_GC_MARK_GRAY_MS,
JS_TELEMETRY_GC_SLICE_MS,
JS_TELEMETRY_GC_SLOW_PHASE,
JS_TELEMETRY_GC_SLOW_TASK,
JS_TELEMETRY_GC_MMU_50,
JS_TELEMETRY_GC_RESET,
JS_TELEMETRY_GC_RESET_REASON,

View File

@ -4480,31 +4480,6 @@ JSCompartment::findOutgoingEdges(ZoneComponentFinder& finder)
}
}
bool
JSCompartment::findDeadProxyZoneEdges(bool* foundAny)
{
// As an optimization, return whether any dead proxy objects are found in
// this compartment so that if a zone has none, its cross compartment
// wrappers do not need to be scanned.
*foundAny = false;
for (js::WrapperMap::Enum e(crossCompartmentWrappers); !e.empty(); e.popFront()) {
Value value = e.front().value().get();
if (value.isObject()) {
if (IsDeadProxyObject(&value.toObject())) {
*foundAny = true;
CrossCompartmentKey& key = e.front().mutableKey();
Zone* wrappedZone = key.as<JSObject*>()->zone();
if (!wrappedZone->isGCMarking())
continue;
if (!wrappedZone->gcSweepGroupEdges().put(zone()))
return false;
}
}
}
return true;
}
void
Zone::findOutgoingEdges(ZoneComponentFinder& finder)
{
@ -4546,20 +4521,6 @@ GCRuntime::findInterZoneEdges()
return false;
}
for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
if (zone->hasDeadProxies()) {
bool foundInZone = false;
for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next()) {
bool foundInCompartment = false;
if (!comp->findDeadProxyZoneEdges(&foundInCompartment))
return false;
foundInZone = foundInZone || foundInCompartment;
}
if (!foundInZone)
zone->setHasDeadProxies(false);
}
}
return true;
}
@ -4855,8 +4816,6 @@ js::NotifyGCNukeWrapper(JSObject* obj)
* remember to mark it.
*/
RemoveFromGrayList(obj);
obj->zone()->setHasDeadProxies(true);
}
enum {
@ -5071,8 +5030,11 @@ GCRuntime::startTask(GCParallelTask& task, gcstats::PhaseKind phase, AutoLockHel
void
GCRuntime::joinTask(GCParallelTask& task, gcstats::PhaseKind phase, AutoLockHelperThreadState& locked)
{
gcstats::AutoPhase ap(stats(), task, phase);
task.joinWithLockHeld(locked);
{
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::JOIN_PARALLEL_TASKS);
task.joinWithLockHeld(locked);
}
stats().recordParallelPhase(phase, task.duration());
}
void
@ -5194,7 +5156,7 @@ class MOZ_RAII js::gc::AutoRunParallelTask : public GCParallelTask
public:
AutoRunParallelTask(JSRuntime* rt, Func func, gcstats::PhaseKind phase,
AutoLockHelperThreadState& lock)
AutoLockHelperThreadState& lock)
: GCParallelTask(rt),
func_(func),
phase_(phase),
@ -5222,6 +5184,8 @@ GCRuntime::beginSweepingSweepGroup()
using namespace gcstats;
AutoSCC scc(stats(), sweepGroupIndex);
bool sweepingAtoms = false;
for (GCSweepGroupIter zone(rt); !zone.done(); zone.next()) {
/* Set the GC state to sweeping. */
@ -5270,7 +5234,6 @@ GCRuntime::beginSweepingSweepGroup()
sweepAtoms.emplace(rt, SweepAtoms, PhaseKind::SWEEP_ATOMS, lock);
AutoPhase ap(stats(), PhaseKind::SWEEP_COMPARTMENTS);
AutoSCC scc(stats(), sweepGroupIndex);
AutoRunParallelTask sweepCCWrappers(rt, SweepCCWrappers, PhaseKind::SWEEP_CC_WRAPPER, lock);
AutoRunParallelTask sweepObjectGroups(rt, SweepObjectGroups, PhaseKind::SWEEP_TYPE_OBJECT, lock);
@ -5297,7 +5260,6 @@ GCRuntime::beginSweepingSweepGroup()
// or on the background thread.
for (GCSweepGroupIter zone(rt); !zone.done(); zone.next()) {
AutoSCC scc(stats(), sweepGroupIndex);
zone->arenas.queueForForegroundSweep(&fop, ForegroundObjectFinalizePhase);
for (unsigned i = 0; i < ArrayLength(IncrementalFinalizePhases); ++i)

View File

@ -492,8 +492,8 @@ js::IsCrossCompartmentWrapper(JSObject* obj)
!!(Wrapper::wrapperHandler(obj)->flags() & Wrapper::CROSS_COMPARTMENT);
}
JS_FRIEND_API(void)
js::NukeCrossCompartmentWrapper(JSContext* cx, JSObject* wrapper)
static void
NukeRemovedCrossCompartmentWrapper(JSContext* cx, JSObject* wrapper)
{
MOZ_ASSERT(wrapper->is<CrossCompartmentWrapperObject>());
@ -504,6 +504,16 @@ js::NukeCrossCompartmentWrapper(JSContext* cx, JSObject* wrapper)
MOZ_ASSERT(IsDeadProxyObject(wrapper));
}
JS_FRIEND_API(void)
js::NukeCrossCompartmentWrapper(JSContext* cx, JSObject* wrapper)
{
JSCompartment* comp = wrapper->compartment();
auto ptr = comp->lookupWrapper(Wrapper::wrappedObject(wrapper));
if (ptr)
comp->removeWrapper(ptr);
NukeRemovedCrossCompartmentWrapper(cx, wrapper);
}
/*
* NukeChromeCrossCompartmentWrappersForGlobal reaches into chrome and cuts
* all of the cross-compartment wrappers that point to objects parented to
@ -573,7 +583,7 @@ js::NukeCrossCompartmentWrappers(JSContext* cx,
// Now this is the wrapper we want to nuke.
e->removeFront();
NukeCrossCompartmentWrapper(cx, wobj);
NukeRemovedCrossCompartmentWrapper(cx, wobj);
}
}

View File

@ -31,7 +31,7 @@ garbage();
setGCCallback({
action: "majorGC",
depth: 10,
depth: 8,
phases: "begin"
});

View File

@ -2719,6 +2719,9 @@ AccumulateTelemetryCallback(int id, uint32_t sample, const char* key)
case JS_TELEMETRY_GC_SLOW_PHASE:
Telemetry::Accumulate(Telemetry::GC_SLOW_PHASE, sample);
break;
case JS_TELEMETRY_GC_SLOW_TASK:
Telemetry::Accumulate(Telemetry::GC_SLOW_TASK, sample);
break;
case JS_TELEMETRY_GC_MMU_50:
Telemetry::Accumulate(Telemetry::GC_MMU_50, sample);
break;

View File

@ -920,8 +920,8 @@ nsJARChannel::OnDownloadComplete(MemoryDownloader* aDownloader,
uint32_t loadFlags;
channel->GetLoadFlags(&loadFlags);
if (loadFlags & LOAD_REPLACE) {
// Update our URI to reflect any redirects that happen during
// the HTTP request.
mLoadFlags |= LOAD_REPLACE;
if (!mOriginalURI) {
SetOriginalURI(mJarURI);
}
@ -943,9 +943,6 @@ nsJARChannel::OnDownloadComplete(MemoryDownloader* aDownloader,
}
if (NS_SUCCEEDED(status) && channel) {
// In case the load info object has changed during a redirect,
// grab it from the target channel.
channel->GetLoadInfo(getter_AddRefs(mLoadInfo));
// Grab the security info from our base channel
channel->GetSecurityInfo(getter_AddRefs(mSecurityInfo));

View File

@ -269,7 +269,6 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
, mTriggeringPrincipal(rhs.mTriggeringPrincipal)
, mPrincipalToInherit(rhs.mPrincipalToInherit)
, mSandboxedLoadingPrincipal(rhs.mSandboxedLoadingPrincipal)
, mResultPrincipalURI(rhs.mResultPrincipalURI)
, mLoadingContext(rhs.mLoadingContext)
, mSecurityFlags(rhs.mSecurityFlags)
, mInternalContentPolicyType(rhs.mInternalContentPolicyType)
@ -301,7 +300,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
nsIPrincipal* aSandboxedLoadingPrincipal,
nsIURI* aResultPrincipalURI,
nsSecurityFlags aSecurityFlags,
nsContentPolicyType aContentPolicyType,
LoadTainting aTainting,
@ -327,7 +325,6 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
: mLoadingPrincipal(aLoadingPrincipal)
, mTriggeringPrincipal(aTriggeringPrincipal)
, mPrincipalToInherit(aPrincipalToInherit)
, mResultPrincipalURI(aResultPrincipalURI)
, mSecurityFlags(aSecurityFlags)
, mInternalContentPolicyType(aContentPolicyType)
, mTainting(aTainting)
@ -939,19 +936,5 @@ LoadInfo::GetIsTopLevelLoad(bool *aResult)
return NS_OK;
}
NS_IMETHODIMP
LoadInfo::GetResultPrincipalURI(nsIURI **aURI)
{
NS_IF_ADDREF(*aURI = mResultPrincipalURI);
return NS_OK;
}
NS_IMETHODIMP
LoadInfo::SetResultPrincipalURI(nsIURI *aURI)
{
mResultPrincipalURI = aURI;
return NS_OK;
}
} // namespace net
} // namespace mozilla

View File

@ -84,7 +84,6 @@ private:
nsIPrincipal* aTriggeringPrincipal,
nsIPrincipal* aPrincipalToInherit,
nsIPrincipal* aSandboxedLoadingPrincipal,
nsIURI* aResultPrincipalURI,
nsSecurityFlags aSecurityFlags,
nsContentPolicyType aContentPolicyType,
LoadTainting aTainting,
@ -129,7 +128,6 @@ private:
nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
nsCOMPtr<nsIPrincipal> mPrincipalToInherit;
nsCOMPtr<nsIPrincipal> mSandboxedLoadingPrincipal;
nsCOMPtr<nsIURI> mResultPrincipalURI;
nsWeakPtr mLoadingContext;
nsSecurityFlags mSecurityFlags;
nsContentPolicyType mInternalContentPolicyType;

View File

@ -10,7 +10,6 @@
interface nsIDOMDocument;
interface nsINode;
interface nsIPrincipal;
interface nsIURI;
%{C++
#include "nsTArray.h"
@ -741,14 +740,6 @@ interface nsILoadInfo : nsISupports
*/
[infallible] readonly attribute boolean isTopLevelLoad;
/**
* If this is non-null, this property represents two things: (1) the
* URI to be used for the principal if the channel with this loadinfo
* gets a principal based on URI and (2) the URI to use for a document
* created from the channel with this loadinfo.
*/
attribute nsIURI resultPrincipalURI;
/**
* Returns the null principal of the resulting resource if the SEC_SANDBOXED
* flag is set. Otherwise returns null. This is used by

View File

@ -188,17 +188,11 @@ NS_NewChannelInternal(nsIChannel **outChannel,
NS_ENSURE_SUCCESS(rv, rv);
}
#ifdef DEBUG
nsLoadFlags channelLoadFlags = 0;
channel->GetLoadFlags(&channelLoadFlags);
// Will be removed when we remove LOAD_REPLACE altogether
// This check is trying to catch protocol handlers that still
// try to set the LOAD_REPLACE flag.
MOZ_DIAGNOSTIC_ASSERT(!(channelLoadFlags & nsIChannel::LOAD_REPLACE));
#endif
if (aLoadFlags != nsIRequest::LOAD_NORMAL) {
rv = channel->SetLoadFlags(aLoadFlags);
// Retain the LOAD_REPLACE load flag if set.
nsLoadFlags normalLoadFlags = 0;
channel->GetLoadFlags(&normalLoadFlags);
rv = channel->SetLoadFlags(aLoadFlags | (normalLoadFlags & nsIChannel::LOAD_REPLACE));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -273,17 +267,11 @@ NS_NewChannelInternal(nsIChannel **outChannel,
NS_ENSURE_SUCCESS(rv, rv);
}
#ifdef DEBUG
nsLoadFlags channelLoadFlags = 0;
channel->GetLoadFlags(&channelLoadFlags);
// Will be removed when we remove LOAD_REPLACE altogether
// This check is trying to catch protocol handlers that still
// try to set the LOAD_REPLACE flag.
MOZ_DIAGNOSTIC_ASSERT(!(channelLoadFlags & nsIChannel::LOAD_REPLACE));
#endif
if (aLoadFlags != nsIRequest::LOAD_NORMAL) {
rv = channel->SetLoadFlags(aLoadFlags);
// Retain the LOAD_REPLACE load flag if set.
nsLoadFlags normalLoadFlags = 0;
channel->GetLoadFlags(&normalLoadFlags);
rv = channel->SetLoadFlags(aLoadFlags | (normalLoadFlags & nsIChannel::LOAD_REPLACE));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1897,15 +1885,12 @@ nsresult
NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri)
{
*uri = nullptr;
nsLoadFlags loadFlags = 0;
nsresult rv = channel->GetLoadFlags(&loadFlags);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsILoadInfo> loadInfo = channel->GetLoadInfo();
if (loadInfo) {
nsCOMPtr<nsIURI> resultPrincipalURI;
loadInfo->GetResultPrincipalURI(getter_AddRefs(resultPrincipalURI));
if (resultPrincipalURI) {
resultPrincipalURI.forget(uri);
return NS_OK;
}
if (loadFlags & nsIChannel::LOAD_REPLACE) {
return channel->GetURI(uri);
}
return channel->GetOriginalURI(uri);

View File

@ -781,10 +781,11 @@ nsresult NS_URIChainHasFlags(nsIURI *uri,
already_AddRefed<nsIURI> NS_GetInnermostURI(nsIURI *aURI);
/**
* Get the "final" URI for a channel. This is either channel's load info
* resultPrincipalURI, if set, or GetOriginalURI. In most cases (but not all) load
* info resultPrincipalURI, if set, corresponds to URI of the channel if it's required
* to represent the actual principal for the channel.
* Get the "final" URI for a channel. This is either the same as GetURI or
* GetOriginalURI, depending on whether this channel has
* nsIChanel::LOAD_REPLACE set. For channels without that flag set, the final
* URI is the original URI, while for ones with the flag the final URI is the
* channel URI.
*/
nsresult NS_GetFinalChannelURI(nsIChannel *channel, nsIURI **uri);

View File

@ -34,7 +34,6 @@ struct LoadInfoArgs
PrincipalInfo triggeringPrincipalInfo;
OptionalPrincipalInfo principalToInheritInfo;
OptionalPrincipalInfo sandboxedLoadingPrincipalInfo;
OptionalURIParams resultPrincipalURI;
uint32_t securityFlags;
uint32_t contentPolicyType;
uint32_t tainting;

View File

@ -251,20 +251,7 @@ nsFileUploadContentStream::OnCopyComplete()
//-----------------------------------------------------------------------------
nsFileChannel::nsFileChannel(nsIURI *uri)
: mFileURI(uri)
{
}
nsresult
nsFileChannel::Init()
{
NS_ENSURE_STATE(mLoadInfo);
nsresult rv;
rv = nsBaseChannel::Init();
NS_ENSURE_SUCCESS(rv, rv);
// If we have a link file, we should resolve its target right away.
// This is to protect against a same origin attack where the same link file
// can point to different resources right after the first resource is loaded.
@ -277,24 +264,24 @@ nsFileChannel::Init()
#endif
nsCOMPtr<nsIFile> resolvedFile;
bool symLink;
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mFileURI);
if (fileURL &&
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(uri);
if (fileURL &&
NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
NS_SUCCEEDED(file->IsSymlink(&symLink)) &&
NS_SUCCEEDED(file->IsSymlink(&symLink)) &&
symLink &&
#ifdef XP_WIN
NS_SUCCEEDED(file->GetTarget(fileTarget)) &&
NS_SUCCEEDED(NS_NewLocalFile(fileTarget, true,
NS_SUCCEEDED(NS_NewLocalFile(fileTarget, PR_TRUE,
getter_AddRefs(resolvedFile))) &&
#else
NS_SUCCEEDED(file->GetNativeTarget(fileTarget)) &&
NS_SUCCEEDED(NS_NewNativeLocalFile(fileTarget, true,
NS_SUCCEEDED(NS_NewNativeLocalFile(fileTarget, PR_TRUE,
getter_AddRefs(resolvedFile))) &&
#endif
NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(targetURI),
resolvedFile, nullptr))) {
NS_SUCCEEDED(NS_NewFileURI(getter_AddRefs(targetURI),
resolvedFile, nullptr))) {
// Make an effort to match up the query strings.
nsCOMPtr<nsIURL> origURL = do_QueryInterface(mFileURI);
nsCOMPtr<nsIURL> origURL = do_QueryInterface(uri);
nsCOMPtr<nsIURL> targetURL = do_QueryInterface(targetURI);
nsAutoCString queryString;
if (origURL && targetURL && NS_SUCCEEDED(origURL->GetQuery(queryString))) {
@ -302,13 +289,13 @@ nsFileChannel::Init()
}
SetURI(targetURI);
SetOriginalURI(mFileURI);
mLoadInfo->SetResultPrincipalURI(targetURI);
SetOriginalURI(uri);
nsLoadFlags loadFlags = 0;
GetLoadFlags(&loadFlags);
SetLoadFlags(loadFlags | nsIChannel::LOAD_REPLACE);
} else {
SetURI(mFileURI);
SetURI(uri);
}
return NS_OK;
}
nsFileChannel::~nsFileChannel()

View File

@ -22,8 +22,6 @@ public:
explicit nsFileChannel(nsIURI *uri);
nsresult Init();
protected:
~nsFileChannel();
@ -42,7 +40,6 @@ protected:
private:
nsCOMPtr<nsIInputStream> mUploadStream;
int64_t mUploadLength;
nsCOMPtr<nsIURI> mFileURI;
};
#endif // !nsFileChannel_h__

View File

@ -190,8 +190,6 @@ nsFileProtocolHandler::NewChannel2(nsIURI* uri,
nsILoadInfo* aLoadInfo,
nsIChannel** result)
{
nsresult rv;
nsFileChannel *chan;
if (IsNeckoChild()) {
chan = new mozilla::net::FileChannelChild(uri);
@ -202,16 +200,14 @@ nsFileProtocolHandler::NewChannel2(nsIURI* uri,
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(chan);
// set the loadInfo on the new channel ; must do this
// before calling Init() on it, since it needs the load
// info be already set.
rv = chan->SetLoadInfo(aLoadInfo);
nsresult rv = chan->Init();
if (NS_FAILED(rv)) {
NS_RELEASE(chan);
return rv;
}
rv = chan->Init();
// set the loadInfo on the new channel
rv = chan->SetLoadInfo(aLoadInfo);
if (NS_FAILED(rv)) {
NS_RELEASE(chan);
return rv;

View File

@ -2972,72 +2972,6 @@ void HttpBaseChannel::AssertPrivateBrowsingId()
}
#endif
already_AddRefed<nsILoadInfo>
HttpBaseChannel::CloneLoadInfoForRedirect(nsIURI * newURI, uint32_t redirectFlags)
{
// make a copy of the loadinfo, append to the redirectchain
// this will be set on the newly created channel for the redirect target.
if (!mLoadInfo) {
return nullptr;
}
nsCOMPtr<nsILoadInfo> newLoadInfo =
static_cast<mozilla::LoadInfo*>(mLoadInfo.get())->Clone();
nsContentPolicyType contentPolicyType = mLoadInfo->GetExternalContentPolicyType();
if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) {
nsCOMPtr<nsIPrincipal> nullPrincipalToInherit = NullPrincipal::Create();
newLoadInfo->SetPrincipalToInherit(nullPrincipalToInherit);
}
// re-compute the origin attributes of the loadInfo if it's top-level load.
bool isTopLevelDoc =
newLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT;
if (isTopLevelDoc) {
nsCOMPtr<nsILoadContext> loadContext;
NS_QueryNotificationCallbacks(this, loadContext);
OriginAttributes docShellAttrs;
if (loadContext) {
loadContext->GetOriginAttributes(docShellAttrs);
}
OriginAttributes attrs = newLoadInfo->GetOriginAttributes();
MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId,
"docshell and necko should have the same userContextId attribute.");
MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser,
"docshell and necko should have the same inIsolatedMozBrowser attribute.");
MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
"docshell and necko should have the same privateBrowsingId attribute.");
attrs = docShellAttrs;
attrs.SetFirstPartyDomain(true, newURI);
newLoadInfo->SetOriginAttributes(attrs);
}
// This makes the original URI (the redirect URL) of the target channel become
// the resulting principal URI.
// After the veto and security checking of this redirect is done, the original
// URI of the target channel will be rewriten with the first URI in the redirect
// chain (the source URI of this load). Hance the original URI itself can't be
// used for determining the result principal URI.
// If the target schema protocol handler wants to express a different URI as
// the result principal URI, it's free to rewrite this property.
// By not modifying the result principal URI the target protocol handler
// expresses that it's OK to use the channel's pre-redirect-veto original URI
// (the redirect URL) as the result principal URI.
newLoadInfo->SetResultPrincipalURI(newURI);
bool isInternalRedirect =
(redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL |
nsIChannelEventSink::REDIRECT_STS_UPGRADE));
newLoadInfo->AppendRedirectedPrincipal(GetURIPrincipal(), isInternalRedirect);
return newLoadInfo.forget();
}
//-----------------------------------------------------------------------------
// nsHttpChannel::nsITraceableChannel
//-----------------------------------------------------------------------------
@ -3219,6 +3153,57 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
}
}
// make a copy of the loadinfo, append to the redirectchain
// and set it on the new channel
if (mLoadInfo) {
nsCOMPtr<nsILoadInfo> newLoadInfo =
static_cast<mozilla::LoadInfo*>(mLoadInfo.get())->Clone();
nsContentPolicyType contentPolicyType = mLoadInfo->GetExternalContentPolicyType();
if (contentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
contentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) {
nsCOMPtr<nsIPrincipal> nullPrincipalToInherit = NullPrincipal::Create();
newLoadInfo->SetPrincipalToInherit(nullPrincipalToInherit);
}
// re-compute the origin attributes of the loadInfo if it's top-level load.
bool isTopLevelDoc =
newLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT;
if (isTopLevelDoc) {
nsCOMPtr<nsILoadContext> loadContext;
NS_QueryNotificationCallbacks(this, loadContext);
OriginAttributes docShellAttrs;
if (loadContext) {
loadContext->GetOriginAttributes(docShellAttrs);
}
OriginAttributes attrs = newLoadInfo->GetOriginAttributes();
MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId,
"docshell and necko should have the same userContextId attribute.");
MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser,
"docshell and necko should have the same inIsolatedMozBrowser attribute.");
MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
"docshell and necko should have the same privateBrowsingId attribute.");
attrs = docShellAttrs;
attrs.SetFirstPartyDomain(true, newURI);
newLoadInfo->SetOriginAttributes(attrs);
}
bool isInternalRedirect =
(redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL |
nsIChannelEventSink::REDIRECT_STS_UPGRADE));
newLoadInfo->AppendRedirectedPrincipal(GetURIPrincipal(), isInternalRedirect);
newChannel->SetLoadInfo(newLoadInfo);
}
else {
// the newChannel was created with a dummy loadInfo, we should clear
// it in case the original channel does not have a loadInfo
newChannel->SetLoadInfo(nullptr);
}
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(newChannel);
if (!httpChannel)
return NS_OK; // no other options to set

View File

@ -424,8 +424,6 @@ protected:
void AssertPrivateBrowsingId();
#endif
already_AddRefed<nsILoadInfo> CloneLoadInfoForRedirect(nsIURI *newURI, uint32_t redirectFlags);
friend class PrivateBrowsingChannel<HttpBaseChannel>;
friend class InterceptFailedOnStop;

View File

@ -1493,10 +1493,9 @@ HttpChannelChild::SetupRedirect(nsIURI* uri,
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIChannel> newChannel;
nsCOMPtr<nsILoadInfo> redirectLoadInfo = CloneLoadInfoForRedirect(uri, redirectFlags);
rv = NS_NewChannelInternal(getter_AddRefs(newChannel),
uri,
redirectLoadInfo,
mLoadInfo,
nullptr, // aLoadGroup
nullptr, // aCallbacks
nsIRequest::LOAD_NORMAL,

View File

@ -2755,8 +2755,6 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags)
LOG(("nsHttpChannel::StartRedirectChannelToURI()\n"));
nsCOMPtr<nsIChannel> newChannel;
nsCOMPtr<nsILoadInfo> redirectLoadInfo = CloneLoadInfoForRedirect(upgradedURI,
flags);
nsCOMPtr<nsIIOService> ioService;
rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
@ -2764,7 +2762,7 @@ nsHttpChannel::StartRedirectChannelToURI(nsIURI *upgradedURI, uint32_t flags)
rv = NS_NewChannelInternal(getter_AddRefs(newChannel),
upgradedURI,
redirectLoadInfo,
mLoadInfo,
nullptr, // aLoadGroup
nullptr, // aCallbacks
nsIRequest::LOAD_NORMAL,
@ -5622,23 +5620,22 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv)
rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
if (NS_FAILED(rv)) return rv;
uint32_t redirectFlags;
if (nsHttp::IsPermanentRedirect(mRedirectType))
redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT;
else
redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY;
nsCOMPtr<nsIChannel> newChannel;
nsCOMPtr<nsILoadInfo> redirectLoadInfo = CloneLoadInfoForRedirect(mRedirectURI, redirectFlags);
rv = NS_NewChannelInternal(getter_AddRefs(newChannel),
mRedirectURI,
redirectLoadInfo,
mLoadInfo,
nullptr, // aLoadGroup
nullptr, // aCallbacks
nsIRequest::LOAD_NORMAL,
ioService);
NS_ENSURE_SUCCESS(rv, rv);
uint32_t redirectFlags;
if (nsHttp::IsPermanentRedirect(mRedirectType))
redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT;
else
redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY;
rv = SetupReplacementChannel(mRedirectURI, newChannel,
!rewriteToGET, redirectFlags);
if (NS_FAILED(rv)) return rv;

View File

@ -33,10 +33,6 @@ protected:
const nsACString& aPathname,
nsACString& aResult) override;
// |result| is an inout param. On entry to this function, *result
// is expected to be non-null and already addrefed. This function
// may release the object stored in *result on entry and write
// a new pointer to an already addrefed channel to *result.
virtual MOZ_MUST_USE nsresult SubstituteChannel(nsIURI* uri,
nsILoadInfo* aLoadInfo,
nsIChannel** result) override;

View File

@ -246,8 +246,6 @@ SubstitutingProtocolHandler::NewChannel2(nsIURI* uri,
nsIChannel** result)
{
NS_ENSURE_ARG_POINTER(uri);
NS_ENSURE_ARG_POINTER(aLoadInfo);
nsAutoCString spec;
nsresult rv = ResolveURI(uri, spec);
NS_ENSURE_SUCCESS(rv, rv);
@ -256,18 +254,12 @@ SubstitutingProtocolHandler::NewChannel2(nsIURI* uri,
rv = NS_NewURI(getter_AddRefs(newURI), spec);
NS_ENSURE_SUCCESS(rv, rv);
// We don't want to allow the inner protocol handler to modify the result
// principal URI since we want either |uri| or anything pre-set by upper
// layers to prevail.
nsCOMPtr<nsIURI> savedResultPrincipalURI;
rv = aLoadInfo->GetResultPrincipalURI(getter_AddRefs(savedResultPrincipalURI));
NS_ENSURE_SUCCESS(rv, rv);
rv = NS_NewChannelInternal(result, newURI, aLoadInfo);
NS_ENSURE_SUCCESS(rv, rv);
rv = aLoadInfo->SetResultPrincipalURI(savedResultPrincipalURI);
NS_ENSURE_SUCCESS(rv, rv);
nsLoadFlags loadFlags = 0;
(*result)->GetLoadFlags(&loadFlags);
(*result)->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE);
rv = (*result)->SetOriginalURI(uri);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -877,10 +877,6 @@ nsMultiMixedConv::SendStart()
mPartChannel->SetContentDisposition(mContentDisposition);
// Each part of a multipart/replace response can be used
// for the top level document. We must inform upper layers
// about this by setting the LOAD_REPLACE flag so that certain
// state assertions are evaluated as positive.
nsLoadFlags loadFlags = 0;
mPartChannel->GetLoadFlags(&loadFlags);
loadFlags |= nsIChannel::LOAD_REPLACE;

View File

@ -232,6 +232,9 @@ function test_load_replace() {
file = do_get_file("data/system_root.lnk", false);
var chan = new_file_channel(file);
// The LOAD_REPLACE flag should be set
do_check_eq(chan.loadFlags & chan.LOAD_REPLACE, chan.LOAD_REPLACE);
// The original URI path should differ from the URI path
do_check_neq(chan.URI.path, chan.originalURI.path);

View File

@ -20,7 +20,6 @@ from manifestparser import TestManifest
from reftest import ReftestManifest
from mozbuild.util import ensureParentDir
from mozpack.archive import create_tar_gz_from_files
from mozpack.copier import FileRegistry
from mozpack.files import ExistingFile, FileFinder
from mozpack.manifests import InstallManifest
@ -615,31 +614,22 @@ def main(argv):
args = parser.parse_args(argv)
out_file = args.outputfile
if not out_file.endswith(('.tar.gz', '.zip')):
raise Exception('expected tar.gz or zip output file')
if not args.outputfile.endswith('.zip'):
raise Exception('expected zip output file')
file_count = 0
t_start = time.time()
ensureParentDir(out_file)
res = find_files(args.archive)
with open(out_file, 'wb') as fh:
ensureParentDir(args.outputfile)
with open(args.outputfile, 'wb') as fh:
# Experimentation revealed that level 5 is significantly faster and has
# marginally larger sizes than higher values and is the sweet spot
# for optimal compression. Read the detailed commit message that
# introduced this for raw numbers.
if out_file.endswith('.tar.gz'):
files = dict(res)
create_tar_gz_from_files(fh, files, compresslevel=5)
file_count = len(files)
elif out_file.endswith('.zip'):
with JarWriter(fileobj=fh, optimize=False, compress_level=5) as writer:
for p, f in res:
writer.add(p.encode('utf-8'), f.read(), mode=f.mode,
skip_duplicates=True)
file_count += 1
else:
raise Exception('unhandled file extension: %s' % out_file)
with JarWriter(fileobj=fh, optimize=False, compress_level=5) as writer:
res = find_files(args.archive)
for p, f in res:
writer.add(p.encode('utf-8'), f.read(), mode=f.mode, skip_duplicates=True)
file_count += 1
duration = time.time() - t_start
zip_size = os.path.getsize(args.outputfile)

View File

@ -6,13 +6,9 @@ from __future__ import absolute_import
import bz2
import gzip
import io
import stat
import tarfile
from .files import (
BaseFile,
)
# 2016-01-01T00:00:00+0000
DEFAULT_MTIME = 1451606400
@ -22,26 +18,22 @@ def create_tar_from_files(fp, files):
"""Create a tar file deterministically.
Receives a dict mapping names of files in the archive to local filesystem
paths or ``mozpack.files.BaseFile`` instances.
paths.
The files will be archived and written to the passed file handle opened
for writing.
Only regular files can be written.
FUTURE accept mozpack.files classes for writing
FUTURE accept a filename argument (or create APIs to write files)
"""
with tarfile.open(name='', mode='w', fileobj=fp, dereference=True) as tf:
for archive_path, f in sorted(files.items()):
if isinstance(f, BaseFile):
ti = tarfile.TarInfo(archive_path)
ti.mode = f.mode or 0644
ti.type = tarfile.REGTYPE
else:
ti = tf.gettarinfo(f, archive_path)
for archive_path, fs_path in sorted(files.items()):
ti = tf.gettarinfo(fs_path, archive_path)
if not ti.isreg():
raise ValueError('not a regular file: %s' % f)
raise ValueError('not a regular file: %s' % fs_path)
# Disallow setuid and setgid bits. This is an arbitrary restriction.
# However, since we set uid/gid to root:root, setuid and setgid
@ -49,7 +41,7 @@ def create_tar_from_files(fp, files):
# uncompressed as root.
if ti.mode & (stat.S_ISUID | stat.S_ISGID):
raise ValueError('cannot add file with setuid or setgid set: '
'%s' % f)
'%s' % fs_path)
# Set uid, gid, username, and group as deterministic values.
ti.uid = 0
@ -60,14 +52,8 @@ def create_tar_from_files(fp, files):
# Set mtime to a constant value.
ti.mtime = DEFAULT_MTIME
if isinstance(f, BaseFile):
ti.size = f.size()
# tarfile wants to pass a size argument to read(). So just
# wrap/buffer in a proper file object interface.
tf.addfile(ti, f.open())
else:
with open(f, 'rb') as fh:
tf.addfile(ti, fh)
with open(fs_path, 'rb') as fh:
tf.addfile(ti, fh)
def create_tar_gz_from_files(fp, files, filename=None, compresslevel=9):

View File

@ -219,14 +219,6 @@ class BaseFile(object):
def read(self):
raise NotImplementedError('BaseFile.read() not implemented. Bug 1170329.')
def size(self):
"""Returns size of the entry.
Derived classes are highly encouraged to override this with a more
optimal implementation.
"""
return len(self.read())
@property
def mode(self):
'''
@ -258,9 +250,6 @@ class File(BaseFile):
with open(self.path, 'rb') as fh:
return fh.read()
def size(self):
return os.stat(self.path).st_size
class ExecutableFile(File):
'''
@ -508,12 +497,6 @@ class GeneratedFile(BaseFile):
def open(self):
return BytesIO(self.content)
def read(self):
return self.content
def size(self):
return len(self.content)
class DeflatedFile(BaseFile):
'''

View File

@ -18,9 +18,6 @@ from mozpack.archive import (
create_tar_gz_from_files,
create_tar_bz2_from_files,
)
from mozpack.files import (
GeneratedFile,
)
from mozunit import main
@ -44,22 +41,19 @@ class TestArchive(unittest.TestCase):
def _create_files(self, root):
files = {}
for i in range(10):
p = os.path.join(root, b'file%02d' % i)
p = os.path.join(root, b'file%d' % i)
with open(p, 'wb') as fh:
fh.write(b'file%02d' % i)
fh.write(b'file%d' % i)
# Need to set permissions or umask may influence testing.
os.chmod(p, MODE_STANDARD)
files[b'file%02d' % i] = p
for i in range(10):
files[b'file%02d' % (i + 10)] = GeneratedFile('file%02d' % (i + 10))
files[b'file%d' % i] = p
return files
def _verify_basic_tarfile(self, tf):
self.assertEqual(len(tf.getmembers()), 20)
self.assertEqual(len(tf.getmembers()), 10)
names = ['file%02d' % i for i in range(20)]
names = ['file%d' % i for i in range(10)]
self.assertEqual(tf.getnames(), names)
for ti in tf.getmembers():
@ -112,7 +106,7 @@ class TestArchive(unittest.TestCase):
create_tar_from_files(fh, files)
# Output should be deterministic.
self.assertEqual(file_hash(tp), '01cd314e277f060e98c7de6c8ea57f96b3a2065c')
self.assertEqual(file_hash(tp), 'cd16cee6f13391abd94dfa435d2633b61ed727f1')
with tarfile.open(tp, 'r') as tf:
self._verify_basic_tarfile(tf)
@ -150,7 +144,7 @@ class TestArchive(unittest.TestCase):
with open(gp, 'wb') as fh:
create_tar_gz_from_files(fh, files)
self.assertEqual(file_hash(gp), '7c4da5adc5088cdf00911d5daf9a67b15de714b7')
self.assertEqual(file_hash(gp), 'acb602239c1aeb625da5e69336775609516d60f5')
with tarfile.open(gp, 'r:gz') as tf:
self._verify_basic_tarfile(tf)
@ -167,7 +161,7 @@ class TestArchive(unittest.TestCase):
with open(gp, 'wb') as fh:
create_tar_gz_from_files(fh, files, filename='foobar', compresslevel=1)
self.assertEqual(file_hash(gp), '1cc8b96f0262350977c2e9d61f40a1fa76f35c52')
self.assertEqual(file_hash(gp), 'fd099f96480cc1100f37baa8e89a6b820dbbcbd3')
with tarfile.open(gp, 'r:gz') as tf:
self._verify_basic_tarfile(tf)
@ -184,7 +178,7 @@ class TestArchive(unittest.TestCase):
with open(bp, 'wb') as fh:
create_tar_bz2_from_files(fh, files)
self.assertEqual(file_hash(bp), 'eb5096d2fbb71df7b3d690001a6f2e82a5aad6a7')
self.assertEqual(file_hash(bp), '1827ad00dfe7acf857b7a1c95ce100361e3f6eea')
with tarfile.open(bp, 'r:bz2') as tf:
self._verify_basic_tarfile(tf)

View File

@ -1083,6 +1083,7 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
{ "script.google.com", true, false, false, -1, &kPinset_google_root_pems },
{ "se.search.yahoo.com", false, true, false, -1, &kPinset_yahoo },
{ "search.yahoo.com", false, true, false, -1, &kPinset_yahoo },
{ "secretintelligence.0.me.uk", true, false, false, -1, &kPinset_ncsccs },
{ "secure.facebook.com", true, false, false, -1, &kPinset_facebook },
{ "security.google.com", true, false, false, -1, &kPinset_google_root_pems },
{ "services.mozilla.com", true, false, true, 6, &kPinset_mozilla_services },
@ -1156,8 +1157,8 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
{ "zh.search.yahoo.com", false, true, false, -1, &kPinset_yahoo },
};
// Pinning Preload List Length = 479;
// Pinning Preload List Length = 480;
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1504105493448000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1504192576127000);

View File

@ -1,5 +1,6 @@
007sascha.de: did not receive HSTS header
020wifi.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
0f.io: did not receive HSTS header
0g.org.uk: could not connect to host
0o0.ooo: could not connect to host
0p.no: did not receive HSTS header
@ -45,7 +46,7 @@
2or3.tk: could not connect to host
2smart4food.com: could not connect to host
2ss.jp: did not receive HSTS header
300651.ru: did not receive HSTS header
300651.ru: could not connect to host
300m.com: did not receive HSTS header
300mbmovies4u.cc: did not receive HSTS header
301.website: could not connect to host
@ -58,7 +59,6 @@
368mibn.com: could not connect to host
38sihu.com: could not connect to host
39sihu.com: could not connect to host
3ags.de: did not receive HSTS header
3chit.cf: could not connect to host
3click-loan.com: could not connect to host
3delivered.com: could not connect to host
@ -69,10 +69,10 @@
404404.info: could not connect to host
420dongstorm.com: could not connect to host
42ms.org: could not connect to host
439191.com: could not connect to host
441jj.com: did not receive HSTS header
4455software.com: did not receive HSTS header
4679.space: could not connect to host
47ronin.com: did not receive HSTS header
4azino777.ru: did not receive HSTS header
4cclothing.com: could not connect to host
4elements.com: did not receive HSTS header
@ -83,6 +83,7 @@
50millionablaze.org: could not connect to host
540.co: did not receive HSTS header
56ct.com: could not connect to host
57aromas.com: could not connect to host
60ych.net: did not receive HSTS header
6120.eu: did not receive HSTS header
69square.com: could not connect to host
@ -119,8 +120,8 @@ aboutmyip.info: did not receive HSTS header
aboutyou-deals.de: did not receive HSTS header
abt.de: did not receive HSTS header
abtom.de: did not receive HSTS header
abury.fr: did not receive HSTS header
abury.me: did not receive HSTS header
abury.fr: could not connect to host
abury.me: could not connect to host
academicenterprise.org: could not connect to host
accelerole.com: did not receive HSTS header
accelight.co.jp: did not receive HSTS header
@ -249,7 +250,6 @@ am3.se: could not connect to host
amaforums.org: could not connect to host
amandaonishi.com: could not connect to host
amavis.org: did not receive HSTS header
amazingfloridagulfhomes.com: could not connect to host
ameho.me: did not receive HSTS header
american-truck-simulator.de: could not connect to host
american-truck-simulator.net: could not connect to host
@ -300,6 +300,7 @@ ankaraprofesyonelnakliyat.com: did not receive HSTS header
ankaraprofesyonelnakliyat.com.tr: did not receive HSTS header
annabellaw.com: did not receive HSTS header
anomaly.ws: did not receive HSTS header
anongoth.pl: could not connect to host
anonymo.co.uk: could not connect to host
anonymo.uk: could not connect to host
anonymousstatecollegelulzsec.com: could not connect to host
@ -334,6 +335,7 @@ app-arena.com: did not receive HSTS header
app.lookout.com: did not receive HSTS header
app.manilla.com: could not connect to host
appart.ninja: could not connect to host
appdb.cc: did not receive HSTS header
appengine.google.com: did not receive HSTS header (error ignored - included regardless)
apple-watch-zubehoer.de: could not connect to host
applez.xyz: could not connect to host
@ -350,6 +352,7 @@ arabdigitalexpression.org: did not receive HSTS header
aradulconteaza.ro: could not connect to host
aran.me.uk: could not connect to host
arboineuropa.nl: did not receive HSTS header
arboleda-hurtado.com: could not connect to host
arbu.eu: max-age too low: 2419200
arcbit.io: could not connect to host
arguggi.co.uk: could not connect to host
@ -440,7 +443,6 @@ auxiliumincrementum.co.uk: could not connect to host
av.de: did not receive HSTS header
avantmfg.com: did not receive HSTS header
avec-ou-sans-ordonnance.fr: could not connect to host
avenelequinehospital.com.au: max-age too low: 0
avepol.cz: did not receive HSTS header
avepol.eu: did not receive HSTS header
aviacao.pt: did not receive HSTS header
@ -539,8 +541,8 @@ beier.io: did not receive HSTS header
belairsewvac.com: could not connect to host
belics.com: did not receive HSTS header
belltower.io: could not connect to host
belly-button-piercings.com: could not connect to host
bemyvictim.com: max-age too low: 2678400
benchcast.com: could not connect to host
beneffy.com: did not receive HSTS header
benjakesjohnson.com: could not connect to host
benk.press: could not connect to host
@ -560,6 +562,7 @@ bestbeards.ca: could not connect to host
bestcellular.com: did not receive HSTS header
besthost.cz: did not receive HSTS header
bestlashesandbrows.com: did not receive HSTS header
betakah.net: could not connect to host
betcafearena.ro: could not connect to host
bethditto.com: did not receive HSTS header
betnet.fr: could not connect to host
@ -581,6 +584,7 @@ bgmn.net: could not connect to host
bhatia.at: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
bi.search.yahoo.com: did not receive HSTS header
biblerhymes.com: did not receive HSTS header
bichines.es: did not receive HSTS header
bidon.ca: did not receive HSTS header
bieberium.de: could not connect to host
bienenblog.cc: could not connect to host
@ -655,7 +659,6 @@ blueliv.com: did not receive HSTS header
bluescloud.xyz: could not connect to host
bluetenmeer.com: did not receive HSTS header
bluketing.com: could not connect to host
blupig.net: max-age too low: 86400
bluserv.net: did not receive HSTS header
bm-trading.nl: did not receive HSTS header
bnhlibrary.com: did not receive HSTS header
@ -694,7 +697,6 @@ boxcryptor.com: did not receive HSTS header
boxintense.com: did not receive HSTS header
bqtoolbox.com: could not connect to host
br3in.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
bragasoft.com.br: could not connect to host
brage.info: did not receive HSTS header
braineet.com: did not receive HSTS header
brainfork.ml: could not connect to host
@ -737,8 +739,8 @@ buildci.asia: could not connect to host
buildify.co.za: could not connect to host
buildsaver.co.za: did not receive HSTS header
built.by: did not receive HSTS header
bul3seas.eu: could not connect to host
bulkbuy.tech: could not connect to host
bullbits.com: could not connect to host
bulletpoint.cz: could not connect to host
bullterrier.me: could not connect to host
bulmafox.com: could not connect to host
@ -829,6 +831,7 @@ capturethepen.co.uk: could not connect to host
car-navi.ph: did not receive HSTS header
carano-service.de: did not receive HSTS header
caraudio69.cz: could not connect to host
carboneselectricosnettosl.info: max-age too low: 0
cardoni.net: did not receive HSTS header
cardstream.com: did not receive HSTS header
cardurl.com: did not receive HSTS header
@ -843,6 +846,7 @@ carwashvapeur.be: did not receive HSTS header
casc.cz: did not receive HSTS header
casedi.org: max-age too low: 0
casefall.com: could not connect to host
cash-pos.com: could not connect to host
cashlink.io: did not receive HSTS header
cashmojo.com: could not connect to host
cashmyphone.ch: could not connect to host
@ -853,12 +857,11 @@ casovi.cf: could not connect to host
catarsisvr.com: could not connect to host
catinmay.com: did not receive HSTS header
catnapstudios.com: could not connect to host
catnet.dk: could not connect to host
cavac.at: could not connect to host
cavaleria.ro: did not receive HSTS header
caveclan.org: did not receive HSTS header
cavedroid.xyz: could not connect to host
cbhq.net: could not connect to host
cbtistexcalac.mx: max-age too low: 0
ccblog.de: did not receive HSTS header
ccsys.com: could not connect to host
cctech.ph: did not receive HSTS header
@ -886,7 +889,6 @@ cfetengineering.com: could not connect to host
cfoitplaybook.com: could not connect to host
cg.search.yahoo.com: did not receive HSTS header
cganx.org: could not connect to host
chahub.com: could not connect to host
chainmonitor.com: could not connect to host
championsofregnum.com: did not receive HSTS header
champserver.net: did not receive HSTS header
@ -901,7 +903,6 @@ charmyadesara.com: did not receive HSTS header
charnleyhouse.co.uk: max-age too low: 604800
chartpen.com: could not connect to host
chartstoffarm.de: did not receive HSTS header
chat-porc.eu: could not connect to host
chatbot.me: did not receive HSTS header
chateauconstellation.ch: did not receive HSTS header
chatme.im: did not receive HSTS header
@ -959,7 +960,6 @@ cityoflaurel.org: did not receive HSTS header
ciuciucadou.ro: could not connect to host
cium.ru: could not connect to host
cjcaron.org: could not connect to host
claimconnect.us: could not connect to host
clara-baumert.de: could not connect to host
claralabs.com: did not receive HSTS header
classicsandexotics.com: did not receive HSTS header
@ -1029,7 +1029,6 @@ code.google.com: did not receive HSTS header (error ignored - included regardles
codealkemy.co: could not connect to host
codeco.pw: could not connect to host
codecontrollers.de: could not connect to host
codeferm.com: could not connect to host
codeforce.io: could not connect to host
codelayer.ca: could not connect to host
codelitmus.com: did not receive HSTS header
@ -1104,6 +1103,7 @@ correctpaardbatterijnietje.nl: did not receive HSTS header
corruption-mc.net: could not connect to host
corruption-rsps.net: could not connect to host
corruption-server.net: could not connect to host
corsa-b.uk: could not connect to host
count.sh: could not connect to host
courageousparentsnetwork.org: did not receive HSTS header
couragewhispers.ca: did not receive HSTS header
@ -1197,11 +1197,9 @@ cyberspect.io: could not connect to host
cyberxpert.nl: could not connect to host
cycleluxembourg.lu: did not receive HSTS header
cydia-search.io: could not connect to host
cyhour.com: could not connect to host
cynoshair.com: could not connect to host
cyphertite.com: could not connect to host
cytadel.fr: did not receive HSTS header
d4rkdeagle.tk: could not connect to host
dad256.tk: could not connect to host
dadtheimpaler.com: could not connect to host
dah5.com: did not receive HSTS header
@ -1238,6 +1236,7 @@ darkpony.ru: could not connect to host
darksideof.it: could not connect to host
darkstance.org: could not connect to host
darrenellis.xyz: could not connect to host
darwinkel.net: could not connect to host
dashburst.com: did not receive HSTS header
dashnimorad.com: did not receive HSTS header
data-abundance.com: could not connect to host
@ -1300,6 +1299,7 @@ denh.am: did not receive HSTS header
denisjean.fr: could not connect to host
dentaldomain.org: did not receive HSTS header
dentaldomain.ph: could not connect to host
denverprophit.us: could not connect to host
depeche-mode.moscow: max-age too low: 7200
depijl-mz.nl: did not receive HSTS header
depixion.agency: could not connect to host
@ -1338,6 +1338,7 @@ diarbag.us: max-age too low: 0
dicando.com: max-age too low: 2592000
dicionariofinanceiro.com: did not receive HSTS header
diedrich.co: could not connect to host
dierenartsdeconinck.be: could not connect to host
dierenkruiden.nl: could not connect to host
diezel.com: could not connect to host
digioccumss.ddns.net: could not connect to host
@ -1418,6 +1419,7 @@ doridian.com: could not connect to host
doridian.de: could not connect to host
doridian.net: did not receive HSTS header
doridian.org: could not connect to host
dostavkakurierom.ru: could not connect to host
dot42.no: could not connect to host
dotacni-parazit.cz: could not connect to host
dotadata.me: could not connect to host
@ -1459,6 +1461,7 @@ dubrovskiy.pro: could not connect to host
duesee.org: could not connect to host
dullsir.com: did not receive HSTS header
dungi.org: could not connect to host
dutchessuganda.com: did not receive HSTS header
dutchrank.com: did not receive HSTS header
duuu.ch: could not connect to host
dworzak.ch: could not connect to host
@ -1512,9 +1515,10 @@ edissecurity.sk: did not receive HSTS header
edix.ru: could not connect to host
edk.com.tr: did not receive HSTS header
edmodo.com: did not receive HSTS header
eduif.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
eduardnikolenko.ru: could not connect to host
eduvance.in: did not receive HSTS header
eeqj.com: could not connect to host
eez.ee: could not connect to host
effectiveosgi.com: could not connect to host
efficienthealth.com: did not receive HSTS header
effortlesshr.com: did not receive HSTS header
@ -1542,6 +1546,7 @@ elenoon.ir: did not receive HSTS header
elgacien.de: could not connect to host
elimdengelen.com: did not receive HSTS header
eliott.be: could not connect to host
elite-porno.ru: did not receive HSTS header
elitefishtank.com: could not connect to host
elnutricionista.es: did not receive HSTS header
eloanpersonal.com: max-age too low: 0
@ -1641,7 +1646,7 @@ etdonline.co.uk: could not connect to host
eternitylove.us: could not connect to host
eth9.net: could not connect to host
ethicalexploiting.com: could not connect to host
ethil-faer.fr: could not connect to host
ethil-faer.fr: did not receive HSTS header
etmirror.top: could not connect to host
etmirror.xyz: could not connect to host
etproxy.tech: could not connect to host
@ -1684,6 +1689,7 @@ expoundite.net: did not receive HSTS header
expressfinance.co.za: did not receive HSTS header
extrathemeshowcase.net: could not connect to host
extratorrentlive.xyz: could not connect to host
extratorrents.tech: could not connect to host
extreemhost.nl: did not receive HSTS header
extrememanual.net: max-age too low: 3888000
extremenetworking.net: could not connect to host
@ -1754,7 +1760,6 @@ festrip.com: could not connect to host
fexmen.com: could not connect to host
ffmradio.de: did not receive HSTS header
fics-twosigma.com: could not connect to host
fierman.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
fiftyshadesofluca.ml: could not connect to host
fig.co: did not receive HSTS header
fightr.co: could not connect to host
@ -1790,7 +1795,6 @@ five.vn: did not receive HSTS header
fivestarsitters.com: did not receive HSTS header
fivezerocreative.com: did not receive HSTS header
fixatom.com: did not receive HSTS header
fixel.express: could not connect to host
fixingdns.com: did not receive HSTS header
fixtectools.co.za: could not connect to host
fj.search.yahoo.com: did not receive HSTS header
@ -1876,7 +1880,6 @@ freshfind.xyz: could not connect to host
frforms.com: did not receive HSTS header
friendica.ch: could not connect to host
friendlyfiregameshow.com: could not connect to host
friendlysiberia.com: could not connect to host
froggstack.de: could not connect to host
frontisme.nl: could not connect to host
frontmin.com: did not receive HSTS header
@ -1908,7 +1911,6 @@ futureyouhealth.com: did not receive HSTS header
fuvpn.com: could not connect to host
fws.gov: did not receive HSTS header
fx-rk.com: did not receive HSTS header
fyrkat.no: max-age too low: 0
fysiohaenraets.nl: did not receive HSTS header
fzn.io: could not connect to host
fzslm.me: could not connect to host
@ -1959,12 +1961,14 @@ gatapro.net: could not connect to host
gatorsa.es: did not receive HSTS header
gdegem.org: did not receive HSTS header
gdpventure.com: max-age too low: 0
gdz-spishy.com: did not receive HSTS header
gedankenbude.info: could not connect to host
geekcast.co.uk: did not receive HSTS header
geeky.software: could not connect to host
geemo.top: could not connect to host
geeq.ch: could not connect to host
geli-graphics.com: did not receive HSTS header
gensonline.eu: could not connect to host
genuu.com: could not connect to host
genuxation.com: could not connect to host
genyaa.com: could not connect to host
@ -2033,6 +2037,7 @@ glentakahashi.com: max-age too low: 0
glitzmirror.com: could not connect to host
global-adult-webcams.com: did not receive HSTS header
globalado.com: could not connect to host
globalbridge-japan.com: did not receive HSTS header
globalexpert.co.nz: could not connect to host
globalittech.com: could not connect to host
globalmusic.ga: could not connect to host
@ -2041,7 +2046,6 @@ gm-assicurazioni.it: could not connect to host
gm.search.yahoo.com: did not receive HSTS header
gmail.com: did not receive HSTS header (error ignored - included regardless)
gmoes.at: max-age too low: 600000
gnetion.com: could not connect to host
go.ax: did not receive HSTS header
go2sh.de: did not receive HSTS header
goabonga.com: could not connect to host
@ -2214,6 +2218,7 @@ happyfabric.me: did not receive HSTS header
happygastro.com: could not connect to host
harabuhouse.com: did not receive HSTS header
harbor-light.net: could not connect to host
harbourweb.net: could not connect to host
hardline.xyz: could not connect to host
hardyboyplant.com: did not receive HSTS header
haribosupermix.com: could not connect to host
@ -2231,6 +2236,7 @@ hasinase.de: did not receive HSTS header
haste.ch: could not connect to host
hastherebeenamassshooting.today: could not connect to host
hatoko.net: could not connect to host
haucke.xyz: could not connect to host
haufschild.de: could not connect to host
haurumcraft.net: could not connect to host
hausarzt-stader-str.de: did not receive HSTS header
@ -2319,7 +2325,6 @@ horseboners.xxx: did not receive HSTS header
hortifarm.ro: did not receive HSTS header
horvathtom.com: could not connect to host
hosteasy.nl: did not receive HSTS header
hosted-service.com: max-age too low: 0
hostedtalkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
hostelite.com: did not receive HSTS header
hostgarou.com: did not receive HSTS header
@ -2328,6 +2333,7 @@ hostisan.com: did not receive HSTS header
hotchillibox.co.za: could not connect to host
hotchillibox.com: max-age too low: 0
hotchoc.io: did not receive HSTS header
hotelvue.nl: could not connect to host
houkago-step.com: did not receive HSTS header
housemaadiah.org: did not receive HSTS header
housingstudents.org.uk: could not connect to host
@ -2344,7 +2350,6 @@ httpstatuscode418.xyz: could not connect to host
hu.search.yahoo.com: did not receive HSTS header
huangh.com: could not connect to host
huarongdao.com: did not receive HSTS header
huchet.me: could not connect to host
hugocollignon.fr: could not connect to host
hugosleep.com.au: did not receive HSTS header
humankode.com: did not receive HSTS header
@ -2367,6 +2372,7 @@ hyper69.com: did not receive HSTS header
i-jp.net: could not connect to host
i-partners.sk: did not receive HSTS header
i10z.com: could not connect to host
iainsimms.me: could not connect to host
iamjoshellis.com: could not connect to host
iamokay.nl: did not receive HSTS header
iamreubin.co.uk: did not receive HSTS header
@ -2399,7 +2405,7 @@ identitylabs.uk: could not connect to host
idgsupply.com: could not connect to host
idinby.dk: did not receive HSTS header
idlekernel.com: could not connect to host
idontexist.me: could not connect to host
idontexist.me: did not receive HSTS header
ie.search.yahoo.com: did not receive HSTS header
ierna.com: did not receive HSTS header
ies-italia.it: did not receive HSTS header
@ -2467,7 +2473,7 @@ inflation.ml: could not connect to host
info-screen.me: did not receive HSTS header
info-sys.tk: could not connect to host
infogrfx.com: did not receive HSTS header
inforichjapan.com: max-age too low: 0
inforichjapan.com: did not receive HSTS header
infosec.rip: could not connect to host
infosoph.org: did not receive HSTS header
infotics.es: did not receive HSTS header
@ -2533,6 +2539,8 @@ iptel.by: max-age too low: 0
iptel.ro: could not connect to host
ipuservicedesign.com: could not connect to host
ipv6cloud.club: could not connect to host
ipv6only.network: could not connect to host
ipvsec.nl: could not connect to host
iqcn.co: could not connect to host
iqualtech.com: did not receive HSTS header
iranianlawschool.com: could not connect to host
@ -2559,7 +2567,6 @@ istanbultravelguide.info: could not connect to host
istaspirtslietas.lv: did not receive HSTS header
it-go.net: did not receive HSTS header
itechgeek.com: max-age too low: 0
iteli.eu: could not connect to host
ithakama.com: did not receive HSTS header
ithakama.cz: did not receive HSTS header
itos.asia: did not receive HSTS header
@ -2619,7 +2626,7 @@ jaqen.ch: could not connect to host
jaroslavtrsek.cz: did not receive HSTS header
jarsater.com: did not receive HSTS header
jasl.works: did not receive HSTS header
jasmineconseil.com: could not connect to host
jasmineconseil.com: did not receive HSTS header
jasonroe.me: did not receive HSTS header
jasonsansone.com: max-age too low: 0
jastoria.pl: could not connect to host
@ -2692,9 +2699,6 @@ jonn.me: could not connect to host
joostbovee.nl: did not receive HSTS header
jordanhamilton.me: could not connect to host
joretapo.fr: did not receive HSTS header
jornane.me: max-age too low: 0
jornane.nl: max-age too low: 0
jornane.no: max-age too low: 0
jorrit.info: could not connect to host
josahrens.me: could not connect to host
josericaurte.com: could not connect to host
@ -2845,7 +2849,6 @@ kokenmetaanbiedingen.nl: did not receive HSTS header
kolaykaydet.com: did not receive HSTS header
kolozsvaricsuhe.hu: did not receive HSTS header
komikito.com: could not connect to host
kommune42.org: did not receive HSTS header
kompetenzwerft.de: did not receive HSTS header
konsertoversikt.no: could not connect to host
kontaxis.network: could not connect to host
@ -2914,10 +2917,10 @@ laborie.io: could not connect to host
labrador-retrievers.com.au: did not receive HSTS header
labs.directory: could not connect to host
labs.moscow: did not receive HSTS header
lacaverne.nl: could not connect to host
lachlankidson.net: did not receive HSTS header
lacledeslan.ninja: could not connect to host
lacocinadelila.com: did not receive HSTS header
ladbroke.net: did not receive HSTS header
laf.in.net: could not connect to host
lagalerievirtuelle.fr: did not receive HSTS header
lagoza.name: could not connect to host
@ -2961,6 +2964,7 @@ leermotorrijden.nl: max-age too low: 300
lefebvristes.com: could not connect to host
lefebvristes.fr: could not connect to host
legarage.org: did not receive HSTS header
legendofkrystal.com: could not connect to host
leinir.dk: did not receive HSTS header
leitner.com.au: did not receive HSTS header
leiyun.me: did not receive HSTS header
@ -3005,7 +3009,6 @@ lianye3.cc: could not connect to host
lianye4.cc: could not connect to host
lianye5.cc: could not connect to host
lianye6.cc: could not connect to host
lianyexiuchang.in: could not connect to host
liaoshuma.com: could not connect to host
libanco.com: could not connect to host
libertyrp.org: could not connect to host
@ -3034,7 +3037,6 @@ limalama.eu: max-age too low: 1
limeyeti.com: could not connect to host
limiteddata.co.uk: could not connect to host
limpido.it: could not connect to host
lincolncollege.edu: max-age too low: 0
lincolnwayflorist.com: could not connect to host
lindberg.io: did not receive HSTS header
lingros-test.tk: could not connect to host
@ -3059,7 +3061,6 @@ little.pw: did not receive HSTS header
livedemo.io: could not connect to host
livej.am: could not connect to host
livi.co: did not receive HSTS header
living-space.co.nz: could not connect to host
lixiang.one: could not connect to host
lkummer.cz: could not connect to host
lmerza.com: could not connect to host
@ -3116,6 +3117,7 @@ lsp-sports.de: did not receive HSTS header
lt.search.yahoo.com: did not receive HSTS header
ltbytes.com: could not connect to host
lu.search.yahoo.com: did not receive HSTS header
lucas-garte.com: did not receive HSTS header
lucaterzini.com: could not connect to host
ludwiggrill.de: did not receive HSTS header
lufthansaexperts.com: max-age too low: 2592000
@ -3226,7 +3228,6 @@ marktissink.nl: did not receive HSTS header
markus-dev.com: did not receive HSTS header
markusweimar.de: did not receive HSTS header
marleyresort.com: did not receive HSTS header
marquiseclub.se: could not connect to host
marriottvetcareers.com: could not connect to host
marshut.net: could not connect to host
martiert.com: could not connect to host
@ -3274,7 +3275,6 @@ mcjackk77.com: could not connect to host
mclab.su: could not connect to host
mdfnet.se: did not receive HSTS header
mdscomp.net: did not receive HSTS header
mea.in.ua: could not connect to host
meamod.com: did not receive HSTS header
mecenat-cassous.com: did not receive HSTS header
mechmk1.me: did not receive HSTS header
@ -3327,7 +3327,7 @@ metis.pw: could not connect to host
meuemail.pro: could not connect to host
mexbt.com: could not connect to host
mexicanbusinessweb.mx: did not receive HSTS header
mexicansbook.ru: could not connect to host
mexicansbook.ru: did not receive HSTS header
mfcatalin.com: could not connect to host
mh-bloemen.co.jp: could not connect to host
mhdsyarif.com: did not receive HSTS header
@ -3363,7 +3363,7 @@ mijn-email.org: could not connect to host
mikaelemilsson.net: did not receive HSTS header
mikeburns.com: could not connect to host
mikeg.de: did not receive HSTS header
mikek.work: did not receive HSTS header
mikek.work: could not connect to host
mikeology.org: could not connect to host
mikeybot.com: could not connect to host
mikonmaa.fi: could not connect to host
@ -3397,14 +3397,13 @@ misterl.net: did not receive HSTS header
mit-uns.org: could not connect to host
mittenhacks.com: could not connect to host
mivcon.net: could not connect to host
miyoshi-kikaku.co.jp: did not receive HSTS header
miyoshi-kikaku.com: did not receive HSTS header
mizd.at: could not connect to host
mizi.name: could not connect to host
mjacobson.net: could not connect to host
mkasu.org: did not receive HSTS header
mkw.st: could not connect to host
mlcdn.co: could not connect to host
mlcnfriends.com: could not connect to host
mlp.ee: could not connect to host
mlpepilepsy.org: could not connect to host
mmgazhomeloans.com: did not receive HSTS header
@ -3441,7 +3440,6 @@ mols.me: could not connect to host
momoka.moe: could not connect to host
mona.lu: did not receive HSTS header
monarca.systems: could not connect to host
monarcasystems.com: max-age too low: 0
monasterialis.eu: could not connect to host
mondar.io: did not receive HSTS header
mondopoint.com: did not receive HSTS header
@ -3629,6 +3627,7 @@ netloanusa.com: could not connect to host
netmagik.com: did not receive HSTS header
netresourcedesign.com: did not receive HSTS header
nettefoundation.com: could not connect to host
nettx.co.uk: did not receive HSTS header
networx-online.de: could not connect to host
netzbit.de: could not connect to host
netzpolitik.org: did not receive HSTS header
@ -3677,7 +3676,6 @@ nien.chat: could not connect to host
nightwinds.tk: could not connect to host
niho.jp: did not receive HSTS header
nikcub.com: did not receive HSTS header
niklas.pw: could not connect to host
niklaslindblad.se: did not receive HSTS header
nikomo.fi: did not receive HSTS header
ninchisho-online.com: did not receive HSTS header
@ -3717,6 +3715,7 @@ nothing.net.nz: max-age too low: 7776000
notify.moe: could not connect to host
nottheonion.net: did not receive HSTS header
nouvelle-vague-saint-cast.fr: did not receive HSTS header
novaco.in: max-age too low: 3600
novacoast.com: did not receive HSTS header
novatrucking.de: could not connect to host
nowak.ninja: did not receive HSTS header
@ -3796,7 +3795,6 @@ oldoakflorist.com: could not connect to host
oliverdunk.com: did not receive HSTS header
ollehbizev.co.kr: could not connect to host
olswangtrainees.com: could not connect to host
olygazoo.com: could not connect to host
omacostudio.com: could not connect to host
omgaanmetidealen.com: could not connect to host
ominto.com: max-age too low: 0
@ -3857,7 +3855,6 @@ opensourcehouse.net: could not connect to host
opensrd.com: could not connect to host
openxmpp.com: could not connect to host
opim.ca: did not receive HSTS header
opinello.com: max-age too low: 0
opoleo.com: could not connect to host
opperwall.net: did not receive HSTS header
opsafewinter.net: could not connect to host
@ -3880,7 +3877,6 @@ orionrebellion.com: could not connect to host
orleika.ml: could not connect to host
orthodoxy.lt: did not receive HSTS header
osaiyuwu.com: could not connect to host
osao.org: could not connect to host
oscsdp.cz: could not connect to host
oslfoundation.org: could not connect to host
osp.cx: could not connect to host
@ -3940,6 +3936,7 @@ panoranordic.net: could not connect to host
pansu.space: could not connect to host
pants-off.xyz: could not connect to host
pantsu.cat: did not receive HSTS header
panzer72.ru: did not receive HSTS header
papalytics.com: could not connect to host
papeda.net: could not connect to host
papercard.co.uk: did not receive HSTS header
@ -3976,6 +3973,7 @@ pataua.kiwi: did not receive HSTS header
paternitydnatest.com: could not connect to host
patientinsight.net: could not connect to host
patt.us: did not receive HSTS header
patterson.mp: could not connect to host
paul-kerebel.pro: could not connect to host
paulchen.at: could not connect to host
paulproell.at: could not connect to host
@ -3989,6 +3987,7 @@ payments.google.com: did not receive HSTS header (error ignored - included regar
payroll.ch: could not connect to host
pbapp.net: did not receive HSTS header
pbprint.ru: max-age too low: 0
pbxapi.com: could not connect to host
pc-nf.de: did not receive HSTS header
pcfun.net: could not connect to host
pchax.net: could not connect to host
@ -4015,7 +4014,7 @@ performous.org: could not connect to host
perfumista.vn: did not receive HSTS header
perlwork.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
perplex.nl: did not receive HSTS header
perroud.pro: did not receive HSTS header
perroud.pro: could not connect to host
personaldatabasen.no: could not connect to host
personalinjurylist.com: did not receive HSTS header
personalizedtouch.co: could not connect to host
@ -4035,7 +4034,6 @@ pettsy.com: could not connect to host
pewboards.com: could not connect to host
pexieapp.com: did not receive HSTS header
peytonfarrar.com: did not receive HSTS header
pflege.de: max-age too low: 0
pgpm.io: could not connect to host
phalconist.com: did not receive HSTS header
pharmgkb.org: could not connect to host
@ -4103,6 +4101,7 @@ plirt.ru: did not receive HSTS header
plixer.com: did not receive HSTS header
plogable.co: could not connect to host
plombirator.kz: did not receive HSTS header
plothost.com: did not receive HSTS header
ploup.net: could not connect to host
pluff.nl: did not receive HSTS header
plur.com.au: did not receive HSTS header
@ -4136,6 +4135,7 @@ pornstars.me: did not receive HSTS header
portalplatform.net: could not connect to host
poshpak.com: max-age too low: 86400
postcodewise.co.uk: did not receive HSTS header
posterspy.com: did not receive HSTS header
postscheduler.org: could not connect to host
posylka.de: did not receive HSTS header
potatoheads.net: could not connect to host
@ -4167,6 +4167,7 @@ preworkout.me: did not receive HSTS header
prezola.com: did not receive HSTS header
prgslab.net: could not connect to host
pridoc.se: did not receive HSTS header
princesparktouch.com: did not receive HSTS header
printerest.io: could not connect to host
printexpress.cloud: did not receive HSTS header
printfn.com: could not connect to host
@ -4215,6 +4216,7 @@ psw.academy: did not receive HSTS header
psw.consulting: did not receive HSTS header
ptn.moscow: could not connect to host
pubkey.is: could not connect to host
pubreviews.com: could not connect to host
pugliese.fr: could not connect to host
puiterwijk.org: could not connect to host
pumpgames.net: could not connect to host
@ -4232,12 +4234,11 @@ pyol.org: could not connect to host
pypi-status.org: could not connect to host
pyplo.org: did not receive HSTS header
pypt.lt: did not receive HSTS header
pythia.nz: could not connect to host
q2.si: did not receive HSTS header
qbik.de: did not receive HSTS header
qccqld.org.au: could not connect to host
qiliang.wang: could not connect to host
qingpat.com: could not connect to host
qingpei.me: could not connect to host
qingxuan.info: max-age too low: 864000
qinxi1992.com: could not connect to host
qionglu.pw: could not connect to host
@ -4353,7 +4354,6 @@ reggae-cdmx.com: did not receive HSTS header
rehabthailand.nl: could not connect to host
rei.ki: could not connect to host
reic.me: could not connect to host
reinaertvandecruys.me: could not connect to host
reinaldudras.ee: did not receive HSTS header
reisyukaku.org: did not receive HSTS header
reithguard-it.de: did not receive HSTS header
@ -4397,7 +4397,6 @@ reverie.pw: could not connect to host
reviews.anime.my: max-age too low: 5184000
revtut.net: did not receive HSTS header
rewardstock.com: max-age too low: 0
rewrite3.com: could not connect to host
rex.st: could not connect to host
rhapsodhy.hu: could not connect to host
rhdigital.pro: could not connect to host
@ -4452,7 +4451,6 @@ rolroer.co.za: could not connect to host
romab.com: did not receive HSTS header
romans-place.me.uk: could not connect to host
romulusapp.com: could not connect to host
rondoniatec.com.br: could not connect to host
ronvandordt.info: could not connect to host
ronwo.de: max-age too low: 1
rootforum.org: did not receive HSTS header
@ -4468,7 +4466,7 @@ rout0r.org: did not receive HSTS header
rouvray.org: could not connect to host
royal-forest.org: max-age too low: 0
royalhop.co: could not connect to host
royalpub.net: did not receive HSTS header
royalpub.net: could not connect to host
rpy.xyz: could not connect to host
rr.in.th: could not connect to host
rrke.cc: did not receive HSTS header
@ -4574,6 +4572,7 @@ schulterglatzen-altenwalde.de: could not connect to host
schultzflorists.com: could not connect to host
schwarzkopfforyou.de: did not receive HSTS header
schweizerbolzonello.net: could not connect to host
scicasts.com: max-age too low: 7776000
scienceathome.org: did not receive HSTS header
scivillage.com: did not receive HSTS header
scooshonline.co.uk: did not receive HSTS header
@ -4604,6 +4603,7 @@ sebastian-lutsch.de: could not connect to host
sebster.com: did not receive HSTS header
secandtech.com: could not connect to host
seccom.ch: did not receive HSTS header
seccomp.ru: could not connect to host
secondary-survivor.com: could not connect to host
secondary-survivor.help: could not connect to host
secondary-survivor.net: could not connect to host
@ -4653,7 +4653,7 @@ sensiblemn.org: could not connect to host
sensibus.com: did not receive HSTS header
seo.consulting: did not receive HSTS header
seomobo.com: could not connect to host
seon.me: could not connect to host
seosanantonioinc.com: did not receive HSTS header
seowarp.net: did not receive HSTS header
seq.tf: did not receive HSTS header
serathius.ovh: could not connect to host
@ -4666,6 +4666,7 @@ servergno.me: did not receive HSTS header
servermonkey.nl: could not connect to host
seryo.moe: could not connect to host
seryo.net: could not connect to host
seryox.com: could not connect to host
setphaserstostun.org: could not connect to host
setuid.de: could not connect to host
setuid.io: did not receive HSTS header
@ -4677,7 +4678,8 @@ shadowmorph.info: did not receive HSTS header
shadowsocks.net: could not connect to host
shanekoster.net: did not receive HSTS header
shanesage.com: could not connect to host
shang-yu.cn: could not connect to host
shang-yu.cn: did not receive HSTS header
shapesedinburgh.co.uk: did not receive HSTS header
shareimg.xyz: could not connect to host
sharepass.pw: could not connect to host
shauncrowley.co.uk: could not connect to host
@ -4756,8 +4758,6 @@ siterip.org: could not connect to host
sites.google.com: did not receive HSTS header (error ignored - included regardless)
sitesten.com: did not receive HSTS header
sixtwentyten.com: did not receive HSTS header
skarrok.com: could not connect to host
skhosting.eu: max-age too low: 0
ski-insurance.com.au: did not receive HSTS header
skidstresser.com: did not receive HSTS header
skile.ru: could not connect to host
@ -4768,6 +4768,7 @@ skullhouse.nyc: did not receive HSTS header
skyasker.cn: could not connect to host
skyflix.me: could not connect to host
skyoy.com: did not receive HSTS header
skyrunners.ch: could not connect to host
slash-dev.de: could not connect to host
slashand.co: did not receive HSTS header
slashdesign.it: did not receive HSTS header
@ -4790,7 +4791,6 @@ smart-mirror.de: did not receive HSTS header
smart-ov.nl: could not connect to host
smartcoin.com.br: could not connect to host
smarthomedna.com: did not receive HSTS header
smartlend.se: could not connect to host
smartofficesandsmarthomes.com: did not receive HSTS header
smartrak.co.nz: did not receive HSTS header
smatch.com: did not receive HSTS header
@ -4918,11 +4918,11 @@ staffjoystaging.com: did not receive HSTS header
stahl.xyz: could not connect to host
stalkerhispano.com: max-age too low: 0
stalschermer.nl: could not connect to host
stamonicatourandtravel.com: could not connect to host
standardssuck.org: did not receive HSTS header
standingmist.com: did not receive HSTS header
stargatepartners.com: did not receive HSTS header
starmusic.ga: did not receive HSTS header
starsam80.net: could not connect to host
starttraffic.com: did not receive HSTS header
startuponcloud.com: max-age too low: 2678400
startuppeople.co.uk: could not connect to host
@ -5010,6 +5010,7 @@ suksit.com: could not connect to host
sumoatm.com: did not receive HSTS header
sumoscout.de: did not receive HSTS header
suncountrymarine.com: did not receive HSTS header
sunflyer.cn: did not receive HSTS header
sunnyfruit.ru: did not receive HSTS header
sunshinepress.org: could not connect to host
sunyanzi.tk: could not connect to host
@ -5058,6 +5059,7 @@ syncclinicalstudy.com: could not connect to host
syncer.jp: did not receive HSTS header
syneic.com: did not receive HSTS header
syno.gq: could not connect to host
synony.me: could not connect to host
syntheticmotoroil.org: did not receive HSTS header
syriatalk.biz: could not connect to host
syriatalk.org: could not connect to host
@ -5156,6 +5158,7 @@ temehu.com: did not receive HSTS header
tempcraft.net: could not connect to host
tempus-aquilae.de: could not connect to host
tendertool.nl: could not connect to host
tengroup.com: did not receive HSTS header
tenni.xyz: could not connect to host
tensei-slime.com: did not receive HSTS header
tensionup.com: could not connect to host
@ -5180,6 +5183,7 @@ tfl.lu: did not receive HSTS header
tgr.re: could not connect to host
thagki9.com: could not connect to host
thai.land: could not connect to host
thaihostcool.com: could not connect to host
thailandpropertylistings.com: did not receive HSTS header
the-construct.com: could not connect to host
the-delta.net.eu.org: could not connect to host
@ -5197,7 +5201,6 @@ thecoffeehouse.xyz: could not connect to host
thecrochetcottage.net: could not connect to host
theendofzion.com: did not receive HSTS header
theescapistswiki.com: could not connect to host
theeyeopener.com: did not receive HSTS header
thefarbeyond.com: could not connect to host
theflowerbasketonline.com: could not connect to host
thefootballanalyst.com: did not receive HSTS header
@ -5249,6 +5252,7 @@ thiswebhost.com: did not receive HSTS header
thomaskliszowski.fr: did not receive HSTS header
thomasschweizer.net: could not connect to host
thorncreek.net: did not receive HSTS header
threefours.net: did not receive HSTS header
thriveapproach.co.uk: did not receive HSTS header
thumbtack.com: did not receive HSTS header
thusoy.com: did not receive HSTS header
@ -5318,7 +5322,6 @@ tokoone.com: did not receive HSTS header
tollmanz.com: did not receive HSTS header
tolud.com: could not connect to host
tomeara.net: could not connect to host
tomend.es: could not connect to host
tomharris.tech: did not receive HSTS header
tomlankhorst.nl: did not receive HSTS header
tomli.me: could not connect to host
@ -5333,7 +5336,6 @@ topnewstoday.org: could not connect to host
topshelfguild.com: could not connect to host
torahanytime.com: did not receive HSTS header
torlock.download: could not connect to host
torprojects.com: could not connect to host
torrentdownloads.bid: could not connect to host
torrentz.website: could not connect to host
torsten-schmitz.net: could not connect to host
@ -5366,6 +5368,7 @@ transportal.sk: did not receive HSTS header
travality.ru: did not receive HSTS header
travel-kuban.ru: did not receive HSTS header
travelinsurance.co.nz: did not receive HSTS header
travisforte.io: could not connect to host
treasuredinheritanceministry.com: did not receive HSTS header
treatprostatewithhifu.com: could not connect to host
treeby.net: could not connect to host
@ -5426,7 +5429,6 @@ txclimbers.com: could not connect to host
txf.pw: could not connect to host
ty2u.com: did not receive HSTS header
tylian.net: max-age too low: 0
typeonejoe.com: could not connect to host
tyrelius.com: did not receive HSTS header
tyroproducts.eu: did not receive HSTS header
tzappa.net: could not connect to host
@ -5437,6 +5439,7 @@ uber.com.au: did not receive HSTS header
uberfunction.com: did not receive HSTS header
ubi.gg: could not connect to host
ubicloud.de: could not connect to host
ubicv.com: could not connect to host
ublox.com: did not receive HSTS header
ubuntuhot.com: did not receive HSTS header
uega.net: did not receive HSTS header
@ -5484,6 +5487,7 @@ under30stravelinsurance.com.au: did not receive HSTS header
unfiltered.nyc: did not receive HSTS header
uni-games.com: could not connect to host
unicooo.com: did not receive HSTS header
uniform-agri.com: did not receive HSTS header
unikitty-on-tour.com: could not connect to host
unison.com: did not receive HSTS header
unisyssecurity.com: did not receive HSTS header
@ -5508,7 +5512,6 @@ uprotect.it: could not connect to host
upstats.eu: could not connect to host
ur-lauber.de: did not receive HSTS header
urandom.eu.org: did not receive HSTS header
urbanstylestaging.com: did not receive HSTS header
urbpic.com: could not connect to host
urown.net: could not connect to host
urphp.com: could not connect to host
@ -5527,6 +5530,7 @@ utleieplassen.no: could not connect to host
utopiagalaxy.space: could not connect to host
utopianhomespa.com: did not receive HSTS header
utopianrealms.org: did not receive HSTS header
utox.io: could not connect to host
utumno.ch: did not receive HSTS header
utvbloggen.se: max-age too low: 604800
uvarov.pw: did not receive HSTS header
@ -5539,7 +5543,6 @@ v2.pw: did not receive HSTS header
v4veedu.com: could not connect to host
vaddder.com: could not connect to host
vaelma.fi: max-age too low: 600
valasi.eu: could not connect to host
valentin-sundermann.de: could not connect to host
valethound.com: could not connect to host
valis.sx: could not connect to host
@ -5669,6 +5672,7 @@ wapt.fr: could not connect to host
warandpeace.xyz: could not connect to host
warehost.de: did not receive HSTS header
warezaddict.com: did not receive HSTS header
warhaggis.com: could not connect to host
warhistoryonline.com: max-age too low: 0
warped.com: did not receive HSTS header
warsentech.com: could not connect to host
@ -5720,7 +5724,6 @@ weddingenvelopes.co.uk: did not receive HSTS header
weddingibiza.nl: could not connect to host
weekly.fyi: could not connect to host
wegenaer.nl: could not connect to host
weizenke.im: could not connect to host
wekibe.de: could not connect to host
wellastore.ru: did not receive HSTS header
weltmeisterschaft.net: could not connect to host
@ -5729,9 +5732,10 @@ weme.eu: could not connect to host
wendalyncheng.com: did not receive HSTS header
werdeeintimo.de: did not receive HSTS header
werkenbijkfc.nl: did not receive HSTS header
werkplaatsoost.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
werkruimtebottendaal.nl: did not receive HSTS header
wesleyharris.ca: did not receive HSTS header
westendzone.com: could not connect to host
westendzone.com: max-age too low: 0
westerhoud.nl: did not receive HSTS header
wettbuero.de: did not receive HSTS header
wetten.eu: did not receive HSTS header
@ -5741,19 +5745,18 @@ wetttipps.de: did not receive HSTS header
wevahoo.com: could not connect to host
wevolver.com: could not connect to host
wftda.com: did not receive HSTS header
wg-tools.de: could not connect to host
whatnext.limited: did not receive HSTS header
whats.io: could not connect to host
whatsstalk.me: could not connect to host
whatsyouroffer.co.uk: did not receive HSTS header
when-release.com: did not receive HSTS header
whisker.network: could not connect to host
whiterabbit.org: did not receive HSTS header
whiterabbitcakery.com: could not connect to host
whitestagforge.com: did not receive HSTS header
whoclicks.net: could not connect to host
whoisapi.online: could not connect to host
wholebites.com: did not receive HSTS header
wholesalesolar.com: max-age too low: 0
wholebites.com: could not connect to host
whoneedstobeprimaried.today: could not connect to host
whoshotya.de: did not receive HSTS header
whysuck.com: could not connect to host
@ -5767,7 +5770,6 @@ wilf1rst.com: could not connect to host
willcipriano.com: could not connect to host
william.si: did not receive HSTS header
williamsapiens.com: could not connect to host
williamsonshore.com: could not connect to host
willosagiede.com: did not receive HSTS header
winaes.com: did not receive HSTS header
winclient.cn: could not connect to host
@ -5828,11 +5830,9 @@ wpmetadatastandardsproject.org: did not receive HSTS header
writeapp.me: did not receive HSTS header
wrldevelopment.com: did not receive HSTS header
wsscompany.com.ve: could not connect to host
wstx.com: could not connect to host
wufu.org: did not receive HSTS header
wuhengmin.com: could not connect to host
wukongmusic.us: did not receive HSTS header
wumbo.co.nz: could not connect to host
wurzelzwerg.net: could not connect to host
wusx.club: could not connect to host
www.braintreepayments.com: did not receive HSTS header
@ -5879,7 +5879,6 @@ xenesisziarovky.sk: could not connect to host
xett.com: did not receive HSTS header
xf-liam.com: did not receive HSTS header
xfive.de: did not receive HSTS header
xg3n1us.de: could not connect to host
xiaody.me: could not connect to host
xiaolvmu.com: could not connect to host
xiaolvmu.me: could not connect to host
@ -5901,6 +5900,7 @@ xn--4dbjwf8c.tk: could not connect to host
xn--79q87uvkclvgd56ahq5a.net: did not receive HSTS header
xn--7rvz7ku3ppnr.jp: did not receive HSTS header
xn--80aaihqncaejjobbu6v.xn--p1ai: max-age too low: 10000
xn--80aocgsfei.xn--p1ai: could not connect to host
xn--9pr52k0p5a.com: did not receive HSTS header
xn--d1acj9c.xn--90ais: could not connect to host
xn--datenrettung-mnchen-jbc.com: did not receive HSTS header
@ -5919,6 +5919,7 @@ xn--yoamomisuasbcn-ynb.com: could not connect to host
xobox.me: could not connect to host
xoffy.com: did not receive HSTS header
xom.party: could not connect to host
xor-a.net: could not connect to host
xperiacodes.com: did not receive HSTS header
xpi.fr: could not connect to host
xsmobile.de: could not connect to host
@ -5995,6 +5996,7 @@ z33.ch: could not connect to host
z3liff.com: could not connect to host
z3liff.net: could not connect to host
za.search.yahoo.com: did not receive HSTS header
zachgibbens.org: could not connect to host
zadieheimlich.com: did not receive HSTS header
zahyantechnologies.com: could not connect to host
zakoncontrol.com: could not connect to host
@ -6044,7 +6046,7 @@ zk.gd: did not receive HSTS header
zkillboard.com: did not receive HSTS header
zking.ga: could not connect to host
zmsastro.co.za: could not connect to host
zmy.im: did not receive HSTS header
zmy.im: could not connect to host
zocken.com: did not receive HSTS header
zoe.vc: could not connect to host
zomiac.pp.ua: could not connect to host

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@ _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US = [
"target.awsy.tests.zip",
"target.test_packages.json",
"target.txt",
"target.web-platform.tests.tar.gz",
"target.web-platform.tests.zip",
"target.xpcshell.tests.zip",
"target_info.txt",
"target.jsshell.zip",
@ -64,7 +64,7 @@ _MOBILE_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US = [
"en-US/target.awsy.tests.zip",
"en-US/target.test_packages.json",
"en-US/target.txt",
"en-US/target.web-platform.tests.tar.gz",
"en-US/target.web-platform.tests.zip",
"en-US/target.xpcshell.tests.zip",
"en-US/target_info.txt",
"en-US/bouncer.apk",
@ -84,7 +84,7 @@ _MOBILE_UPSTREAM_ARTIFACTS_UNSIGNED_MULTI = [
"target.awsy.tests.zip",
"target.test_packages.json",
"target.txt",
"target.web-platform.tests.tar.gz",
"target.web-platform.tests.zip",
"target.xpcshell.tests.zip",
"target_info.txt",
"bouncer.apk",

View File

@ -35,7 +35,7 @@ _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US = [
"target.awsy.tests.zip",
"target.test_packages.json",
"target.txt",
"target.web-platform.tests.tar.gz",
"target.web-platform.tests.zip",
"target.xpcshell.tests.zip",
"target_info.txt",
"target.jsshell.zip",

View File

@ -246,7 +246,7 @@ PUSH_APK_BREAKPOINT_WORKER_TYPE = {
}
PUSH_APK_DRY_RUN_OPTION = {
'central': True,
'central': False,
'beta': False,
'release': False,
'default': True,

View File

@ -50,6 +50,7 @@ class MochiRemote(MochitestDesktop):
"chrome")
self._dm.removeDir(self.remoteChromeTestDir)
self._dm.mkDir(self.remoteChromeTestDir)
self._dm.removeDir(self.remoteProfile)
def cleanup(self, options):
if self._dm.fileExists(self.remoteLog):
@ -329,6 +330,7 @@ def run_test_harness(parser, options):
auto.setAppName(options.remoteappname)
logParent = os.path.dirname(options.remoteLogFile)
dm.removeDir(logParent)
dm.mkDir(logParent)
auto.setRemoteLog(options.remoteLogFile)
auto.setServerInfo(options.webServer, options.httpPort, options.sslPort)

View File

@ -147,6 +147,9 @@ class AWSY(TestingMixin, MercurialScript, BlobUploadMixin, TooltoolMixin):
cmd.append('--disable-e10s')
cmd.append('--gecko-log=%s' % os.path.join(dirs["abs_blob_upload_dir"],
'gecko.log'))
# TestingMixin._download_and_extract_symbols() should set
# self.symbols_path
cmd.append('--symbols-path=%s' % self.symbols_path)
test_file = os.path.join(self.awsy_libdir, 'test_memory_usage.py')
cmd.append(test_file)

View File

@ -119,26 +119,23 @@ ifdef COMPILE_ENVIRONMENT
stage-all: stage-cppunittests
endif
TEST_PKGS_ZIP := \
TEST_PKGS := \
common \
cppunittest \
mochitest \
reftest \
talos \
awsy \
xpcshell \
$(NULL)
TEST_PKGS_TARGZ := \
web-platform \
xpcshell \
$(NULL)
ifdef LINK_GTEST_DURING_COMPILE
stage-all: stage-gtest
TEST_PKGS_ZIP += gtest
TEST_PKGS += gtest
endif
PKG_ARG = --$(1) '$(PKG_BASENAME).$(1).tests.$(2)'
PKG_ARG = --$(1) '$(PKG_BASENAME).$(1).tests.zip'
test-packages-manifest:
@rm -f $(MOZ_TEST_PACKAGES_FILE)
@ -146,9 +143,8 @@ test-packages-manifest:
$(PYTHON) $(topsrcdir)/build/gen_test_packages_manifest.py \
--jsshell $(JSSHELL_NAME) \
--dest-file '$(MOZ_TEST_PACKAGES_FILE)' \
$(call PKG_ARG,common,zip) \
$(foreach pkg,$(TEST_PKGS_ZIP),$(call PKG_ARG,$(pkg),zip)) \
$(foreach pkg,$(TEST_PKGS_TARGZ),$(call PKG_ARG,$(pkg),tar.gz))
$(call PKG_ARG,common) \
$(foreach pkg,$(TEST_PKGS),$(call PKG_ARG,$(pkg)))
package-tests-prepare-dest:
@rm -f '$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)'
@ -158,12 +154,11 @@ define package_archive
package-tests-$(1): stage-all package-tests-prepare-dest
$$(call py_action,test_archive, \
$(1) \
'$$(abspath $$(DIST))/$$(PKG_PATH)/$$(PKG_BASENAME).$(1).tests.$(2)')
'$$(abspath $$(DIST))/$$(PKG_PATH)/$$(PKG_BASENAME).$(1).tests.zip')
package-tests: package-tests-$(1)
endef
$(foreach name,$(TEST_PKGS_ZIP),$(eval $(call package_archive,$(name),zip)))
$(foreach name,$(TEST_PKGS_TARGZ),$(eval $(call package_archive,$(name),tar.gz)))
$(foreach name,$(TEST_PKGS),$(eval $(call package_archive,$(name))))
ifeq ($(MOZ_BUILD_APP),mobile/android)
stage-all: stage-android

View File

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict';
"use strict";
/* import-globals-from ../../devtools/server/main.js */
const { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
@ -19,8 +21,7 @@ const { BrowserTabList } = devtools.require("devtools/server/actors/webbrowser")
* Construct a root actor appropriate for use in a server running xpcshell
* tests. <snip boilerplate> :)
*/
function createRootActor(connection)
{
function createRootActor(connection) {
let parameters = {
tabList: new XPCSTTabList(connection),
globalActorFactories: DebuggerServer.globalActorFactories,
@ -37,8 +38,7 @@ function createRootActor(connection)
* A "stub" TabList implementation that provides no tabs.
*/
function XPCSTTabList(connection)
{
function XPCSTTabList(connection) {
BrowserTabList.call(this, connection);
}

View File

@ -0,0 +1,7 @@
"use strict";
module.exports = {
"extends": [
"plugin:mozilla/xpcshell-test"
]
};

View File

@ -4,8 +4,7 @@
var {classes: Cc, interfaces: Ci} = Components;
function check_profile_dir(profd)
{
function check_profile_dir(profd) {
Assert.ok(profd.exists());
Assert.ok(profd.isDirectory());
let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
@ -17,8 +16,7 @@ function check_profile_dir(profd)
Assert.ok(profd.equals(profd2));
}
function check_do_get_profile(fireProfileAfterChange)
{
function check_do_get_profile(fireProfileAfterChange) {
const observedTopics = new Map([
["profile-do-change", 0],
["profile-after-change", 0],
@ -27,7 +25,7 @@ function check_do_get_profile(fireProfileAfterChange)
const obs = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
for (let [topic,] of observedTopics) {
for (let [topic, ] of observedTopics) {
obs.addObserver(() => {
let val = observedTopics.get(topic) + 1;
observedTopics.set(topic, val);

View File

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* globals __URI__ */
// Module used by test_import_module.js
const EXPORTED_SYMBOLS = [ "MODULE_IMPORTED", "MODULE_URI", "SUBMODULE_IMPORTED", "same_scope", "SUBMODULE_IMPORTED_TO_SCOPE" ];
@ -14,8 +16,8 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.importRelative(this, "import_sub_module.jsm");
// Prepare two scopes that we can import the submodule into.
var scope1 = { __URI__: __URI__ };
var scope2 = { __URI__: __URI__ };
var scope1 = { __URI__ };
var scope2 = { __URI__ };
// First one is the regular path.
XPCOMUtils.importRelative(scope1, "import_sub_module.jsm");
scope1.test_obj.i++;

View File

@ -2,4 +2,5 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* globals subscriptLoaded:true */
subscriptLoaded = true;

View File

@ -2,5 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* globals __LOCATION__ */
// Gets loaded via test_location.js
do_check_eq(__LOCATION__.leafName, "location_load.js");

View File

@ -1,10 +1,12 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from ../../head.js */
function run_test() {
let env = Components.classes["@mozilla.org/process/environment;1"]
.getService(Components.interfaces.nsIEnvironment);
do_check_throws_nsIException(function () {
do_check_throws_nsIException(function() {
env.QueryInterface(Components.interfaces.nsIFile);
}, "NS_NOINTERFACE");
}

View File

@ -1,8 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from ../../head.js */
function run_test() {
do_check_throws_nsIException(function () {
do_check_throws_nsIException(function() {
throw Error("I find your relaxed dishabille unpalatable");
}, "NS_NOINTERFACE");
}

View File

@ -2,13 +2,13 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
function run_test() {
do_check_matches({x:1}, {x:1});
do_check_matches({x: 1}, {x: 1});
// Property order is irrelevant.
do_check_matches({x:"foo", y:"bar"}, {y:"bar", x:"foo"});// pass
do_check_matches({x: "foo", y: "bar"}, {y: "bar", x: "foo"});// pass
// Patterns nest.
do_check_matches({a:1, b:{c:2,d:3}}, {a:1, b:{c:2,d:3}});
do_check_matches({a: 1, b: {c: 2, d: 3}}, {a: 1, b: {c: 2, d: 3}});
do_check_matches([3,4,5], [3,4,5]);
do_check_matches([3, 4, 5], [3, 4, 5]);
}

View File

@ -2,11 +2,11 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
function run_test() {
do_check_matches({x:1}, {}); // fail: all pattern props required
do_check_matches({x:1}, {x:2}); // fail: values must match
do_check_matches({x:undefined}, {});
do_check_matches({x: 1}, {}); // fail: all pattern props required
do_check_matches({x: 1}, {x: 2}); // fail: values must match
do_check_matches({x: undefined}, {});
// 'length' property counts, even if non-enumerable.
do_check_matches([3,4,5], [3,5,5]); // fail; value doesn't match
do_check_matches([3,4,5], [3,4,5,6]);// fail; length doesn't match
do_check_matches([3, 4, 5], [3, 5, 5]); // fail; value doesn't match
do_check_matches([3, 4, 5], [3, 4, 5, 6]);// fail; length doesn't match
}

View File

@ -4,14 +4,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* import-globals-from import_module.jsm */
/* import-globals-from import_sub_module.jsm */
/**
* Ensures that tests can import a module in the same folder through:
* Components.utils.import("resource://test/module.jsm");
*/
function run_test() {
do_check_true(typeof(this['MODULE_IMPORTED']) == "undefined");
do_check_true(typeof(this['MODULE_URI']) == "undefined");
do_check_true(typeof(this["MODULE_IMPORTED"]) == "undefined");
do_check_true(typeof(this["MODULE_URI"]) == "undefined");
let uri = "resource://test/import_module.jsm";
Components.utils.import(uri);
do_check_true(MODULE_URI == uri);

View File

@ -13,9 +13,8 @@ function run_test() {
try {
load("file_that_does_not_exist.js");
subscriptLoaded = true;
}
catch (ex) {
do_check_eq(ex.message.substring(0,16), "cannot open file");
} catch (ex) {
do_check_eq(ex.message.substring(0, 16), "cannot open file");
}
do_check_false(subscriptLoaded, "load() should throw an error");
}

View File

@ -4,6 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* globals __LOCATION__ */
function run_test() {
do_check_eq(__LOCATION__.leafName, "test_location.js");
// also check that __LOCATION__ works via load()

View File

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function run_test()
{
function run_test() {
/* import-globals-from check_profile.js */
load("check_profile.js");
check_do_get_profile(false);
}

View File

@ -4,8 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function run_test()
{
function run_test() {
/* import-globals-from check_profile.js */
load("check_profile.js");
check_do_get_profile(true);
}

View File

@ -4,9 +4,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* This is the most basic testcase. It makes some trivial assertions,
* then sets a timeout, and exits the test harness when that timeout
* fires. This is meant to demonstrate that there is a complete event
/* This is the most basic testcase. It makes some trivial assertions,
* then sets a timeout, and exits the test harness when that timeout
* fires. This is meant to demonstrate that there is a complete event
* system available to test scripts.
* Available functions are described at:
* http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests

View File

@ -10,6 +10,20 @@
* for more information.
*/
/* defined by the harness */
/* globals _HEAD_FILES, _HEAD_JS_PATH, _JSDEBUGGER_PORT, _JSCOV_DIR,
_MOZINFO_JS_PATH, _TEST_FILE, _TEST_NAME, _TESTING_MODULES_DIR,
_XPCSHELL_PROCESS:true */
/* defined by XPCShellImpl.cpp */
/* globals load, sendCommand */
/* must be defined by tests using do_await_remote_message/do_send_remote_message */
/* globals Cc, Ci */
/* may be defined in test files */
/* globals run_test */
var _quit = false;
var _passed = true;
var _tests_pending = 0;
@ -38,13 +52,13 @@ var Assert = new AssertCls(function(err, message, stack) {
});
var _add_params = function (params) {
var _add_params = function(params) {
if (typeof _XPCSHELL_PROCESS != "undefined") {
params.xpcshell_process = _XPCSHELL_PROCESS;
}
};
var _dumpLog = function (raw_msg) {
var _dumpLog = function(raw_msg) {
dump("\n" + JSON.stringify(raw_msg) + "\n");
}
@ -66,8 +80,7 @@ try {
runningInParent = Components.classes["@mozilla.org/xre/runtime;1"].
getService(Components.interfaces.nsIXULRuntime).processType
== Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
}
catch (e) { }
} catch (e) { }
// Only if building of places is enabled.
if (runningInParent &&
@ -93,8 +106,7 @@ try {
prefs.setCharPref("network.dns.ipv4OnlyDomains", "localhost");
}
}
}
catch (e) { }
} catch (e) { }
// Configure crash reporting, if possible
// We rely on the Python harness to set MOZ_CRASHREPORTER,
@ -110,8 +122,7 @@ try {
crashReporter.UpdateCrashEventsDir();
crashReporter.minidumpPath = do_get_minidumpdir();
}
}
catch (e) { }
} catch (e) { }
// Configure a console listener so messages sent to it are logged as part
// of the test.
@ -122,14 +133,14 @@ try {
}
let listener = {
QueryInterface : function(iid) {
QueryInterface(iid) {
if (!iid.equals(Components.interfaces.nsISupports) &&
!iid.equals(Components.interfaces.nsIConsoleListener)) {
throw Components.results.NS_NOINTERFACE;
}
return this;
},
observe : function (msg) {
observe(msg) {
if (typeof do_print === "function")
do_print("CONSOLE_MESSAGE: (" + levelNames[msg.logLevel] + ") " + msg.toString());
}
@ -166,7 +177,7 @@ function _Timer(func, delay) {
_pendingTimers.push(timer);
}
_Timer.prototype = {
QueryInterface: function(iid) {
QueryInterface(iid) {
if (iid.equals(Components.interfaces.nsITimerCallback) ||
iid.equals(Components.interfaces.nsISupports))
return this;
@ -174,7 +185,7 @@ _Timer.prototype = {
throw Components.results.NS_ERROR_NO_INTERFACE;
},
notify: function(timer) {
notify(timer) {
_pendingTimers.splice(_pendingTimers.indexOf(timer), 1);
// The current nsITimer implementation can undershoot, but even if it
@ -240,8 +251,7 @@ var _fakeIdleService = {
return this.registrar.contractIDToCID(this.contractID);
},
activate: function FIS_activate()
{
activate: function FIS_activate() {
if (!this.originalFactory) {
// Save original factory.
this.originalFactory =
@ -256,8 +266,7 @@ var _fakeIdleService = {
}
},
deactivate: function FIS_deactivate()
{
deactivate: function FIS_deactivate() {
if (this.originalFactory) {
// Unregister the mock.
this.registrar.unregisterFactory(this.CID, this.factory);
@ -270,17 +279,16 @@ var _fakeIdleService = {
factory: {
// nsIFactory
createInstance: function (aOuter, aIID)
{
createInstance(aOuter, aIID) {
if (aOuter) {
throw Components.results.NS_ERROR_NO_AGGREGATION;
}
return _fakeIdleService.QueryInterface(aIID);
},
lockFactory: function (aLock) {
lockFactory(aLock) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
},
QueryInterface: function(aIID) {
QueryInterface(aIID) {
if (aIID.equals(Components.interfaces.nsIFactory) ||
aIID.equals(Components.interfaces.nsISupports)) {
return this;
@ -293,10 +301,10 @@ var _fakeIdleService = {
get idleTime() {
return 0;
},
addIdleObserver: function () {},
removeIdleObserver: function () {},
addIdleObserver() {},
removeIdleObserver() {},
QueryInterface: function(aIID) {
QueryInterface(aIID) {
// Useful for testing purposes, see test_get_idle.js.
if (aIID.equals(Components.interfaces.nsIFactory)) {
return this.factory;
@ -448,7 +456,7 @@ function _setupDebuggerServer(breakpointFiles, callback) {
function _initDebugging(port) {
let initialized = false;
let DebuggerServer = _setupDebuggerServer(_TEST_FILE, () => {initialized = true;});
let DebuggerServer = _setupDebuggerServer(_TEST_FILE, () => { initialized = true; });
do_print("");
do_print("*******************************************************************");
@ -505,7 +513,7 @@ function _execute_test() {
_PromiseTestUtils.Assert = Assert;
let coverageCollector = null;
if (typeof _JSCOV_DIR === 'string') {
if (typeof _JSCOV_DIR === "string") {
let _CoverageCollector = Components.utils.import("resource://testing-common/CoverageUtils.jsm", {}).CoverageCollector;
coverageCollector = new _CoverageCollector(_JSCOV_DIR);
}
@ -522,7 +530,7 @@ function _execute_test() {
}
if (_gTestHasOnly) {
_gTests = _gTests.filter(([props,]) => {
_gTests = _gTests.filter(([props, ]) => {
return ("_only" in props) && props._only;
});
}
@ -605,8 +613,7 @@ function _execute_test() {
}
}
_cleanupFunctions = [];
}.bind(this)).catch(reportCleanupError)
.then(() => complete = true);
}).catch(reportCleanupError).then(() => complete = true);
let thr = Components.classes["@mozilla.org/thread-manager;1"]
.getService().currentThread;
while (!complete) {
@ -666,7 +673,7 @@ function _wrap_with_quotes_if_necessary(val) {
return typeof val == "string" ? '"' + val + '"' : val;
}
/************** Functions to be used from the tests **************/
/* ************* Functions to be used from the tests ************* */
/**
* Prints a message to the output log.
@ -698,7 +705,7 @@ function do_execute_soon(callback, aName) {
.getService(Components.interfaces.nsIThreadManager);
tm.dispatchToMainThread({
run: function() {
run() {
try {
callback();
} catch (e) {
@ -711,14 +718,13 @@ function do_execute_soon(callback, aName) {
let stack = e.stack ? _format_stack(e.stack) : null;
_testLogger.testStatus(_TEST_NAME,
funcName,
'FAIL',
'PASS',
"FAIL",
"PASS",
_exception_message(e),
stack);
_do_quit();
}
}
finally {
} finally {
do_test_finished(funcName);
}
}
@ -865,22 +871,20 @@ function do_report_result(passed, text, stack, todo) {
"PASS",
message);
}
} else if (todo) {
_testLogger.testStatus(_TEST_NAME,
name,
"FAIL",
"FAIL",
message);
} else {
if (todo) {
_testLogger.testStatus(_TEST_NAME,
name,
"FAIL",
"FAIL",
message);
} else {
_testLogger.testStatus(_TEST_NAME,
name,
"FAIL",
"PASS",
message,
_format_stack(stack));
_abort_failed_test();
}
_testLogger.testStatus(_TEST_NAME,
name,
"FAIL",
"PASS",
message,
_format_stack(stack));
_abort_failed_test();
}
}
@ -930,7 +934,7 @@ function do_check_null(condition, stack) {
Assert.equal(condition, null);
}
function todo_check_null(condition, stack=Components.stack.caller) {
function todo_check_null(condition, stack = Components.stack.caller) {
todo_check_eq(condition, null, stack);
}
function do_check_matches(pattern, value) {
@ -940,10 +944,9 @@ function do_check_matches(pattern, value) {
// Check that |func| throws an nsIException that has
// |Components.results[resultName]| as the value of its 'result' property.
function do_check_throws_nsIException(func, resultName,
stack=Components.stack.caller, todo=false)
{
stack = Components.stack.caller, todo = false) {
let expected = Components.results[resultName];
if (typeof expected !== 'number') {
if (typeof expected !== "number") {
do_throw("do_check_throws_nsIException requires a Components.results" +
" property name, not " + uneval(resultName), stack);
}
@ -972,16 +975,15 @@ function do_check_throws_nsIException(func, resultName,
// Produce a human-readable form of |exception|. This looks up
// Components.results values, tries toString methods, and so on.
function legible_exception(exception)
{
function legible_exception(exception) {
switch (typeof exception) {
case 'object':
case "object":
if (exception instanceof Components.interfaces.nsIException) {
return "nsIException instance: " + uneval(exception.toString());
}
return exception.toString();
case 'number':
case "number":
for (let name in Components.results) {
if (exception === Components.results[name]) {
return "Components.results." + name;
@ -995,14 +997,14 @@ function legible_exception(exception)
}
function do_check_instanceof(value, constructor,
stack=Components.stack.caller, todo=false) {
stack = Components.stack.caller, todo = false) {
do_report_result(value instanceof constructor,
"value should be an instance of " + constructor.name,
stack, todo);
}
function todo_check_instanceof(value, constructor,
stack=Components.stack.caller) {
stack = Components.stack.caller) {
do_check_instanceof(value, constructor, stack, true);
}
@ -1047,8 +1049,7 @@ function do_get_file(path, allowNonexistent) {
}
return lf;
}
catch (ex) {
} catch (ex) {
do_throw(ex.toString(), Components.stack.caller);
}
@ -1090,7 +1091,7 @@ function do_parse_document(aPath, aType) {
}
let file = do_get_file(aPath),
ios = Components.classes['@mozilla.org/network/io-service;1']
ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService),
url = ios.newFileURI(file).spec;
file = null;
@ -1113,8 +1114,7 @@ function do_parse_document(aPath, aType) {
* @param aFunction
* The function to be called when the test harness has finished running.
*/
function do_register_cleanup(aFunction)
{
function do_register_cleanup(aFunction) {
_cleanupFunctions.push(aFunction);
}
@ -1150,9 +1150,8 @@ function do_get_minidumpdir() {
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(path);
return file;
} else {
return do_get_tempdir();
}
return do_get_tempdir();
}
/**
@ -1179,7 +1178,7 @@ function do_get_profile(notifyProfileAfterChange = false) {
let dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
let provider = {
getFile: function(prop, persistent) {
getFile(prop, persistent) {
persistent.value = true;
if (prop == "ProfD" || prop == "ProfLD" || prop == "ProfDS" ||
prop == "ProfLDS" || prop == "TmpD") {
@ -1187,7 +1186,7 @@ function do_get_profile(notifyProfileAfterChange = false) {
}
return null;
},
QueryInterface: function(iid) {
QueryInterface(iid) {
if (iid.equals(Components.interfaces.nsIDirectoryServiceProvider) ||
iid.equals(Components.interfaces.nsISupports)) {
return this;
@ -1236,8 +1235,7 @@ function do_get_profile(notifyProfileAfterChange = false) {
* (Note that you may use sendCommand without calling this function first; you
* simply won't have any of the functions in this file available.)
*/
function do_load_child_test_harness()
{
function do_load_child_test_harness() {
// Make sure this isn't called from child process
if (!runningInParent) {
do_throw("run_test_in_child cannot be called from child!");
@ -1259,7 +1257,7 @@ function do_load_child_test_harness()
+ "const _JSDEBUGGER_PORT=0; "
+ "const _XPCSHELL_PROCESS='child';";
if (typeof _JSCOV_DIR === 'string') {
if (typeof _JSCOV_DIR === "string") {
command += " const _JSCOV_DIR=" + uneval(_JSCOV_DIR) + ";";
}
@ -1284,12 +1282,11 @@ function do_load_child_test_harness()
* complete. If provided, the function must call do_test_finished();
* @return Promise Resolved when the test in the child is complete.
*/
function run_test_in_child(testFile, optionalCallback)
{
function run_test_in_child(testFile, optionalCallback) {
return new Promise((resolve) => {
var callback = () => {
resolve();
if (typeof optionalCallback == 'undefined') {
if (typeof optionalCallback == "undefined") {
do_test_finished();
} else {
optionalCallback();
@ -1317,11 +1314,10 @@ function run_test_in_child(testFile, optionalCallback)
* the function must call do_test_finished().
* @return Promise Promise that is resolved when the message is received.
*/
function do_await_remote_message(name, optionalCallback)
{
function do_await_remote_message(name, optionalCallback) {
return new Promise((resolve) => {
var listener = {
receiveMessage: function(message) {
receiveMessage(message) {
if (message.name == name) {
mm.removeMessageListener(name, listener);
resolve();
@ -1354,10 +1350,10 @@ function do_send_remote_message(name) {
var sender;
if (runningInParent) {
mm = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService(Ci.nsIMessageBroadcaster);
sender = 'broadcastAsyncMessage';
sender = "broadcastAsyncMessage";
} else {
mm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService(Ci.nsISyncMessageSender);
sender = 'sendAsyncMessage';
sender = "sendAsyncMessage";
}
mm[sender](name);
}
@ -1518,21 +1514,19 @@ var _gRunningTest = null;
var _gTestIndex = 0; // The index of the currently running test.
var _gTaskRunning = false;
var _gTestHasOnly = false;
function run_next_test()
{
function run_next_test() {
if (_gTaskRunning) {
throw new Error("run_next_test() called from an add_task() test function. " +
"run_next_test() should not be called from inside add_task() " +
"under any circumstances!");
}
function _run_next_test()
{
function _run_next_test() {
if (_gTestIndex < _gTests.length) {
// Check for uncaught rejections as early and often as possible.
_PromiseTestUtils.assertNoUncaughtRejections();
let _properties;
[_properties, _gRunningTest,] = _gTests[_gTestIndex++];
[_properties, _gRunningTest, ] = _gTests[_gTestIndex++];
if (typeof(_properties.skip_if) == "function" && _properties.skip_if()) {
let _condition = _properties.skip_if.toSource().replace(/\(\)\s*=>\s*/, "");
let _message = _gRunningTest.name

View File

@ -32,7 +32,7 @@ mozProtocolHandler.prototype = {
newChannel2(uri, loadInfo) {
let realURL = NetUtil.newURI(this.urlToLoad);
let channel = Services.io.newChannelFromURIWithLoadInfo(realURL, loadInfo)
loadInfo.resultPrincipalURI = realURL;
channel.loadFlags |= Ci.nsIChannel.LOAD_REPLACE;
return channel;
},

View File

@ -1076,7 +1076,16 @@
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 75,
"description": "The longest phase in any slice that goes over 2x the budget"
"description": "The longest phase in any slice that goes over 2x the budget. The phase values are defined in js/src/gc/GenerateStatsPhases.py."
},
"GC_SLOW_TASK": {
"record_in_processes": ["main", "content"],
"alert_emails": ["dev-telemetry-gc-alerts@mozilla.org","jcoppeard@mozilla.com"],
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 75,
"description": "The longest parallel task in any slice that goes over 2x the budget. The phase values are defined in js/src/gc/GenerateStatsPhases.py.",
"bug_numbers": [1309651]
},
"GC_MMU_50": {
"record_in_processes": ["main", "content"],

View File

@ -42,12 +42,12 @@ add_task(async function test_setup() {
* CRASH_TIMEOUT_MS to complete.
*/
add_task(async function test_sendTelemetryShutsDownWithinReasonableTimeout() {
const CRASH_TIMEOUT_MS = 5 * 1000;
const CRASH_TIMEOUT_MS = 10 * 1000;
// Enable testing mode for AsyncShutdown, otherwise some testing-only functionality
// is not available.
Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
// Reducing the max delay for waitiing on phases to complete from 1 minute
// (standard) to 10 seconds to avoid blocking the tests in case of misbehavior.
// (standard) to 20 seconds to avoid blocking the tests in case of misbehavior.
Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", CRASH_TIMEOUT_MS);
let httpServer = new HttpServer();

View File

@ -92,7 +92,7 @@ CPP_TEST_PACKAGE = $(PKG_BASENAME).cppunittest.tests.zip
XPC_TEST_PACKAGE = $(PKG_BASENAME).xpcshell.tests.zip
MOCHITEST_PACKAGE = $(PKG_BASENAME).mochitest.tests.zip
REFTEST_PACKAGE = $(PKG_BASENAME).reftest.tests.zip
WP_TEST_PACKAGE = $(PKG_BASENAME).web-platform.tests.tar.gz
WP_TEST_PACKAGE = $(PKG_BASENAME).web-platform.tests.zip
TALOS_PACKAGE = $(PKG_BASENAME).talos.tests.zip
AWSY_PACKAGE = $(PKG_BASENAME).awsy.tests.zip
GTEST_PACKAGE = $(PKG_BASENAME).gtest.tests.zip

View File

@ -1602,13 +1602,9 @@ UpdateService.prototype = {
switch (topic) {
case "post-update-processing":
if (readStatusFile(getUpdatesDir()) == STATE_SUCCEEDED) {
// The active update needs to be copied to the first update in the
// updates.xml early during startup to support post update actions
// (bug 1301288).
let um = Cc["@mozilla.org/updates/update-manager;1"].
getService(Ci.nsIUpdateManager);
um.activeUpdate.state = STATE_SUCCEEDED;
um.saveUpdates();
// After a successful update the post update preference needs to be
// set early during startup so applications can perform post update
// actions when they are defined in the update's metadata.
Services.prefs.setBoolPref(PREF_APP_UPDATE_POSTUPDATE, true);
}
@ -2650,23 +2646,20 @@ UpdateManager.prototype = {
if (!update)
return;
this._ensureUpdates();
if (this._updates) {
for (var i = 0; i < this._updates.length; ++i) {
// Keep all update entries with a state of STATE_FAILED and replace the
// first update entry that has the same application version and build ID
// if it exists. This allows the update history to only have one success
// entry for an update and entries for all failed updates.
if (update.state != STATE_FAILED &&
this._updates[i] &&
this._updates[i].state != STATE_FAILED &&
this._updates[i].appVersion == update.appVersion &&
this._updates[i].buildID == update.buildID) {
// Replace the existing entry with the new value, updating
// all metadata.
this._updates[i] = update;
return;
}
}
// Only the latest update entry is checked so the the latest successful
// step for an update is recorded and all failures are kept. This way
// mutliple attempts to update for the same update are kept in the update
// history.
if (this._updates &&
update.state != STATE_FAILED &&
this._updates[0] &&
this._updates[0].state != STATE_FAILED &&
this._updates[0].appVersion == update.appVersion &&
this._updates[0].buildID == update.buildID) {
// Replace the existing entry with the new value, updating
// all metadata.
this._updates[0] = update;
return;
}
// Otherwise add it to the front of the list.
this._updates.unshift(update);
@ -2722,15 +2715,12 @@ UpdateManager.prototype = {
this._addUpdate(this._activeUpdate);
this._ensureUpdates();
// Don't write updates that have a temporary state to the updates.xml file.
// Don't write updates that don't have a state to the updates.xml file.
if (this._updates) {
let updates = this._updates.slice();
for (let i = updates.length - 1; i >= 0; --i) {
let state = updates[i].state;
if (state == STATE_NONE || state == STATE_DOWNLOADING ||
state == STATE_APPLIED || state == STATE_APPLIED_SERVICE ||
state == STATE_PENDING || state == STATE_PENDING_SERVICE ||
state == STATE_PENDING_ELEVATE) {
if (state == STATE_NONE) {
updates.splice(i, 1);
}
}

View File

@ -60,7 +60,7 @@ function runUpdateFinished() {
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
Assert.equal(gUpdateManager.updateCount, 2,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
"the update state" + MSG_SHOULD_EQUAL);

View File

@ -612,7 +612,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval)
const NSString* type = nil;
bool allowFileURL = false;
if (dataFlavor.EqualsLiteral(kFileMime)) {
type = [UTIHelper stringFromPboardType:kMozFileUrlsPboardType];
type = [UTIHelper stringFromPboardType:(NSString*)kUTTypeFileURL];
allowFileURL = true;
} else if (dataFlavor.EqualsLiteral(kUnicodeMime)) {
type = [UTIHelper stringFromPboardType:NSPasteboardTypeString];

View File

@ -1553,6 +1553,14 @@ TSFTextStore::Init(nsWindowBase* aWidget,
("0x%p TSFTextStore::Init(aWidget=0x%p)",
this, aWidget));
if (NS_WARN_IF(!aWidget) || NS_WARN_IF(aWidget->Destroyed())) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED due to being initialized with "
"destroyed widget",
this));
return false;
}
TSFStaticSink::GetInstance()->EnsureInitActiveTIPKeyboard();
if (mDocumentMgr) {
@ -1562,14 +1570,6 @@ TSFTextStore::Init(nsWindowBase* aWidget,
return false;
}
// Create document manager
HRESULT hr = sThreadMgr->CreateDocumentMgr(getter_AddRefs(mDocumentMgr));
if (FAILED(hr)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create DocumentMgr "
"(0x%08X)", this, hr));
return false;
}
mWidget = aWidget;
if (NS_WARN_IF(!mWidget)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
@ -1585,30 +1585,62 @@ TSFTextStore::Init(nsWindowBase* aWidget,
return false;
}
SetInputScope(aContext.mHTMLInputType, aContext.mHTMLInputInputmode);
// Create document manager
RefPtr<ITfThreadMgr> threadMgr = sThreadMgr;
RefPtr<ITfDocumentMgr> documentMgr;
HRESULT hr = threadMgr->CreateDocumentMgr(getter_AddRefs(documentMgr));
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create ITfDocumentMgr "
"(0x%08X)", this, hr));
return false;
}
if (NS_WARN_IF(mDestroyed)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create ITfDocumentMgr due to "
"TextStore being destroyed during calling "
"ITfThreadMgr::CreateDocumentMgr()", this));
return false;
}
// Create context and add it to document manager
hr = mDocumentMgr->CreateContext(sClientId, 0,
static_cast<ITextStoreACP*>(this),
getter_AddRefs(mContext), &mEditCookie);
if (FAILED(hr)) {
RefPtr<ITfContext> context;
hr = documentMgr->CreateContext(sClientId, 0,
static_cast<ITextStoreACP*>(this),
getter_AddRefs(context), &mEditCookie);
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create the context "
"(0x%08X)", this, hr));
mDocumentMgr = nullptr;
return false;
}
if (NS_WARN_IF(mDestroyed)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create ITfContext due to "
"TextStore being destroyed during calling "
"ITfDocumentMgr::CreateContext()", this));
return false;
}
SetInputScope(aContext.mHTMLInputType, aContext.mHTMLInputInputmode);
hr = mDocumentMgr->Push(mContext);
if (FAILED(hr)) {
hr = documentMgr->Push(context);
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to push the context (0x%08X)",
this, hr));
// XXX Why don't we use NS_IF_RELEASE() here??
mContext = nullptr;
mDocumentMgr = nullptr;
return false;
}
if (NS_WARN_IF(mDestroyed)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
("0x%p TSFTextStore::Init() FAILED to create ITfContext due to "
"TextStore being destroyed during calling ITfDocumentMgr::Push()",
this));
documentMgr->Pop(TF_POPF_ALL);
return false;
}
mDocumentMgr = documentMgr;
mContext = context;
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("0x%p TSFTextStore::Init() succeeded: "
@ -1658,7 +1690,8 @@ TSFTextStore::Destroy()
("0x%p TSFTextStore::Destroy(), calling "
"ITextStoreACPSink::OnLayoutChange(TS_LC_DESTROY)...",
this));
mSink->OnLayoutChange(TS_LC_DESTROY, TEXTSTORE_DEFAULT_VIEW);
RefPtr<ITextStoreACPSink> sink = mSink;
sink->OnLayoutChange(TS_LC_DESTROY, TEXTSTORE_DEFAULT_VIEW);
}
// If this is called during handling a keydown or keyup message, we should
@ -1682,8 +1715,8 @@ TSFTextStore::ReleaseTSFObjects()
mContext = nullptr;
if (mDocumentMgr) {
mDocumentMgr->Pop(TF_POPF_ALL);
mDocumentMgr = nullptr;
RefPtr<ITfDocumentMgr> documentMgr = mDocumentMgr.forget();
documentMgr->Pop(TF_POPF_ALL);
}
mSink = nullptr;
mWidget = nullptr;
@ -1850,7 +1883,8 @@ TSFTextStore::RequestLock(DWORD dwLockFlags,
// Don't release this instance during this lock because this is called by
// TSF but they don't grab us during this call.
RefPtr<TSFTextStore> kungFuDeathGrip(this);
*phrSession = mSink->OnLockGranted(mLock);
RefPtr<ITextStoreACPSink> sink = mSink;
*phrSession = sink->OnLockGranted(mLock);
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("0x%p Unlocked (%s) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
@ -1863,7 +1897,7 @@ TSFTextStore::RequestLock(DWORD dwLockFlags,
("0x%p Locking for the request in the queue (%s) >>>>>>>>>>>>>>"
">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
this, GetLockFlagNameStr(mLock).get()));
mSink->OnLockGranted(mLock);
sink->OnLockGranted(mLock);
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("0x%p Unlocked (%s) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",
@ -2187,6 +2221,8 @@ TSFTextStore::MaybeFlushPendingNotifications()
// When there is no cached content, we can sync actual contents and TSF/TIP
// expecting contents.
RefPtr<TSFTextStore> kungFuDeathGrip = this;
Unused << kungFuDeathGrip;
if (!mContentForTSF.IsInitialized()) {
if (mPendingTextChangeData.IsValid()) {
MOZ_LOG(sTextStoreLog, LogLevel::Info,
@ -4945,29 +4981,47 @@ TSFTextStore::OnFocusChange(bool aGotFocus,
}
RefPtr<ITfDocumentMgr> prevFocusedDocumentMgr;
RefPtr<TSFTextStore> oldTextStore = sEnabledTextStore.forget();
// If currently sEnableTextStore has focus, notifies TSF of losing focus.
if (ThinksHavingFocus()) {
RefPtr<ITfThreadMgr> threadMgr = sThreadMgr;
DebugOnly<HRESULT> hr =
sThreadMgr->AssociateFocus(
sEnabledTextStore->mWidget->GetWindowHandle(),
threadMgr->AssociateFocus(
oldTextStore->mWidget->GetWindowHandle(),
nullptr, getter_AddRefs(prevFocusedDocumentMgr));
NS_ASSERTION(SUCCEEDED(hr), "Disassociating focus failed");
NS_ASSERTION(prevFocusedDocumentMgr == sEnabledTextStore->mDocumentMgr,
NS_ASSERTION(prevFocusedDocumentMgr == oldTextStore->mDocumentMgr,
"different documentMgr has been associated with the window");
}
// If there is sEnabledTextStore, we don't use it in the new focused editor.
// Release it now.
if (sEnabledTextStore) {
sEnabledTextStore->Destroy();
sEnabledTextStore = nullptr;
if (oldTextStore) {
oldTextStore->Destroy();
}
if (NS_WARN_IF(!sThreadMgr)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::OnFocusChange() FAILED, due to "
"sThreadMgr being destroyed during calling "
"ITfThreadMgr::AssociateFocus()"));
return NS_ERROR_FAILURE;
}
if (NS_WARN_IF(sEnabledTextStore)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::OnFocusChange() FAILED, due to "
"nested event handling has created another focused TextStore during "
"calling ITfThreadMgr::AssociateFocus()"));
return NS_ERROR_FAILURE;
}
// If this is a notification of blur, move focus to the dummy document
// manager.
if (!aGotFocus || !aContext.mIMEState.IsEditable()) {
HRESULT hr = sThreadMgr->SetFocus(sDisabledDocumentMgr);
RefPtr<ITfThreadMgr> threadMgr = sThreadMgr;
RefPtr<ITfDocumentMgr> disabledDocumentMgr = sDisabledDocumentMgr;
HRESULT hr = threadMgr->SetFocus(disabledDocumentMgr);
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::OnFocusChange() FAILED due to "
@ -4982,17 +5036,23 @@ TSFTextStore::OnFocusChange(bool aGotFocus,
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::OnFocusChange() FAILED due to "
"ITfThreadMgr::CreateAndSetFocus() failure"));
// If setting focus, we should destroy the TextStore completely because
// it causes memory leak.
if (sEnabledTextStore) {
sEnabledTextStore->Destroy();
sEnabledTextStore = nullptr;
}
return NS_ERROR_FAILURE;
}
return NS_OK;
}
// static
void
TSFTextStore::EnsureToDestroyAndReleaseEnabledTextStoreIf(
RefPtr<TSFTextStore>& aTextStore)
{
aTextStore->Destroy();
if (sEnabledTextStore == aTextStore) {
sEnabledTextStore = nullptr;
}
aTextStore = nullptr;
}
// static
bool
TSFTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget,
@ -5007,49 +5067,87 @@ TSFTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget,
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"TSFTextStore::Init() failure"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (NS_WARN_IF(!textStore->mDocumentMgr)) {
RefPtr<ITfDocumentMgr> newDocMgr = textStore->mDocumentMgr;
if (NS_WARN_IF(!newDocMgr)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"invalid TSFTextStore::mDocumentMgr"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (aContext.mIMEState.mEnabled == IMEState::PASSWORD) {
MarkContextAsKeyboardDisabled(textStore->mContext);
RefPtr<ITfContext> topContext;
textStore->mDocumentMgr->GetTop(getter_AddRefs(topContext));
newDocMgr->GetTop(getter_AddRefs(topContext));
if (topContext && topContext != textStore->mContext) {
MarkContextAsKeyboardDisabled(topContext);
}
}
HRESULT hr;
RefPtr<ITfThreadMgr> threadMgr = sThreadMgr;
{
// Windows 10's softwware keyboard requires that SetSelection must be
// always successful into SetFocus. If returning error, it might crash
// into TextInputFramework.dll.
AutoSetTemporarySelection setSelection(textStore->SelectionForTSFRef());
hr = sThreadMgr->SetFocus(textStore->mDocumentMgr);
hr = threadMgr->SetFocus(newDocMgr);
}
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"ITfTheadMgr::SetFocus() failure"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (NS_WARN_IF(!sThreadMgr)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"sThreadMgr being destroyed during calling "
"ITfTheadMgr::SetFocus()"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (NS_WARN_IF(sEnabledTextStore != textStore)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"creating TextStore has lost focus during calling "
"ITfThreadMgr::SetFocus()"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
// Use AssociateFocus() for ensuring that any native focus event
// never steal focus from our documentMgr.
RefPtr<ITfDocumentMgr> prevFocusedDocumentMgr;
hr = sThreadMgr->AssociateFocus(aFocusedWidget->GetWindowHandle(),
textStore->mDocumentMgr,
getter_AddRefs(prevFocusedDocumentMgr));
hr = threadMgr->AssociateFocus(aFocusedWidget->GetWindowHandle(), newDocMgr,
getter_AddRefs(prevFocusedDocumentMgr));
if (NS_WARN_IF(FAILED(hr))) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"ITfTheadMgr::AssociateFocus() failure"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (NS_WARN_IF(!sThreadMgr)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"sThreadMgr being destroyed during calling "
"ITfTheadMgr::AssociateFocus()"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
if (NS_WARN_IF(sEnabledTextStore != textStore)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"creating TextStore has lost focus during calling "
"ITfTheadMgr::AssociateFocus()"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
@ -5058,7 +5156,16 @@ TSFTextStore::CreateAndSetFocus(nsWindowBase* aFocusedWidget,
(" TSFTextStore::CreateAndSetFocus(), calling "
"ITextStoreACPSink::OnLayoutChange(TS_LC_CREATE) for 0x%p...",
textStore.get()));
textStore->mSink->OnLayoutChange(TS_LC_CREATE, TEXTSTORE_DEFAULT_VIEW);
RefPtr<ITextStoreACPSink> sink = textStore->mSink;
sink->OnLayoutChange(TS_LC_CREATE, TEXTSTORE_DEFAULT_VIEW);
if (NS_WARN_IF(sEnabledTextStore != textStore)) {
MOZ_LOG(sTextStoreLog, LogLevel::Error,
(" TSFTextStore::CreateAndSetFocus() FAILED due to "
"creating TextStore has lost focus during calling "
"ITextStoreACPSink::OnLayoutChange(TS_LC_CREATE)"));
EnsureToDestroyAndReleaseEnabledTextStoreIf(textStore);
return false;
}
}
return true;
}
@ -5183,7 +5290,8 @@ TSFTextStore::NotifyTSFOfTextChange()
"ITextStoreACPSink::OnTextChange(0, { acpStart=%ld, acpOldEnd=%ld, "
"acpNewEnd=%ld })...", this, textChange.acpStart,
textChange.acpOldEnd, textChange.acpNewEnd));
mSink->OnTextChange(0, &textChange);
RefPtr<ITextStoreACPSink> sink = mSink;
sink->OnTextChange(0, &textChange);
}
nsresult
@ -5262,7 +5370,8 @@ TSFTextStore::NotifyTSFOfSelectionChange()
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("0x%p TSFTextStore::NotifyTSFOfSelectionChange(), calling "
"ITextStoreACPSink::OnSelectionChange()...", this));
mSink->OnSelectionChange();
RefPtr<ITextStoreACPSink> sink = mSink;
sink->OnSelectionChange();
}
nsresult
@ -5334,7 +5443,8 @@ TSFTextStore::NotifyTSFOfLayoutChange()
("0x%p TSFTextStore::NotifyTSFOfLayoutChange(), "
"calling ITextStoreACPSink::OnLayoutChange()...",
this));
HRESULT hr = mSink->OnLayoutChange(TS_LC_CHANGE, TEXTSTORE_DEFAULT_VIEW);
RefPtr<ITextStoreACPSink> sink = mSink;
HRESULT hr = sink->OnLayoutChange(TS_LC_CHANGE, TEXTSTORE_DEFAULT_VIEW);
MOZ_LOG(sTextStoreLog, LogLevel::Info,
("0x%p TSFTextStore::NotifyTSFOfLayoutChange(), "
"called ITextStoreACPSink::OnLayoutChange()",
@ -5694,7 +5804,8 @@ TSFTextStore::CommitCompositionInternal(bool aDiscard)
"mSink->OnTextChange(0, { acpStart=%ld, acpOldEnd=%ld, "
"acpNewEnd=%ld })...", this, textChange.acpStart,
textChange.acpOldEnd, textChange.acpNewEnd));
mSink->OnTextChange(0, &textChange);
RefPtr<ITextStoreACPSink> sink = mSink;
sink->OnTextChange(0, &textChange);
}
}
// Terminate two contexts, the base context (mContext) and the top
@ -6103,35 +6214,37 @@ TSFTextStore::ProcessRawKeyMessage(const MSG& aMsg)
if (aMsg.message == WM_KEYDOWN) {
BOOL eaten;
HRESULT hr = sKeystrokeMgr->TestKeyDown(aMsg.wParam, aMsg.lParam, &eaten);
if (FAILED(hr) || !eaten) {
RefPtr<ITfKeystrokeMgr> keystrokeMgr = sKeystrokeMgr;
HRESULT hr = keystrokeMgr->TestKeyDown(aMsg.wParam, aMsg.lParam, &eaten);
if (FAILED(hr) || !sKeystrokeMgr || !eaten) {
return false;
}
RefPtr<TSFTextStore> textStore(sEnabledTextStore);
if (textStore) {
textStore->OnStartToHandleKeyMessage();
}
hr = sKeystrokeMgr->KeyDown(aMsg.wParam, aMsg.lParam, &eaten);
hr = keystrokeMgr->KeyDown(aMsg.wParam, aMsg.lParam, &eaten);
if (textStore) {
textStore->OnEndHandlingKeyMessage();
}
return SUCCEEDED(hr) && eaten;
return SUCCEEDED(hr) && (eaten || !sKeystrokeMgr);
}
if (aMsg.message == WM_KEYUP) {
BOOL eaten;
HRESULT hr = sKeystrokeMgr->TestKeyUp(aMsg.wParam, aMsg.lParam, &eaten);
if (FAILED(hr) || !eaten) {
RefPtr<ITfKeystrokeMgr> keystrokeMgr = sKeystrokeMgr;
HRESULT hr = keystrokeMgr->TestKeyUp(aMsg.wParam, aMsg.lParam, &eaten);
if (FAILED(hr) || !sKeystrokeMgr || !eaten) {
return false;
}
RefPtr<TSFTextStore> textStore(sEnabledTextStore);
if (textStore) {
textStore->OnStartToHandleKeyMessage();
}
hr = sKeystrokeMgr->KeyUp(aMsg.wParam, aMsg.lParam, &eaten);
hr = keystrokeMgr->KeyUp(aMsg.wParam, aMsg.lParam, &eaten);
if (textStore) {
textStore->OnEndHandlingKeyMessage();
}
return SUCCEEDED(hr) && eaten;
return SUCCEEDED(hr) && (eaten || !sKeystrokeMgr);
}
return false;
}
@ -6481,7 +6594,8 @@ TSFTextStore::MouseTracker::OnMouseButtonEvent(ULONG aEdge,
MOZ_ASSERT(IsUsing(), "The caller must check before calling OnMouseEvent()");
BOOL eaten = FALSE;
HRESULT hr = mSink->OnMouseEvent(aEdge, aQuadrant, aButtonStatus, &eaten);
RefPtr<ITfMouseSink> sink = mSink;
HRESULT hr = sink->OnMouseEvent(aEdge, aQuadrant, aButtonStatus, &eaten);
MOZ_LOG(sTextStoreLog, LogLevel::Debug,
("0x%p TSFTextStore::MouseTracker::OnMouseEvent(aEdge=%d, "

View File

@ -248,6 +248,8 @@ protected:
static bool CreateAndSetFocus(nsWindowBase* aFocusedWidget,
const InputContext& aContext);
static void EnsureToDestroyAndReleaseEnabledTextStoreIf(
RefPtr<TSFTextStore>& aTextStore);
static void MarkContextAsKeyboardDisabled(ITfContext* aContext);
static void MarkContextAsEmpty(ITfContext* aContext);

View File

@ -694,7 +694,7 @@ WinUtils::PeekMessage(LPMSG aMsg, HWND aWnd, UINT aFirstMessage,
}
#endif
#ifdef NS_ENABLE_TSF
ITfMessagePump* msgPump = TSFTextStore::GetMessagePump();
RefPtr<ITfMessagePump> msgPump = TSFTextStore::GetMessagePump();
if (msgPump) {
BOOL ret = FALSE;
HRESULT hr = msgPump->PeekMessageW(aMsg, aWnd, aFirstMessage, aLastMessage,
@ -712,7 +712,7 @@ WinUtils::GetMessage(LPMSG aMsg, HWND aWnd, UINT aFirstMessage,
UINT aLastMessage)
{
#ifdef NS_ENABLE_TSF
ITfMessagePump* msgPump = TSFTextStore::GetMessagePump();
RefPtr<ITfMessagePump> msgPump = TSFTextStore::GetMessagePump();
if (msgPump) {
BOOL ret = FALSE;
HRESULT hr = msgPump->GetMessageW(aMsg, aWnd, aFirstMessage, aLastMessage,