Merge inbound to mozilla-central. a=merge

This commit is contained in:
Brindusan Cristian 2019-02-19 06:38:36 +02:00
commit 0709795ffe
13 changed files with 90 additions and 47 deletions

View File

@ -147,3 +147,24 @@ tbody.collapsible td {
white-space: pre;
direction: ltr;
}
/*
* The Active tab has two messages: one for when the policy service
* is inactive and another for when the there are no specified
* policies. The three classes below control which message to display
* or to show the policy table.
*/
.no-specified-policies > table,
.inactive-service > table {
display: none;
}
:not(.no-specified-policies) > .no-specified-policies-message,
:not(.inactive-service) > .inactive-service-message {
display: none;
}
.no-specified-policies-message,
.inactive-service-message {
padding: 1rem;
}

View File

@ -91,6 +91,15 @@ function generateActivePolicies(data) {
}
}
if (policy_count < 1) {
let current_tab = document.querySelector(".active");
if (Services.policies.status == Services.policies.ACTIVE) {
current_tab.classList.add("no-specified-policies");
} else {
current_tab.classList.add("inactive-service");
}
}
addMissingColumns();
}
@ -206,7 +215,6 @@ function generateErrors() {
new_cont.appendChild(row);
}
}
if (!flag) {
let errors_tab = document.getElementById("category-errors");
errors_tab.style.display = "none";

View File

@ -37,6 +37,8 @@
</div>
<div id="active" class="tab active">
<h3 class="inactive-service-message" data-l10n-id="inactive-message"></h3>
<h3 class="no-specified-policies-message" data-l10n-id="no-specified-policies-message"></h3>
<table>
<thead>
<tr>

View File

@ -9,6 +9,9 @@ active-policies-tab = Active
errors-tab = Errors
documentation-tab = Documentation
no-specified-policies-message = The Enterprise Policies service is active but there are no policies enabled.
inactive-message = The Enterprise Policies service is inactive.
policy-name = Policy Name
policy-value = Policy Value
policy-errors = Policy Errors

View File

@ -80,7 +80,7 @@ void VideoFrameContainer::UpdatePrincipalHandleForFrameIDLocked(
mFrameIDForPendingPrincipalHandle = aFrameID;
}
static void SetImageToBlackPixel(PlanarYCbCrImage* aImage) {
static bool SetImageToBlackPixel(PlanarYCbCrImage* aImage) {
uint8_t blackPixel[] = {0x10, 0x80, 0x80};
PlanarYCbCrData data;
@ -89,7 +89,7 @@ static void SetImageToBlackPixel(PlanarYCbCrImage* aImage) {
data.mCrChannel = blackPixel + 2;
data.mYStride = data.mCbCrStride = 1;
data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1);
aImage->CopyData(data);
return aImage->CopyData(data);
}
class VideoFrameContainerInvalidateRunnable : public Runnable {
@ -142,11 +142,13 @@ void VideoFrameContainer::SetCurrentFrames(const VideoSegment& aSegment) {
if (frame->GetForceBlack()) {
if (!mBlackImage) {
mBlackImage = GetImageContainer()->CreatePlanarYCbCrImage();
if (mBlackImage) {
RefPtr<Image> blackImage = GetImageContainer()->CreatePlanarYCbCrImage();
if (blackImage) {
// Sets the image to a single black pixel, which will be scaled to
// fill the rendered size.
SetImageToBlackPixel(mBlackImage->AsPlanarYCbCrImage());
if (SetImageToBlackPixel(blackImage->AsPlanarYCbCrImage())) {
mBlackImage = blackImage;
}
}
}
if (mBlackImage) {

View File

@ -64,7 +64,8 @@ RefPtr<mozilla::layers::Image> RemoteVideoDecoderChild::DeserializeImage(
// images coming from AOMDecoder are RecyclingPlanarYCbCrImages.
RefPtr<RecyclingPlanarYCbCrImage> image =
new RecyclingPlanarYCbCrImage(mBufferRecycleBin);
image->CopyData(pData);
bool setData = image->CopyData(pData);
MOZ_ASSERT(setData);
switch (memOrShmem.type()) {
case MemoryOrShmem::Tuintptr_t:
@ -77,6 +78,10 @@ RefPtr<mozilla::layers::Image> RemoteVideoDecoderChild::DeserializeImage(
MOZ_ASSERT(false, "Unknown MemoryOrShmem type");
}
if (!setData) {
return nullptr;
}
return image;
}

View File

@ -2074,7 +2074,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidator
str);
}
SharedModule finish(UniqueLinkData* linkData) {
SharedModule finish() {
MOZ_ASSERT(env_.funcTypes.empty());
if (!env_.funcTypes.resize(funcImportMap_.count() + funcDefs_.length())) {
return nullptr;
@ -2167,7 +2167,7 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED ModuleValidator
return nullptr;
}
return mg.finishModule(*bytes, nullptr, linkData);
return mg.finishModule(*bytes);
}
};
@ -6350,8 +6350,7 @@ static bool CheckModuleEnd(ModuleValidator<Unit>& m) {
template <typename Unit>
static SharedModule CheckModule(JSContext* cx, AsmJSParser<Unit>& parser,
ParseNode* stmtList, UniqueLinkData* linkData,
unsigned* time) {
ParseNode* stmtList, unsigned* time) {
int64_t before = PRMJ_Now();
FunctionNode* moduleFunctionNode = parser.pc->functionBox()->functionNode;
@ -6401,7 +6400,7 @@ static SharedModule CheckModule(JSContext* cx, AsmJSParser<Unit>& parser,
return nullptr;
}
SharedModule module = m.finish(linkData);
SharedModule module = m.finish();
if (!module) {
return nullptr;
}
@ -7068,18 +7067,12 @@ static bool DoCompileAsmJS(JSContext* cx, AsmJSParser<Unit>& parser,
return NoExceptionPending(cx);
}
// Validate and generate code in a single linear pass over the chars of the
// asm.js module.
SharedModule module;
// "Checking" parses, validates and compiles, producing a fully compiled
// WasmModuleObject as result.
unsigned time;
{
// "Checking" parses, validates and compiles, producing a fully compiled
// WasmModuleObject as result.
UniqueLinkData linkData;
module = CheckModule(cx, parser, stmtList, &linkData, &time);
if (!module) {
return NoExceptionPending(cx);
}
SharedModule module = CheckModule(cx, parser, stmtList, &time);
if (!module) {
return NoExceptionPending(cx);
}
// Hand over ownership to a GC object wrapper which can then be referenced

View File

@ -551,7 +551,7 @@ SharedModule wasm::CompileBuffer(const CompileArgs& args,
const ShareableBytes& bytecode,
UniqueChars* error,
UniqueCharsVector* warnings,
UniqueLinkData* maybeLinkData) {
JS::OptimizedEncodingListener* listener) {
Decoder d(bytecode.bytes, 0, error, warnings);
CompilerEnvironment compilerEnv(args);
@ -575,7 +575,7 @@ SharedModule wasm::CompileBuffer(const CompileArgs& args,
return nullptr;
}
return mg.finishModule(bytecode, nullptr, maybeLinkData);
return mg.finishModule(bytecode, listener);
}
void wasm::CompileTier2(const CompileArgs& args, const Bytes& bytecode,

View File

@ -95,7 +95,7 @@ double EstimateCompiledCodeSize(Tier tier, size_t bytecodeSize);
SharedModule CompileBuffer(const CompileArgs& args,
const ShareableBytes& bytecode, UniqueChars* error,
UniqueCharsVector* warnings,
UniqueLinkData* maybeLinkData = nullptr);
JS::OptimizedEncodingListener* listener = nullptr);
// Attempt to compile the second tier of the given wasm::Module.

View File

@ -1094,8 +1094,7 @@ SharedMetadata ModuleGenerator::finishMetadata(const Bytes& bytecode) {
SharedModule ModuleGenerator::finishModule(
const ShareableBytes& bytecode,
JS::OptimizedEncodingListener* maybeTier2Listener,
UniqueLinkData* maybeLinkData) {
JS::OptimizedEncodingListener* maybeTier2Listener) {
MOZ_ASSERT(mode() == CompileMode::Once || mode() == CompileMode::Tier1);
UniqueCodeTier codeTier = finishCodeTier();
@ -1213,11 +1212,6 @@ SharedModule ModuleGenerator::finishModule(
module->serialize(*linkData_, *maybeTier2Listener);
}
if (maybeLinkData) {
MOZ_ASSERT(!env_->debugEnabled());
*maybeLinkData = std::move(linkData_);
}
return module;
}

View File

@ -220,8 +220,7 @@ class MOZ_STACK_CLASS ModuleGenerator {
SharedModule finishModule(
const ShareableBytes& bytecode,
JS::OptimizedEncodingListener* maybeTier2Listener = nullptr,
UniqueLinkData* maybeLinkData = nullptr);
JS::OptimizedEncodingListener* maybeTier2Listener = nullptr);
MOZ_MUST_USE bool finishTier2(const Module& module);
};

View File

@ -452,6 +452,24 @@ bool wasm::Eval(JSContext* cx, Handle<TypedArrayObject*> code,
globalObjs.get(), nullptr, instanceObj);
}
struct MOZ_STACK_CLASS SerializeListener : JS::OptimizedEncodingListener {
// MOZ_STACK_CLASS means these can be nops.
MozExternalRefCountType MOZ_XPCOM_ABI AddRef() override { return 0; }
MozExternalRefCountType MOZ_XPCOM_ABI Release() override { return 0; }
DebugOnly<bool> called = false;
Bytes* serialized;
explicit SerializeListener(Bytes* serialized) : serialized(serialized) {}
void storeOptimizedEncoding(const uint8_t* bytes, size_t length) override {
MOZ_ASSERT(!called);
called = true;
if (serialized->resize(length)) {
memcpy(serialized->begin(), bytes, length);
}
}
};
bool wasm::CompileAndSerialize(const ShareableBytes& bytecode,
Bytes* serialized) {
MutableCompileArgs compileArgs = js_new<CompileArgs>(ScriptedCaller());
@ -459,28 +477,26 @@ bool wasm::CompileAndSerialize(const ShareableBytes& bytecode,
return false;
}
// The caller has ensured HasCachingSupport().
// The caller has ensured HasCachingSupport(). Moreover, we want to ensure
// we go straight to tier-2 so that we synchronously call
// JS::OptimizedEncodingListener::storeOptimizedEncoding().
compileArgs->baselineEnabled = false;
compileArgs->ionEnabled = true;
SerializeListener listener(serialized);
UniqueChars error;
UniqueCharsVector warnings;
UniqueLinkData linkData;
SharedModule module =
CompileBuffer(*compileArgs, bytecode, &error, &warnings, &linkData);
CompileBuffer(*compileArgs, bytecode, &error, &warnings, &listener);
if (!module) {
fprintf(stderr, "Compilation error: %s\n", error ? error.get() : "oom");
return false;
}
MOZ_ASSERT(module->code().hasTier(Tier::Serialized));
size_t serializedSize = module->serializedSize(*linkData);
if (!serialized->resize(serializedSize)) {
return false;
}
module->serialize(*linkData, serialized->begin(), serialized->length());
return true;
MOZ_ASSERT(listener.called);
return !listener.serialized->empty();
}
bool wasm::DeserializeModule(JSContext* cx, const Bytes& serialized,

View File

@ -3520,7 +3520,7 @@ void SVGTextFrame::ReflowSVG() {
// Due to rounding issues when we have a transform applied, we sometimes
// don't include an additional row of pixels. For now, just inflate our
// covered region.
mRect.Inflate(presContext->AppUnitsPerDevPixel() / mLastContextScale);
mRect.Inflate(ceil(presContext->AppUnitsPerDevPixel() / mLastContextScale));
}
if (mState & NS_FRAME_FIRST_REFLOW) {