зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-inbound to mozilla-central a=merge
This commit is contained in:
Коммит
4f3bc4dba8
|
@ -237,7 +237,13 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIFile> clientExe;
|
||||
GetClientExecutableName(aClientTid, getter_AddRefs(clientExe));
|
||||
if (!GetClientExecutableName(aClientTid, getter_AddRefs(clientExe))) {
|
||||
#if defined(MOZ_TELEMETRY_REPORTING)
|
||||
AccumulateTelemetry(NS_LITERAL_STRING("(Failed to retrieve client image name)"));
|
||||
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||
// We should return true as a failsafe
|
||||
return true;
|
||||
}
|
||||
|
||||
// Blocklist checks should go here. return false if we should not instantiate.
|
||||
/*
|
||||
|
@ -340,8 +346,10 @@ LazyInstantiator::AccumulateTelemetry(const nsString& aValue)
|
|||
Telemetry::ScalarSet(Telemetry::ScalarID::A11Y_INSTANTIATORS, aValue);
|
||||
}
|
||||
|
||||
mTelemetryThread->Shutdown();
|
||||
mTelemetryThread = nullptr;
|
||||
if (mTelemetryThread) {
|
||||
mTelemetryThread->Shutdown();
|
||||
mTelemetryThread = nullptr;
|
||||
}
|
||||
}
|
||||
#endif // defined(MOZ_TELEMETRY_REPORTING)
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ add_task(async function test_manifest_commands() {
|
|||
});
|
||||
|
||||
let expectedError = (
|
||||
String.raw`commands.toggle-feature.suggested_key.default: Value must either: ` +
|
||||
String.raw`commands.toggle-feature.suggested_key.default: Value "Shifty+Y" must either: ` +
|
||||
String.raw`match the pattern /^\s*(Alt|Ctrl|Command|MacCtrl)\s*\+\s*(Shift\s*\+\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\s*$/, ` +
|
||||
String.raw`match the pattern /^\s*((Alt|Ctrl|Command|MacCtrl)\s*\+\s*)?(Shift\s*\+\s*)?(F[1-9]|F1[0-2])\s*$/, or ` +
|
||||
String.raw`match the pattern /^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$/`
|
||||
|
|
|
@ -389,6 +389,14 @@ HistoryListener.prototype = {
|
|||
// Cancel the load.
|
||||
return false;
|
||||
},
|
||||
|
||||
OnLengthChanged(aCount) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
|
||||
OnIndexChanged(aIndex) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -378,6 +378,14 @@ var SessionHistoryListener = {
|
|||
this.collect();
|
||||
},
|
||||
|
||||
OnLengthChanged(aCount) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
|
||||
OnIndexChanged(aIndex) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsISHistoryListener,
|
||||
Ci.nsISupportsWeakReference
|
||||
|
|
|
@ -51,6 +51,8 @@ gyp_vars.update({
|
|||
|
||||
'use_x11': 1 if CONFIG['MOZ_X11'] else 0,
|
||||
'use_glib': 1 if CONFIG['GLIB_LIBS'] else 0,
|
||||
# bug 1373485 - avoid pkg-config for gtk2 in webrtc
|
||||
'use_gtk': 0,
|
||||
|
||||
# turn off mandatory use of NEON and instead use NEON detection
|
||||
'arm_neon': 0,
|
||||
|
|
|
@ -367,6 +367,7 @@ private:
|
|||
MOZ_ASSERT(mActorDestroyed);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
bool
|
||||
IsOnOwningThread() const
|
||||
{
|
||||
|
@ -375,6 +376,7 @@ private:
|
|||
bool current;
|
||||
return NS_SUCCEEDED(mOwningEventTarget->IsOnCurrentThread(¤t)) && current;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
AssertIsOnOwningThread() const
|
||||
|
|
|
@ -517,26 +517,6 @@ class SameOriginCheckerImpl final : public nsIChannelEventSink,
|
|||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
};
|
||||
|
||||
class CharsetDetectionObserver final : public nsICharsetDetectionObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Notify(const char *aCharset, nsDetectionConfident aConf) override
|
||||
{
|
||||
mCharset = aCharset;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsACString& GetResult() const
|
||||
{
|
||||
return mCharset;
|
||||
}
|
||||
|
||||
private:
|
||||
nsCString mCharset;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
/**
|
||||
|
|
|
@ -300,7 +300,6 @@ typedef int32_t EntryId;
|
|||
|
||||
struct IdCount
|
||||
{
|
||||
IdCount() : mId(-1), mCount(0) { }
|
||||
explicit IdCount(int32_t aId) : mId(aId), mCount(1) { }
|
||||
int32_t mId;
|
||||
int32_t mCount;
|
||||
|
|
|
@ -416,7 +416,6 @@ RGBA4 : 0x8056,
|
|||
RGB5_A1 : 0x8057,
|
||||
RGB565 : 0x8D62,
|
||||
DEPTH_COMPONENT16 : 0x81A5,
|
||||
STENCIL_INDEX : 0x1901,
|
||||
STENCIL_INDEX8 : 0x8D48,
|
||||
DEPTH_STENCIL : 0x84F9,
|
||||
|
||||
|
@ -473,6 +472,7 @@ canvas : "implementation-dependent"
|
|||
// added in versions of the spec that are backward-compatible with
|
||||
// this version
|
||||
var ignoredProperties = [
|
||||
'STENCIL_INDEX'
|
||||
];
|
||||
|
||||
// Constants removed from the WebGL spec compared to ES 2.0
|
||||
|
|
|
@ -304,7 +304,6 @@ RGBA4 : 0x8056,
|
|||
RGB5_A1 : 0x8057,
|
||||
RGB565 : 0x8D62,
|
||||
DEPTH_COMPONENT16 : 0x81A5,
|
||||
STENCIL_INDEX : 0x1901,
|
||||
STENCIL_INDEX8 : 0x8D48,
|
||||
DEPTH_STENCIL : 0x84F9,
|
||||
RENDERBUFFER_WIDTH : 0x8D42,
|
||||
|
|
|
@ -412,7 +412,6 @@ RGBA4 : 0x8056,
|
|||
RGB5_A1 : 0x8057,
|
||||
RGB565 : 0x8D62,
|
||||
DEPTH_COMPONENT16 : 0x81A5,
|
||||
STENCIL_INDEX : 0x1901,
|
||||
STENCIL_INDEX8 : 0x8D48,
|
||||
DEPTH_STENCIL : 0x84F9,
|
||||
|
||||
|
@ -739,6 +738,7 @@ canvas : "implementation-dependent"
|
|||
// added in versions of the spec that are backward-compatible with
|
||||
// this version
|
||||
var ignoredProperties = [
|
||||
'STENCIL_INDEX'
|
||||
];
|
||||
|
||||
// Constants removed from the WebGL spec compared to ES 3.0
|
||||
|
|
|
@ -23,10 +23,6 @@ namespace {
|
|||
class ReleaseRunnable final : public Runnable
|
||||
{
|
||||
public:
|
||||
ReleaseRunnable()
|
||||
: Runnable("ReleaseRunnable")
|
||||
{}
|
||||
|
||||
static void
|
||||
MaybeReleaseOnMainThread(nsTArray<RefPtr<Promise>>& aPromises,
|
||||
nsTArray<RefPtr<GetFilesCallback>>& aCallbacks,
|
||||
|
@ -61,6 +57,7 @@ private:
|
|||
nsTArray<RefPtr<GetFilesCallback>>& aCallbacks,
|
||||
Sequence<RefPtr<File>>& aFiles,
|
||||
already_AddRefed<nsIGlobalObject> aGlobal)
|
||||
: Runnable("ReleaseRunnable")
|
||||
{
|
||||
mPromises.SwapElements(aPromises);
|
||||
mCallbacks.SwapElements(aCallbacks);
|
||||
|
|
|
@ -1365,11 +1365,6 @@ HTMLCanvasElement::OnVisibilityChange()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void Revoke()
|
||||
{
|
||||
mRenderer = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<AsyncCanvasRenderer> mRenderer;
|
||||
};
|
||||
|
@ -1407,11 +1402,6 @@ HTMLCanvasElement::OnMemoryPressure()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void Revoke()
|
||||
{
|
||||
mRenderer = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<AsyncCanvasRenderer> mRenderer;
|
||||
};
|
||||
|
|
|
@ -2712,15 +2712,8 @@ private:
|
|||
DoUpgradeInternal(mozIStorageConnection* aConnection,
|
||||
const nsACString& aOrigin);
|
||||
|
||||
UpgradeSchemaFrom17_0To18_0Helper()
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("Don't create instances of this class!");
|
||||
}
|
||||
|
||||
~UpgradeSchemaFrom17_0To18_0Helper()
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("Don't create instances of this class!");
|
||||
}
|
||||
UpgradeSchemaFrom17_0To18_0Helper() = delete;
|
||||
~UpgradeSchemaFrom17_0To18_0Helper() = delete;
|
||||
};
|
||||
|
||||
class UpgradeSchemaFrom17_0To18_0Helper::InsertIndexDataValuesFunction final
|
||||
|
@ -6454,12 +6447,6 @@ public:
|
|||
void
|
||||
Invalidate();
|
||||
|
||||
const PrincipalInfo&
|
||||
GetPrincipalInfo() const
|
||||
{
|
||||
return mPrincipalInfo;
|
||||
}
|
||||
|
||||
bool
|
||||
IsOwnedByProcess(ContentParentId aContentParentId) const
|
||||
{
|
||||
|
@ -6535,12 +6522,6 @@ public:
|
|||
return mFactory->GetLoggingInfo();
|
||||
}
|
||||
|
||||
void
|
||||
ReleaseTransactionThreadObjects();
|
||||
|
||||
void
|
||||
ReleaseBackgroundThreadObjects();
|
||||
|
||||
bool
|
||||
RegisterTransaction(TransactionBase* aTransaction);
|
||||
|
||||
|
@ -7700,12 +7681,6 @@ struct FactoryOp::MaybeBlockedDatabaseInfo final
|
|||
return mDatabase == aOther.mDatabase;
|
||||
}
|
||||
|
||||
bool
|
||||
operator<(const MaybeBlockedDatabaseInfo& aOther) const
|
||||
{
|
||||
return mDatabase < aOther.mDatabase;
|
||||
}
|
||||
|
||||
Database*
|
||||
operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN
|
||||
{
|
||||
|
@ -7743,12 +7718,6 @@ public:
|
|||
already_AddRefed<ContentParent> aContentParent,
|
||||
const CommonFactoryRequestParams& aParams);
|
||||
|
||||
bool
|
||||
IsOtherProcessActor() const
|
||||
{
|
||||
return mOptionalContentParentId.isSome();
|
||||
}
|
||||
|
||||
private:
|
||||
~OpenDatabaseOp() override
|
||||
{
|
||||
|
|
|
@ -309,12 +309,6 @@ public:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsLoadModuleOnStack()
|
||||
{
|
||||
return sIsLoadModuleOnStack;
|
||||
}
|
||||
|
||||
class MOZ_RAII NotifyLoadingModule
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -805,11 +805,13 @@ protected:
|
|||
MOZ_ASSERT(mActorDestroyed);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
State
|
||||
GetState() const
|
||||
{
|
||||
return mState;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
SetState(State aState)
|
||||
|
|
|
@ -72,12 +72,6 @@ public:
|
|||
MOZ_ASSERT(aProxy);
|
||||
}
|
||||
|
||||
Type
|
||||
GetType() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
|
||||
void
|
||||
ResolveOrReject();
|
||||
|
||||
|
|
|
@ -255,7 +255,6 @@ WebBrowserPersistLocalDocument::GetBaseURI() const
|
|||
return mDocument->GetBaseURI();
|
||||
}
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// Helper class for ReadResources().
|
||||
|
@ -295,10 +294,6 @@ private:
|
|||
const char* aNamespaceURI = "");
|
||||
nsresult OnWalkSubframe(nsIDOMNode* aNode);
|
||||
|
||||
bool IsFlagSet(uint32_t aFlag) const {
|
||||
return mParent->GetPersistFlags() & aFlag;
|
||||
}
|
||||
|
||||
~ResourceReader();
|
||||
|
||||
using IWBP = nsIWebBrowserPersist;
|
||||
|
|
|
@ -482,7 +482,6 @@ interface WebGLRenderingContextBase {
|
|||
const GLenum RGB5_A1 = 0x8057;
|
||||
const GLenum RGB565 = 0x8D62;
|
||||
const GLenum DEPTH_COMPONENT16 = 0x81A5;
|
||||
const GLenum STENCIL_INDEX = 0x1901;
|
||||
const GLenum STENCIL_INDEX8 = 0x8D48;
|
||||
const GLenum DEPTH_STENCIL = 0x84F9;
|
||||
|
||||
|
|
|
@ -242,12 +242,6 @@ struct ScriptLoadInfo
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ReadyToExecute()
|
||||
{
|
||||
return !mChannel && NS_SUCCEEDED(mLoadResult) && !mExecutionScheduled;
|
||||
}
|
||||
|
||||
nsString mURL;
|
||||
|
||||
// This full URL string is populated only if this object is used in a
|
||||
|
|
|
@ -198,12 +198,6 @@ public:
|
|||
return mBuffer;
|
||||
}
|
||||
|
||||
const nsString& URL() const
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
return mURL;
|
||||
}
|
||||
|
||||
private:
|
||||
~CompareCache()
|
||||
{
|
||||
|
|
|
@ -1545,44 +1545,6 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
class DummyRunnable final
|
||||
: public WorkerRunnable
|
||||
{
|
||||
public:
|
||||
explicit
|
||||
DummyRunnable(WorkerPrivate* aWorkerPrivate)
|
||||
: WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
|
||||
{
|
||||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
}
|
||||
|
||||
private:
|
||||
~DummyRunnable()
|
||||
{
|
||||
mWorkerPrivate->AssertIsOnWorkerThread();
|
||||
}
|
||||
|
||||
virtual bool
|
||||
PreDispatch(WorkerPrivate* aWorkerPrivate) override
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("Should never call Dispatch on this!");
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void
|
||||
PostDispatch(WorkerPrivate* aWorkerPrivate, bool aDispatchResult) override
|
||||
{
|
||||
MOZ_ASSERT_UNREACHABLE("Should never call Dispatch on this!");
|
||||
}
|
||||
|
||||
virtual bool
|
||||
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
|
||||
{
|
||||
// Do nothing.
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
PRThread*
|
||||
PRThreadFromThread(nsIThread* aThread)
|
||||
{
|
||||
|
|
|
@ -128,6 +128,7 @@ if CONFIG['GNU_CXX']:
|
|||
]
|
||||
if CONFIG['CLANG_CXX']:
|
||||
CXXFLAGS += [
|
||||
'-Wno-implicit-fallthrough',
|
||||
'-Wno-inconsistent-missing-override',
|
||||
'-Wno-unused-private-field',
|
||||
]
|
||||
|
|
|
@ -59,11 +59,6 @@ AsyncCanvasRenderer::NotifyElementAboutAttributesChanged()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void Revoke()
|
||||
{
|
||||
mRenderer = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<AsyncCanvasRenderer> mRenderer;
|
||||
};
|
||||
|
@ -94,11 +89,6 @@ AsyncCanvasRenderer::NotifyElementAboutInvalidation()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void Revoke()
|
||||
{
|
||||
mRenderer = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<AsyncCanvasRenderer> mRenderer;
|
||||
};
|
||||
|
|
|
@ -242,7 +242,11 @@ void
|
|||
LayerManagerComposite::PostProcessLayers(nsIntRegion& aOpaqueRegion)
|
||||
{
|
||||
LayerIntRegion visible;
|
||||
PostProcessLayers(mRoot, aOpaqueRegion, visible, Nothing());
|
||||
LayerComposite* rootComposite = static_cast<LayerComposite*>(mRoot->AsHostLayer());
|
||||
PostProcessLayers(mRoot, aOpaqueRegion, visible,
|
||||
ViewAs<RenderTargetPixel>(rootComposite->GetShadowClipRect(),
|
||||
PixelCastJustification::RenderTargetIsParentLayerForRoot),
|
||||
Nothing());
|
||||
}
|
||||
|
||||
// We want to skip directly through ContainerLayers that don't have an intermediate
|
||||
|
@ -251,8 +255,7 @@ LayerManagerComposite::PostProcessLayers(nsIntRegion& aOpaqueRegion)
|
|||
// effective transform.
|
||||
bool ShouldProcessLayer(Layer* aLayer)
|
||||
{
|
||||
if (!aLayer->GetParent() ||
|
||||
!aLayer->AsContainerLayer()) {
|
||||
if (!aLayer->AsContainerLayer()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -278,6 +281,7 @@ void
|
|||
LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
||||
nsIntRegion& aOpaqueRegion,
|
||||
LayerIntRegion& aVisibleRegion,
|
||||
const Maybe<RenderTargetIntRect>& aRenderTargetClip,
|
||||
const Maybe<ParentLayerIntRect>& aClipFromAncestors)
|
||||
{
|
||||
|
||||
|
@ -295,7 +299,9 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
if (aLayer->Extend3DContext()) {
|
||||
// If we're preserve-3d just pass the clip rect down directly, and we'll do the
|
||||
// conversion at the preserve-3d leaf Layer.
|
||||
insideClip = Some(ViewAs<LayerPixel>(*outsideClip, PixelCastJustification::MovingDownToChildren));
|
||||
if (outsideClip) {
|
||||
insideClip = Some(ViewAs<LayerPixel>(*outsideClip, PixelCastJustification::MovingDownToChildren));
|
||||
}
|
||||
} else if (outsideClip) {
|
||||
// Convert the combined clip into our pre-transform coordinate space, so
|
||||
// that it can later be intersected with our visible region.
|
||||
|
@ -322,15 +328,25 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
}
|
||||
|
||||
if (!ShouldProcessLayer(aLayer)) {
|
||||
MOZ_ASSERT(!aLayer->AsContainerLayer() || !aLayer->AsContainerLayer()->UseIntermediateSurface());
|
||||
MOZ_ASSERT(aLayer->AsContainerLayer() && !aLayer->AsContainerLayer()->UseIntermediateSurface());
|
||||
// For layers participating 3D rendering context, their visible
|
||||
// region should be empty (invisible), so we pass through them
|
||||
// without doing anything.
|
||||
for (Layer* child = aLayer->GetLastChild();
|
||||
child;
|
||||
child = child->GetPrevSibling()) {
|
||||
LayerComposite* childComposite = static_cast<LayerComposite*>(child->AsHostLayer());
|
||||
Maybe<RenderTargetIntRect> renderTargetClip = aRenderTargetClip;
|
||||
if (childComposite->GetShadowClipRect()) {
|
||||
RenderTargetIntRect clip = TransformBy(ViewAs<ParentLayerToRenderTargetMatrix4x4>(
|
||||
aLayer->GetEffectiveTransform(),
|
||||
PixelCastJustification::RenderTargetIsParentLayerForRoot),
|
||||
*childComposite->GetShadowClipRect());
|
||||
renderTargetClip = IntersectMaybeRects(renderTargetClip, Some(clip));
|
||||
}
|
||||
|
||||
PostProcessLayers(child, aOpaqueRegion, aVisibleRegion,
|
||||
ancestorClipForChildren);
|
||||
renderTargetClip, ancestorClipForChildren);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -364,7 +380,12 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
|
||||
bool hasPreserve3DChild = false;
|
||||
for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
|
||||
PostProcessLayers(child, localOpaque, descendantsVisibleRegion, ancestorClipForChildren);
|
||||
MOZ_ASSERT(aLayer->AsContainerLayer()->UseIntermediateSurface());
|
||||
LayerComposite* childComposite = static_cast<LayerComposite*>(child->AsHostLayer());
|
||||
PostProcessLayers(child, localOpaque, descendantsVisibleRegion,
|
||||
ViewAs<RenderTargetPixel>(childComposite->GetShadowClipRect(),
|
||||
PixelCastJustification::RenderTargetIsParentLayerForRoot),
|
||||
ancestorClipForChildren);
|
||||
if (child->Extend3DContext()) {
|
||||
hasPreserve3DChild = true;
|
||||
}
|
||||
|
@ -406,10 +427,10 @@ LayerManagerComposite::PostProcessLayers(Layer* aLayer,
|
|||
if (aLayer->IsOpaque()) {
|
||||
localOpaque.OrWith(composite->GetFullyRenderedRegion());
|
||||
}
|
||||
if (insideClip) {
|
||||
localOpaque.AndWith(insideClip->ToUnknownRect());
|
||||
}
|
||||
localOpaque.MoveBy(*integerTranslation);
|
||||
if (aRenderTargetClip) {
|
||||
localOpaque.AndWith(aRenderTargetClip->ToUnknownRect());
|
||||
}
|
||||
aOpaqueRegion.OrWith(localOpaque);
|
||||
}
|
||||
}
|
||||
|
@ -848,7 +869,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
|
|||
} else if (profiler_feature_active(ProfilerFeature::LayersDump)) {
|
||||
std::stringstream ss;
|
||||
Dump(ss);
|
||||
profiler_log(ss.str().c_str());
|
||||
profiler_tracing("log", ss.str().c_str());
|
||||
}
|
||||
|
||||
// Dump to LayerScope Viewer
|
||||
|
|
|
@ -328,11 +328,19 @@ public:
|
|||
* - Recomputes visible regions to account for async transforms.
|
||||
* Each layer accumulates into |aVisibleRegion| its post-transform
|
||||
* (including async transforms) visible region.
|
||||
*
|
||||
* - aRenderTargetClip is the exact clip required for aLayer, in the coordinates
|
||||
* of the nearest render target (the same as GetEffectiveTransform).
|
||||
*
|
||||
* - aClipFromAncestors is the approximate combined clip from all ancestors, in
|
||||
* the coordinate space of our parent, but maybe be an overestimate in the
|
||||
* presence of complex transforms.
|
||||
*/
|
||||
void PostProcessLayers(nsIntRegion& aOpaqueRegion);
|
||||
void PostProcessLayers(Layer* aLayer,
|
||||
nsIntRegion& aOpaqueRegion,
|
||||
LayerIntRegion& aVisibleRegion,
|
||||
const Maybe<RenderTargetIntRect>& aRenderTargetClip,
|
||||
const Maybe<ParentLayerIntRect>& aClipFromAncestors);
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,7 +61,7 @@ WebRenderDisplayItemLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
|
|||
}
|
||||
}
|
||||
|
||||
aBuilder.PushBuiltDisplayList(Move(mBuiltDisplayList));
|
||||
aBuilder.PushBuiltDisplayList(mBuiltDisplayList);
|
||||
WrBridge()->AddWebRenderParentCommands(mParentCommands);
|
||||
}
|
||||
|
||||
|
|
|
@ -689,8 +689,8 @@ private:
|
|||
DECL_GFX_PREF(Live, "webgl.allow-immediate-queries", WebGLImmediateQueries, bool, false);
|
||||
DECL_GFX_PREF(Live, "webgl.allow-fb-invalidation", WebGLFBInvalidation, bool, false);
|
||||
|
||||
DECL_GFX_PREF(Live, "webgl.max-perf-warnings", WebGLMaxPerfWarnings, int32_t, 0);
|
||||
DECL_GFX_PREF(Live, "webgl.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, int32_t, 0);
|
||||
DECL_GFX_PREF(Live, "webgl.perf.max-warnings", WebGLMaxPerfWarnings, int32_t, 0);
|
||||
DECL_GFX_PREF(Live, "webgl.perf.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, int32_t, 0);
|
||||
|
||||
DECL_GFX_PREF(Live, "webgl.webgl2-compat-mode", WebGL2CompatMode, bool, false);
|
||||
DECL_GFX_PREF(Live, "webrender.blob-images", WebRenderBlobImages, bool, false);
|
||||
|
|
|
@ -599,11 +599,11 @@ DisplayListBuilder::PopClip()
|
|||
}
|
||||
|
||||
void
|
||||
DisplayListBuilder::PushBuiltDisplayList(BuiltDisplayList dl)
|
||||
DisplayListBuilder::PushBuiltDisplayList(BuiltDisplayList &dl)
|
||||
{
|
||||
wr_dp_push_built_display_list(mWrState,
|
||||
dl.dl_desc,
|
||||
dl.dl.Extract());
|
||||
&dl.dl.inner);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -161,7 +161,7 @@ public:
|
|||
const WrImageMask* aMask);
|
||||
void PopClip();
|
||||
|
||||
void PushBuiltDisplayList(wr::BuiltDisplayList dl);
|
||||
void PushBuiltDisplayList(wr::BuiltDisplayList &dl);
|
||||
|
||||
void PushScrollLayer(const layers::FrameMetrics::ViewID& aScrollId,
|
||||
const WrRect& aContentRect, // TODO: We should work with strongly typed rects
|
||||
|
|
|
@ -1803,14 +1803,16 @@ pub unsafe extern "C" fn wr_api_finalize_builder(state: &mut WrState,
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wr_dp_push_built_display_list(state: &mut WrState,
|
||||
dl_descriptor: WrBuiltDisplayListDescriptor,
|
||||
dl_data: WrVecU8) {
|
||||
let dl_vec = dl_data.to_vec();
|
||||
pub extern "C" fn wr_dp_push_built_display_list(state: &mut WrState,
|
||||
dl_descriptor: WrBuiltDisplayListDescriptor,
|
||||
dl_data: &mut WrVecU8) {
|
||||
let dl_vec = mem::replace(dl_data, WrVecU8::from_vec(Vec::new())).to_vec();
|
||||
|
||||
let dl = BuiltDisplayList::from_data(dl_vec, dl_descriptor);
|
||||
|
||||
state.frame_builder.dl_builder.push_nested_display_list(&dl);
|
||||
let (data, _) = dl.into_data();
|
||||
mem::replace(dl_data, WrVecU8::from_vec(data));
|
||||
}
|
||||
|
||||
// TODO: nical
|
||||
|
|
|
@ -732,7 +732,7 @@ WR_FUNC;
|
|||
WR_INLINE
|
||||
void wr_dp_push_built_display_list(WrState *aState,
|
||||
WrBuiltDisplayListDescriptor aDlDescriptor,
|
||||
WrVecU8 aDlData)
|
||||
WrVecU8 *aDlData)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE
|
||||
|
|
|
@ -19,12 +19,10 @@
|
|||
|
||||
class nsIContent;
|
||||
|
||||
namespace {
|
||||
struct ScopedUNumberFormatTraits {
|
||||
typedef UNumberFormat* type;
|
||||
static type empty() { return nullptr; }
|
||||
static void release(type handle) { if (handle) unum_close(handle); }
|
||||
};
|
||||
struct ScopedUNumberFormatTraits {
|
||||
typedef UNumberFormat* type;
|
||||
static type empty() { return nullptr; }
|
||||
static void release(type handle) { if (handle) unum_close(handle); }
|
||||
};
|
||||
typedef mozilla::Scoped<ScopedUNumberFormatTraits> AutoCloseUNumberFormat;
|
||||
|
||||
|
@ -111,4 +109,3 @@ public:
|
|||
#endif /* MOZILLA_INTERNAL_API */
|
||||
|
||||
#endif /* mozilla_ICUUtils_h__ */
|
||||
|
||||
|
|
|
@ -28,16 +28,6 @@
|
|||
|
||||
namespace {
|
||||
|
||||
// Force the singleton used by Empty[W]String[16] to be a unique type. This
|
||||
// prevents other code that might accidentally use Singleton<string> from
|
||||
// getting our internal one.
|
||||
struct EmptyStrings {
|
||||
EmptyStrings() {}
|
||||
const std::string s;
|
||||
const std::wstring ws;
|
||||
const string16 s16;
|
||||
};
|
||||
|
||||
// Hack to convert any char-like type to its unsigned counterpart.
|
||||
// For example, it will convert char, signed char and unsigned char to unsigned
|
||||
// char.
|
||||
|
|
|
@ -397,41 +397,6 @@ BackgroundParentImpl::DeallocPCamerasParent(camera::PCamerasParent *aActor)
|
|||
return true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
class InitUDPSocketParentCallback final : public Runnable
|
||||
{
|
||||
public:
|
||||
InitUDPSocketParentCallback(UDPSocketParent* aActor,
|
||||
const nsACString& aFilter)
|
||||
: mActor(aActor)
|
||||
, mFilter(aFilter)
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
AssertIsOnBackgroundThread();
|
||||
}
|
||||
|
||||
NS_IMETHOD
|
||||
Run() override
|
||||
{
|
||||
AssertIsInMainProcess();
|
||||
|
||||
IPC::Principal principal;
|
||||
if (!mActor->Init(principal, mFilter)) {
|
||||
MOZ_CRASH("UDPSocketCallback - failed init");
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
~InitUDPSocketParentCallback() override = default;
|
||||
|
||||
RefPtr<UDPSocketParent> mActor;
|
||||
nsCString mFilter;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
auto
|
||||
BackgroundParentImpl::AllocPUDPSocketParent(const OptionalPrincipalInfo& /* unused */,
|
||||
const nsCString& /* unused */)
|
||||
|
|
|
@ -537,7 +537,8 @@ MessageChannel::MessageChannel(const char* aName,
|
|||
mNotifiedChannelDone(false),
|
||||
mFlags(REQUIRE_DEFAULT),
|
||||
mPeerPidSet(false),
|
||||
mPeerPid(-1)
|
||||
mPeerPid(-1),
|
||||
mIsPostponingSends(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(ipc::MessageChannel);
|
||||
|
||||
|
@ -901,10 +902,53 @@ MessageChannel::Send(Message* aMsg)
|
|||
ReportConnectionError("MessageChannel", msg);
|
||||
return false;
|
||||
}
|
||||
mLink->SendMessage(msg.forget());
|
||||
|
||||
SendMessageToLink(msg.forget());
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::SendMessageToLink(Message* aMsg)
|
||||
{
|
||||
if (mIsPostponingSends) {
|
||||
UniquePtr<Message> msg(aMsg);
|
||||
mPostponedSends.push_back(Move(msg));
|
||||
return;
|
||||
}
|
||||
mLink->SendMessage(aMsg);
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::BeginPostponingSends()
|
||||
{
|
||||
AssertWorkerThread();
|
||||
mMonitor->AssertNotCurrentThreadOwns();
|
||||
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
{
|
||||
MOZ_ASSERT(!mIsPostponingSends);
|
||||
mIsPostponingSends = true;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MessageChannel::StopPostponingSends()
|
||||
{
|
||||
// Note: this can be called from any thread.
|
||||
MonitorAutoLock lock(*mMonitor);
|
||||
|
||||
MOZ_ASSERT(mIsPostponingSends);
|
||||
|
||||
for (UniquePtr<Message>& iter : mPostponedSends) {
|
||||
mLink->SendMessage(iter.release());
|
||||
}
|
||||
|
||||
// We unset this after SendMessage so we can make correct thread
|
||||
// assertions in MessageLink.
|
||||
mIsPostponingSends = false;
|
||||
mPostponedSends.clear();
|
||||
}
|
||||
|
||||
already_AddRefed<MozPromiseRefcountable>
|
||||
MessageChannel::PopPromise(const Message& aMsg)
|
||||
{
|
||||
|
@ -1365,6 +1409,7 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
|
|||
msg->nested_level() < AwaitingSyncReplyNestedLevel())
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(DispatchingSyncMessage() || DispatchingAsyncMessage());
|
||||
MOZ_RELEASE_ASSERT(!mIsPostponingSends);
|
||||
IPC_LOG("Cancel from Send");
|
||||
CancelMessage *cancel = new CancelMessage(CurrentNestedInsideSyncTransaction());
|
||||
CancelTransaction(CurrentNestedInsideSyncTransaction());
|
||||
|
@ -1413,7 +1458,7 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
|
|||
// msg will be destroyed soon, but name() is not owned by msg.
|
||||
const char* msgName = msg->name();
|
||||
|
||||
mLink->SendMessage(msg.forget());
|
||||
SendMessageToLink(msg.forget());
|
||||
|
||||
while (true) {
|
||||
MOZ_RELEASE_ASSERT(!transact.IsCanceled());
|
||||
|
@ -1544,6 +1589,7 @@ MessageChannel::Call(Message* aMsg, Message* aReply)
|
|||
IPC_ASSERT(!DispatchingSyncMessage(),
|
||||
"violation of sync handler invariant");
|
||||
IPC_ASSERT(msg->is_interrupt(), "can only Call() Interrupt messages here");
|
||||
IPC_ASSERT(!mIsPostponingSends, "not postponing sends");
|
||||
|
||||
msg->set_seqno(NextSeqno());
|
||||
msg->set_interrupt_remote_stack_depth_guess(mRemoteStackDepthGuess);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <map>
|
||||
#include <math.h>
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
@ -254,6 +255,22 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
|
|||
bool IsInTransaction() const;
|
||||
void CancelCurrentTransaction();
|
||||
|
||||
// Force all calls to Send to defer actually sending messages. This will
|
||||
// cause sync messages to block until another thread calls
|
||||
// StopPostponingSends.
|
||||
//
|
||||
// This must be called from the worker thread.
|
||||
void BeginPostponingSends();
|
||||
|
||||
// Stop postponing sent messages, and immediately flush all postponed
|
||||
// messages to the link. This may be called from any thread.
|
||||
//
|
||||
// Note that there are no ordering guarantees between two different
|
||||
// MessageChannels. If channel B sends a message, then stops postponing
|
||||
// channel A, messages from A may arrive before B. The easiest way to order
|
||||
// this, if needed, is to make B send a sync message.
|
||||
void StopPostponingSends();
|
||||
|
||||
/**
|
||||
* This function is used by hang annotation code to determine which IPDL
|
||||
* actor is highest in the call stack at the time of the hang. It should
|
||||
|
@ -491,6 +508,10 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
|
|||
// depending on context.
|
||||
static bool IsAlwaysDeferred(const Message& aMsg);
|
||||
|
||||
// Helper for sending a message via the link. This should only be used for
|
||||
// non-special messages that might have to be postponed.
|
||||
void SendMessageToLink(Message* aMsg);
|
||||
|
||||
bool WasTransactionCanceled(int transaction);
|
||||
bool ShouldDeferMessage(const Message& aMsg);
|
||||
bool ShouldDeferInterruptMessage(const Message& aMsg, size_t aStackDepth);
|
||||
|
@ -797,6 +818,11 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
|
|||
RefPtr<CancelableRunnable> mOnChannelConnectedTask;
|
||||
bool mPeerPidSet;
|
||||
int32_t mPeerPid;
|
||||
|
||||
// Channels can enter messages are not sent immediately; instead, they are
|
||||
// held in a queue until another thread deems it is safe to send them.
|
||||
bool mIsPostponingSends;
|
||||
std::vector<UniquePtr<Message>> mPostponedSends;
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -149,7 +149,9 @@ ProcessLink::SendMessage(Message *msg)
|
|||
MOZ_CRASH("IPC message size is too large");
|
||||
}
|
||||
|
||||
mChan->AssertWorkerThread();
|
||||
if (!mChan->mIsPostponingSends) {
|
||||
mChan->AssertWorkerThread();
|
||||
}
|
||||
mChan->mMonitor->AssertCurrentThreadOwns();
|
||||
|
||||
mIOLoop->PostTask(NewNonOwningRunnableMethod<Message*>(mTransport, &Transport::Send, msg));
|
||||
|
@ -212,7 +214,9 @@ ThreadLink::EchoMessage(Message *msg)
|
|||
void
|
||||
ThreadLink::SendMessage(Message *msg)
|
||||
{
|
||||
mChan->AssertWorkerThread();
|
||||
if (!mChan->mIsPostponingSends) {
|
||||
mChan->AssertWorkerThread();
|
||||
}
|
||||
mChan->mMonitor->AssertCurrentThreadOwns();
|
||||
|
||||
if (mTargetChan)
|
||||
|
|
|
@ -229,6 +229,10 @@ description =
|
|||
description =
|
||||
[PTestUrgentHangs::Test5_1]
|
||||
description =
|
||||
[PTestLayoutThread::SyncMessage]
|
||||
description =
|
||||
[PTestPaintThread::FinishedPaint]
|
||||
description =
|
||||
|
||||
# A11y code
|
||||
[PDocAccessible::State]
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
include protocol PTestPaintThread;
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
// This is supposed to be analagous to PLayerTransaction.
|
||||
sync protocol PTestLayoutThread
|
||||
{
|
||||
parent:
|
||||
async FinishedLayout(uint64_t aTxnId);
|
||||
async AsyncMessage(uint64_t aTxnId);
|
||||
sync SyncMessage(uint64_t aTxnId);
|
||||
async EndTest();
|
||||
child:
|
||||
async StartTest(Endpoint<PTestPaintThreadChild> endpoint);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
} // namespace _ipdltest
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
// This is supposed to be analagous to PPaintingBridge.
|
||||
sync protocol PTestPaintThread
|
||||
{
|
||||
parent:
|
||||
sync FinishedPaint(uint64_t aTxnId);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
} // namespace _ipdltest
|
|
@ -0,0 +1,290 @@
|
|||
#include "TestOffMainThreadPainting.h"
|
||||
|
||||
#include "IPDLUnitTests.h" // fail etc.
|
||||
#include "mozilla/Unused.h"
|
||||
#include <prinrval.h>
|
||||
#include <prthread.h>
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
TestOffMainThreadPaintingParent::TestOffMainThreadPaintingParent()
|
||||
: mAsyncMessages(0),
|
||||
mSyncMessages(0)
|
||||
{
|
||||
}
|
||||
|
||||
TestOffMainThreadPaintingParent::~TestOffMainThreadPaintingParent()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingParent::Main()
|
||||
{
|
||||
ipc::Endpoint<PTestPaintThreadParent> parentPipe;
|
||||
ipc::Endpoint<PTestPaintThreadChild> childPipe;
|
||||
nsresult rv = PTestPaintThread::CreateEndpoints(
|
||||
base::GetCurrentProcId(),
|
||||
OtherPid(),
|
||||
&parentPipe,
|
||||
&childPipe);
|
||||
if (NS_FAILED(rv)) {
|
||||
fail("create pipes");
|
||||
}
|
||||
|
||||
mPaintActor = new TestPaintThreadParent(this);
|
||||
if (!mPaintActor->Bind(Move(parentPipe))) {
|
||||
fail("bind parent pipe");
|
||||
}
|
||||
|
||||
if (!SendStartTest(Move(childPipe))) {
|
||||
fail("sending Start");
|
||||
}
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestOffMainThreadPaintingParent::RecvFinishedLayout(const uint64_t& aTxnId)
|
||||
{
|
||||
if (!mPaintedTxn || mPaintedTxn.value() != aTxnId) {
|
||||
fail("received transaction before receiving paint");
|
||||
}
|
||||
mPaintedTxn = Nothing();
|
||||
mCompletedTxn = Some(aTxnId);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingParent::NotifyFinishedPaint(const uint64_t& aTxnId)
|
||||
{
|
||||
if (mCompletedTxn && mCompletedTxn.value() >= aTxnId) {
|
||||
fail("received paint after receiving transaction");
|
||||
}
|
||||
if (mPaintedTxn) {
|
||||
fail("painted again before completing previous transaction");
|
||||
}
|
||||
mPaintedTxn = Some(aTxnId);
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestOffMainThreadPaintingParent::RecvAsyncMessage(const uint64_t& aTxnId)
|
||||
{
|
||||
if (!mCompletedTxn || mCompletedTxn.value() != aTxnId) {
|
||||
fail("sync message received out of order");
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
mAsyncMessages++;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestOffMainThreadPaintingParent::RecvSyncMessage(const uint64_t& aTxnId)
|
||||
{
|
||||
if (!mCompletedTxn || mCompletedTxn.value() != aTxnId) {
|
||||
fail("sync message received out of order");
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
if (mSyncMessages >= mAsyncMessages) {
|
||||
fail("sync message received before async message");
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
mSyncMessages++;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestOffMainThreadPaintingParent::RecvEndTest()
|
||||
{
|
||||
if (!mCompletedTxn || mCompletedTxn.value() != 1) {
|
||||
fail("expected to complete a transaction");
|
||||
}
|
||||
if (mAsyncMessages != 1) {
|
||||
fail("expected to get 1 async message");
|
||||
}
|
||||
if (mSyncMessages != 1) {
|
||||
fail("expected to get 1 sync message");
|
||||
}
|
||||
|
||||
passed("ok");
|
||||
|
||||
mPaintActor->Close();
|
||||
Close();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
if (aWhy != NormalShutdown) {
|
||||
fail("child process aborted");
|
||||
}
|
||||
QuitParent();
|
||||
}
|
||||
|
||||
/**************************
|
||||
* PTestLayoutThreadChild *
|
||||
**************************/
|
||||
|
||||
TestOffMainThreadPaintingChild::TestOffMainThreadPaintingChild()
|
||||
: mNextTxnId(1)
|
||||
{
|
||||
}
|
||||
|
||||
TestOffMainThreadPaintingChild::~TestOffMainThreadPaintingChild()
|
||||
{
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestOffMainThreadPaintingChild::RecvStartTest(ipc::Endpoint<PTestPaintThreadChild>&& aEndpoint)
|
||||
{
|
||||
mPaintThread = MakeUnique<base::Thread>("PaintThread");
|
||||
if (!mPaintThread->Start()) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
||||
mPaintActor = new TestPaintThreadChild(GetIPCChannel());
|
||||
RefPtr<Runnable> task = NewRunnableMethod<ipc::Endpoint<PTestPaintThreadChild>&&>(
|
||||
"TestPaintthreadChild::Bind", mPaintActor, &TestPaintThreadChild::Bind, Move(aEndpoint));
|
||||
mPaintThread->message_loop()->PostTask(task.forget());
|
||||
|
||||
IssueTransaction();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
RefPtr<Runnable> task = NewRunnableMethod(
|
||||
"TestPaintThreadChild::Close", mPaintActor, &TestPaintThreadChild::Close);
|
||||
mPaintThread->message_loop()->PostTask(task.forget());
|
||||
mPaintThread = nullptr;
|
||||
|
||||
QuitChild();
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingChild::ProcessingError(Result aCode, const char* aReason)
|
||||
{
|
||||
MOZ_CRASH("Aborting child due to IPC error");
|
||||
}
|
||||
|
||||
void
|
||||
TestOffMainThreadPaintingChild::IssueTransaction()
|
||||
{
|
||||
GetIPCChannel()->BeginPostponingSends();
|
||||
|
||||
uint64_t txnId = mNextTxnId++;
|
||||
|
||||
// Start painting before we send the message.
|
||||
RefPtr<Runnable> task = NewRunnableMethod<uint64_t>(
|
||||
"TestPaintThreadChild::BeginPaintingForTxn", mPaintActor, &TestPaintThreadChild::BeginPaintingForTxn, txnId);
|
||||
mPaintThread->message_loop()->PostTask(task.forget());
|
||||
|
||||
// Simulate some gecko main thread stuff.
|
||||
SendFinishedLayout(txnId);
|
||||
SendAsyncMessage(txnId);
|
||||
SendSyncMessage(txnId);
|
||||
SendEndTest();
|
||||
}
|
||||
|
||||
/**************************
|
||||
* PTestPaintThreadParent *
|
||||
**************************/
|
||||
|
||||
TestPaintThreadParent::TestPaintThreadParent(TestOffMainThreadPaintingParent* aMainBridge)
|
||||
: mMainBridge(aMainBridge)
|
||||
{
|
||||
}
|
||||
|
||||
TestPaintThreadParent::~TestPaintThreadParent()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
TestPaintThreadParent::Bind(ipc::Endpoint<PTestPaintThreadParent>&& aEndpoint)
|
||||
{
|
||||
if (!aEndpoint.Bind(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AddRef();
|
||||
return true;
|
||||
}
|
||||
|
||||
ipc::IPCResult
|
||||
TestPaintThreadParent::RecvFinishedPaint(const uint64_t& aTxnId)
|
||||
{
|
||||
mMainBridge->NotifyFinishedPaint(aTxnId);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadParent::DeallocPTestPaintThreadParent()
|
||||
{
|
||||
Release();
|
||||
}
|
||||
|
||||
/*************************
|
||||
* PTestPaintThreadChild *
|
||||
*************************/
|
||||
|
||||
TestPaintThreadChild::TestPaintThreadChild(MessageChannel* aMainChannel)
|
||||
: mCanSend(false),
|
||||
mMainChannel(aMainChannel)
|
||||
{
|
||||
}
|
||||
|
||||
TestPaintThreadChild::~TestPaintThreadChild()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadChild::Bind(ipc::Endpoint<PTestPaintThreadChild>&& aEndpoint)
|
||||
{
|
||||
if (!aEndpoint.Bind(this)) {
|
||||
MOZ_CRASH("could not bind paint child endpoint");
|
||||
}
|
||||
AddRef();
|
||||
mCanSend = true;
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadChild::BeginPaintingForTxn(uint64_t aTxnId)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(!NS_IsMainThread());
|
||||
|
||||
// Sleep for some time to simulate painting being slow.
|
||||
PR_Sleep(PR_MillisecondsToInterval(500));
|
||||
SendFinishedPaint(aTxnId);
|
||||
|
||||
mMainChannel->StopPostponingSends();
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadChild::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
mCanSend = false;
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadChild::Close()
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(!NS_IsMainThread());
|
||||
|
||||
if (mCanSend) {
|
||||
PTestPaintThreadChild::Close();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TestPaintThreadChild::DeallocPTestPaintThreadChild()
|
||||
{
|
||||
Release();
|
||||
}
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
|
@ -0,0 +1,112 @@
|
|||
#ifndef mozilla__ipdltest_TestOffMainThreadPainting_h
|
||||
#define mozilla__ipdltest_TestOffMainThreadPainting_h
|
||||
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/_ipdltest/IPDLUnitTests.h"
|
||||
#include "mozilla/_ipdltest/PTestLayoutThreadChild.h"
|
||||
#include "mozilla/_ipdltest/PTestLayoutThreadParent.h"
|
||||
#include "mozilla/_ipdltest/PTestPaintThreadChild.h"
|
||||
#include "mozilla/_ipdltest/PTestPaintThreadParent.h"
|
||||
#include "base/thread.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
class TestPaintThreadChild;
|
||||
class TestPaintThreadParent;
|
||||
|
||||
// Analagous to LayerTransactionParent.
|
||||
class TestOffMainThreadPaintingParent final : public PTestLayoutThreadParent
|
||||
{
|
||||
public:
|
||||
static bool RunTestInThreads() { return false; }
|
||||
static bool RunTestInProcesses() { return true; }
|
||||
|
||||
void Main();
|
||||
|
||||
MOZ_IMPLICIT TestOffMainThreadPaintingParent();
|
||||
~TestOffMainThreadPaintingParent() override;
|
||||
|
||||
ipc::IPCResult RecvFinishedLayout(const uint64_t& aTxnId) override;
|
||||
ipc::IPCResult RecvAsyncMessage(const uint64_t& aTxnId) override;
|
||||
ipc::IPCResult RecvSyncMessage(const uint64_t& aTxnId) override;
|
||||
ipc::IPCResult RecvEndTest() override;
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
void NotifyFinishedPaint(const uint64_t& aTxnId);
|
||||
|
||||
private:
|
||||
RefPtr<TestPaintThreadParent> mPaintActor;
|
||||
Maybe<uint64_t> mCompletedTxn;
|
||||
Maybe<uint64_t> mPaintedTxn;
|
||||
uint32_t mAsyncMessages;
|
||||
uint32_t mSyncMessages;
|
||||
};
|
||||
|
||||
// Analagous to LayerTransactionChild.
|
||||
class TestOffMainThreadPaintingChild final : public PTestLayoutThreadChild
|
||||
{
|
||||
public:
|
||||
TestOffMainThreadPaintingChild();
|
||||
~TestOffMainThreadPaintingChild() override;
|
||||
|
||||
ipc::IPCResult RecvStartTest(ipc::Endpoint<PTestPaintThreadChild>&& aEndpoint) override;
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void ProcessingError(Result aCode, const char* aReason) override;
|
||||
|
||||
private:
|
||||
void IssueTransaction();
|
||||
|
||||
private:
|
||||
UniquePtr<base::Thread> mPaintThread;
|
||||
RefPtr<TestPaintThreadChild> mPaintActor;
|
||||
uint64_t mNextTxnId;
|
||||
};
|
||||
|
||||
/****************
|
||||
* Paint Actors *
|
||||
****************/
|
||||
|
||||
class TestPaintThreadParent final : public PTestPaintThreadParent
|
||||
{
|
||||
public:
|
||||
explicit TestPaintThreadParent(TestOffMainThreadPaintingParent* aMainBridge);
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestPaintThreadParent);
|
||||
|
||||
bool Bind(ipc::Endpoint<PTestPaintThreadParent>&& aEndpoint);
|
||||
ipc::IPCResult RecvFinishedPaint(const uint64_t& aTxnId) override;
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeallocPTestPaintThreadParent() override;
|
||||
|
||||
private:
|
||||
~TestPaintThreadParent() override;
|
||||
|
||||
private:
|
||||
TestOffMainThreadPaintingParent* mMainBridge;
|
||||
};
|
||||
|
||||
class TestPaintThreadChild final : public PTestPaintThreadChild
|
||||
{
|
||||
public:
|
||||
explicit TestPaintThreadChild(MessageChannel* aOtherChannel);
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestPaintThreadChild);
|
||||
|
||||
void Bind(ipc::Endpoint<PTestPaintThreadChild>&& aEndpoint);
|
||||
void BeginPaintingForTxn(uint64_t aTxnId);
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
void DeallocPTestPaintThreadChild() override;
|
||||
void Close();
|
||||
|
||||
private:
|
||||
~TestPaintThreadChild() override;
|
||||
|
||||
bool mCanSend;
|
||||
MessageChannel* mMainChannel;
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // ifndef mozilla__ipdltest_TestOffMainThreadPainting_h
|
|
@ -35,6 +35,7 @@ SOURCES += [
|
|||
'TestManyChildAllocs.cpp',
|
||||
'TestMultiMgrs.cpp',
|
||||
'TestNestedLoops.cpp',
|
||||
'TestOffMainThreadPainting.cpp',
|
||||
'TestRaceDeadlock.cpp',
|
||||
'TestRaceDeferral.cpp',
|
||||
'TestRacyInterruptReplies.cpp',
|
||||
|
@ -95,6 +96,7 @@ IPDL_SOURCES += [
|
|||
'PTestInterruptShutdownRace.ipdl',
|
||||
'PTestJSON.ipdl',
|
||||
'PTestLatency.ipdl',
|
||||
'PTestLayoutThread.ipdl',
|
||||
'PTestManyChildAllocs.ipdl',
|
||||
'PTestManyChildAllocsSub.ipdl',
|
||||
'PTestMultiMgrs.ipdl',
|
||||
|
@ -102,6 +104,7 @@ IPDL_SOURCES += [
|
|||
'PTestMultiMgrsLeft.ipdl',
|
||||
'PTestMultiMgrsRight.ipdl',
|
||||
'PTestNestedLoops.ipdl',
|
||||
'PTestPaintThread.ipdl',
|
||||
'PTestPriority.ipdl',
|
||||
'PTestRaceDeadlock.ipdl',
|
||||
'PTestRaceDeferral.ipdl',
|
||||
|
|
|
@ -1178,12 +1178,6 @@ class FunctionCompiler
|
|||
return numPushed;
|
||||
}
|
||||
|
||||
static MDefinition* peekPushedDef(MBasicBlock* block)
|
||||
{
|
||||
MOZ_ASSERT(hasPushed(block));
|
||||
return block->getSlot(block->stackDepth() - 1);
|
||||
}
|
||||
|
||||
public:
|
||||
void pushDef(MDefinition* def)
|
||||
{
|
||||
|
@ -1550,7 +1544,9 @@ class FunctionCompiler
|
|||
return iter_.lastOpcodeOffset();
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
bool done() const { return iter_.done(); }
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
private:
|
||||
|
|
|
@ -606,12 +606,6 @@ class WasmTokenStream
|
|||
return token.name();
|
||||
return AstName();
|
||||
}
|
||||
AstName getIfText() {
|
||||
WasmToken token;
|
||||
if (getIf(WasmToken::Text, &token))
|
||||
return token.text();
|
||||
return AstName();
|
||||
}
|
||||
bool getIfRef(AstRef* ref) {
|
||||
WasmToken token = peek();
|
||||
if (token.kind() == WasmToken::Name || token.kind() == WasmToken::Index)
|
||||
|
@ -1483,10 +1477,6 @@ struct WasmParseContext
|
|||
dtoaState(NewDtoaState())
|
||||
{}
|
||||
|
||||
bool fail(const char* message) {
|
||||
error->reset(js_strdup(message));
|
||||
return false;
|
||||
}
|
||||
~WasmParseContext() {
|
||||
DestroyDtoaState(dtoaState);
|
||||
}
|
||||
|
@ -3391,14 +3381,6 @@ class Resolver
|
|||
}
|
||||
return true;
|
||||
}
|
||||
bool resolveName(AstNameMap& map, AstName name, size_t* index) {
|
||||
AstNameMap::Ptr p = map.lookup(name);
|
||||
if (p) {
|
||||
*index = p->value();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool resolveRef(AstNameMap& map, AstRef& ref) {
|
||||
AstNameMap::Ptr p = map.lookup(ref.name());
|
||||
if (p) {
|
||||
|
@ -3447,7 +3429,6 @@ class Resolver
|
|||
|
||||
REGISTER(Sig, sigMap_)
|
||||
REGISTER(Func, funcMap_)
|
||||
REGISTER(Import, importMap_)
|
||||
REGISTER(Var, varMap_)
|
||||
REGISTER(Global, globalMap_)
|
||||
REGISTER(Table, tableMap_)
|
||||
|
@ -3473,7 +3454,6 @@ class Resolver
|
|||
|
||||
RESOLVE(sigMap_, Signature)
|
||||
RESOLVE(funcMap_, Function)
|
||||
RESOLVE(importMap_, Import)
|
||||
RESOLVE(varMap_, Local)
|
||||
RESOLVE(globalMap_, Global)
|
||||
RESOLVE(tableMap_, Table)
|
||||
|
|
|
@ -109,6 +109,13 @@ gfx::ScaleFactor<SourceUnits, NewTargetUnits> ViewTargetAs(
|
|||
PixelCastJustification) {
|
||||
return gfx::ScaleFactor<SourceUnits, NewTargetUnits>(aScaleFactor.scale);
|
||||
}
|
||||
template <class TargetUnits, class SourceUnits>
|
||||
Maybe<gfx::IntRectTyped<TargetUnits>> ViewAs(const Maybe<gfx::IntRectTyped<SourceUnits>>& aRect, PixelCastJustification aJustification) {
|
||||
if (aRect.isSome()) {
|
||||
return Some(ViewAs<TargetUnits>(aRect.value(), aJustification));
|
||||
}
|
||||
return Nothing();
|
||||
}
|
||||
// Unlike the other functions in this category, this function takes the
|
||||
// target matrix type, rather than its source and target unit types, as
|
||||
// the explicit template argument, so an example invocation is:
|
||||
|
|
|
@ -186,6 +186,7 @@ typedef gfx::Matrix4x4Typed<ScreenPixel, ParentLayerPixel> ScreenToParentLayerMa
|
|||
typedef gfx::Matrix4x4Typed<ParentLayerPixel, LayerPixel> ParentLayerToLayerMatrix4x4;
|
||||
typedef gfx::Matrix4x4Typed<ParentLayerPixel, ScreenPixel> ParentLayerToScreenMatrix4x4;
|
||||
typedef gfx::Matrix4x4Typed<ParentLayerPixel, ParentLayerPixel> ParentLayerToParentLayerMatrix4x4;
|
||||
typedef gfx::Matrix4x4Typed<ParentLayerPixel, RenderTargetPixel> ParentLayerToRenderTargetMatrix4x4;
|
||||
|
||||
/*
|
||||
* The pixels that content authors use to specify sizes in.
|
||||
|
|
|
@ -3662,7 +3662,7 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
|||
// Flush stream now to avoid reordering dump output relative to
|
||||
// messages dumped by PaintRoot below.
|
||||
if (profilerNeedsDisplayList && !consoleNeedsDisplayList) {
|
||||
profiler_log(ss->str().c_str());
|
||||
profiler_tracing("log", ss->str().c_str());
|
||||
} else {
|
||||
fprint_stderr(gfxUtils::sDumpPaintFile, *ss);
|
||||
}
|
||||
|
@ -3735,7 +3735,7 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
if (profilerNeedsDisplayList && !consoleNeedsDisplayList) {
|
||||
profiler_log(ss->str().c_str());
|
||||
profiler_tracing("log", ss->str().c_str());
|
||||
} else {
|
||||
fprint_stderr(gfxUtils::sDumpPaintFile, *ss);
|
||||
}
|
||||
|
|
|
@ -4127,8 +4127,10 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
|
|||
// We haven't computed visibility at this point, so item->GetVisibleRect()
|
||||
// is just the dirty rect that item was initialized with. We intersect it
|
||||
// with the clipped item bounds to get a tighter visible rect.
|
||||
itemVisibleRect = itemVisibleRect.Intersect(
|
||||
ScaleToOutsidePixels(item->GetVisibleRect(), false));
|
||||
if (!prerenderedTransform) {
|
||||
itemVisibleRect = itemVisibleRect.Intersect(
|
||||
ScaleToOutsidePixels(item->GetVisibleRect(), false));
|
||||
}
|
||||
|
||||
if (maxLayers != -1 && layerCount >= maxLayers) {
|
||||
forceInactive = true;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<div style="width:100px; height:200px; background-color:green"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<div style="width:100px; height:100px; background-color:green"></div>
|
||||
<div style="width:100px; height:100px; overflow:hidden">
|
||||
<div style="transform: translateY(-100px) perspective(1px); will-change:transform">
|
||||
<div style="background-color:red; width:100px; height:100px"></div>
|
||||
<div style="background-color:green; width:100px; height:100px"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -39,6 +39,7 @@ fuzzy-if(skiaContent,1,4) == matrix3d-1a.html matrix3d-1-ref.html
|
|||
fuzzy-if(winWidget&&!layersGPUAccelerated,1,251) == backface-visibility-2.html backface-visibility-2-ref.html
|
||||
fails-if(webrender) == backface-visibility-3.html backface-visibility-3-ref.html
|
||||
== perspective-clipping-1.html perspective-clipping-1-ref.html
|
||||
== perspective-clipping-2.html perspective-clipping-2-ref.html
|
||||
!= perspective-origin-1a.html rotatex-perspective-1a.html
|
||||
== perspective-origin-1b.html perspective-origin-1a.html
|
||||
fuzzy(3,99) random-if(Android&&!browserIsRemote) == perspective-origin-2a.html perspective-origin-2-ref.html # subpixel AA, bug 732568
|
||||
|
|
|
@ -504,101 +504,6 @@ protected:
|
|||
nsIPrincipal* aSheetPrincipal);
|
||||
void ReleaseScanner(void);
|
||||
|
||||
/**
|
||||
* This is a RAII class which behaves like an "AutoRestore<>" for our parser
|
||||
* input state. When instantiated, this class saves the current parser input
|
||||
* state (in a CSSParserInputState object), and it restores the parser to
|
||||
* that state when destructed, unless "DoNotRestore()" has been called.
|
||||
*/
|
||||
class MOZ_RAII nsAutoCSSParserInputStateRestorer {
|
||||
public:
|
||||
explicit nsAutoCSSParserInputStateRestorer(CSSParserImpl* aParser
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: mParser(aParser),
|
||||
mShouldRestore(true)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
mParser->SaveInputState(mSavedState);
|
||||
}
|
||||
|
||||
void DoNotRestore()
|
||||
{
|
||||
mShouldRestore = false;
|
||||
}
|
||||
|
||||
~nsAutoCSSParserInputStateRestorer()
|
||||
{
|
||||
if (mShouldRestore) {
|
||||
mParser->RestoreSavedInputState(mSavedState);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
CSSParserImpl* mParser;
|
||||
CSSParserInputState mSavedState;
|
||||
bool mShouldRestore;
|
||||
};
|
||||
|
||||
/**
|
||||
* This is a RAII class which creates a temporary nsCSSScanner for the given
|
||||
* string, and reconfigures aParser to use *that* scanner instead of its
|
||||
* existing scanner, until we go out of scope. (This allows us to rewrite
|
||||
* a portion of a stylesheet using a temporary string, and switch to parsing
|
||||
* that rewritten section, and then resume parsing the original stylesheet.)
|
||||
*
|
||||
* aParser must have a non-null nsCSSScanner (which we'll be temporarily
|
||||
* replacing) and ErrorReporter (which this class will co-opt for the
|
||||
* temporary parser). While we're in scope, we also suppress error reporting,
|
||||
* so it doesn't really matter which reporter we use. We suppress reporting
|
||||
* because this class is only used with CSS that is synthesized & didn't
|
||||
* come directly from an author, and it would be confusing if we reported
|
||||
* syntax errors for CSS that an author didn't provide.
|
||||
*
|
||||
* XXXdholbert we could also change this & report errors, if needed. Might
|
||||
* want to customize the error reporting somehow though.
|
||||
*/
|
||||
class MOZ_RAII nsAutoScannerChanger {
|
||||
public:
|
||||
nsAutoScannerChanger(CSSParserImpl* aParser,
|
||||
const nsAString& aStringToScan
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: mParser(aParser),
|
||||
mOriginalScanner(aParser->mScanner),
|
||||
mStringScanner(aStringToScan, 0),
|
||||
mParserStateRestorer(aParser),
|
||||
mErrorSuppresser(aParser)
|
||||
{
|
||||
MOZ_ASSERT(mOriginalScanner,
|
||||
"Shouldn't use nsAutoScannerChanger unless we already "
|
||||
"have a scanner");
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
||||
// Set & setup the new scanner:
|
||||
mParser->mScanner = &mStringScanner;
|
||||
mStringScanner.SetErrorReporter(mParser->mReporter);
|
||||
|
||||
// We might've had push-back on our original scanner (and if we did,
|
||||
// that fact is saved via mParserStateRestorer). But we don't have
|
||||
// push-back in mStringScanner, so clear that flag.
|
||||
mParser->mHavePushBack = false;
|
||||
}
|
||||
|
||||
~nsAutoScannerChanger()
|
||||
{
|
||||
// Restore original scanner. All other cleanup is done by RAII members.
|
||||
mParser->mScanner = mOriginalScanner;
|
||||
}
|
||||
|
||||
private:
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
CSSParserImpl* mParser;
|
||||
nsCSSScanner *mOriginalScanner;
|
||||
nsCSSScanner mStringScanner;
|
||||
nsAutoCSSParserInputStateRestorer mParserStateRestorer;
|
||||
nsAutoSuppressErrors mErrorSuppresser;
|
||||
};
|
||||
|
||||
/**
|
||||
* Saves the current input state, which includes any currently pushed
|
||||
* back token, and the current position of the scanner.
|
||||
|
@ -1234,21 +1139,6 @@ protected:
|
|||
MOZ_ASSERT(result != CSSParseResult::Error);
|
||||
return result == CSSParseResult::Ok;
|
||||
}
|
||||
bool ParseSingleTokenVariantWithRestrictions(
|
||||
nsCSSValue& aValue,
|
||||
int32_t aVariantMask,
|
||||
const KTableEntry aKeywordTable[],
|
||||
uint32_t aRestrictions)
|
||||
{
|
||||
MOZ_ASSERT(!(aVariantMask & VARIANT_MULTIPLE_TOKENS),
|
||||
"use ParseVariantWithRestrictions for variants in "
|
||||
"VARIANT_MULTIPLE_TOKENS");
|
||||
CSSParseResult result =
|
||||
ParseVariantWithRestrictions(aValue, aVariantMask, aKeywordTable,
|
||||
aRestrictions);
|
||||
MOZ_ASSERT(result != CSSParseResult::Error);
|
||||
return result == CSSParseResult::Ok;
|
||||
}
|
||||
bool ParseSingleTokenNonNegativeVariant(nsCSSValue& aValue,
|
||||
int32_t aVariantMask,
|
||||
const KTableEntry aKeywordTable[])
|
||||
|
|
|
@ -350,10 +350,6 @@ class SchedulableTrickleCandidate {
|
|||
return candidate_;
|
||||
}
|
||||
|
||||
size_t Stream() const {
|
||||
return stream_;
|
||||
}
|
||||
|
||||
bool IsHost() const {
|
||||
return candidate_.find("typ host") != std::string::npos;
|
||||
}
|
||||
|
@ -407,7 +403,6 @@ class IceTestPeer : public sigslot::has_slots<> {
|
|||
expected_local_transport_(kNrIceTransportUdp),
|
||||
expected_remote_type_(NrIceCandidate::ICE_HOST),
|
||||
trickle_mode_(TRICKLE_NONE),
|
||||
trickled_(0),
|
||||
simulate_ice_lite_(false),
|
||||
nat_(new TestNat),
|
||||
test_utils_(utils) {
|
||||
|
@ -1070,7 +1065,6 @@ class IceTestPeer : public sigslot::has_slots<> {
|
|||
ASSERT_GT(ctx->GetStreamCount(), i);
|
||||
nsresult res = ctx->GetStream(i)->ParseTrickleCandidate(candidate);
|
||||
ASSERT_TRUE(NS_SUCCEEDED(res));
|
||||
++trickled_;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1391,8 +1385,6 @@ class IceTestPeer : public sigslot::has_slots<> {
|
|||
NS_DISPATCH_SYNC);
|
||||
}
|
||||
|
||||
int trickled() { return trickled_; }
|
||||
|
||||
void SetControlling(NrIceCtx::Controlling controlling) {
|
||||
nsresult res;
|
||||
test_utils_->sts_target()->Dispatch(
|
||||
|
@ -1466,7 +1458,6 @@ class IceTestPeer : public sigslot::has_slots<> {
|
|||
NrIceCandidate::Type expected_remote_type_;
|
||||
std::string expected_remote_addr_;
|
||||
TrickleMode trickle_mode_;
|
||||
int trickled_;
|
||||
bool simulate_ice_lite_;
|
||||
RefPtr<mozilla::TestNat> nat_;
|
||||
MtransportTestUtils* test_utils_;
|
||||
|
@ -1864,12 +1855,6 @@ class WebRtcIceConnectTest : public StunTest {
|
|||
p2_->SetExpectedTypes(local, remote, transport);
|
||||
}
|
||||
|
||||
void SetExpectedTypes(NrIceCandidate::Type local1, NrIceCandidate::Type remote1,
|
||||
NrIceCandidate::Type local2, NrIceCandidate::Type remote2) {
|
||||
p1_->SetExpectedTypes(local1, remote1);
|
||||
p2_->SetExpectedTypes(local2, remote2);
|
||||
}
|
||||
|
||||
void SetExpectedRemoteCandidateAddr(const std::string& addr) {
|
||||
p1_->SetExpectedRemoteCandidateAddr(addr);
|
||||
p2_->SetExpectedRemoteCandidateAddr(addr);
|
||||
|
|
|
@ -914,11 +914,6 @@ class TransportTest : public MtransportTest {
|
|||
ASSERT_EQ_WAIT(s2, p2_->state(), 10000);
|
||||
}
|
||||
|
||||
void InitIce() {
|
||||
p1_->InitIce();
|
||||
p2_->InitIce();
|
||||
}
|
||||
|
||||
void ConnectIce() {
|
||||
p1_->InitIce();
|
||||
p2_->InitIce();
|
||||
|
|
|
@ -178,12 +178,12 @@ public:
|
|||
MOZ_ASSERT(NS_IsMainThread());
|
||||
}
|
||||
}
|
||||
operator JSErrorResult &() { return *mRv; }
|
||||
operator ErrorResult &() { return *mRv; }
|
||||
private:
|
||||
mozilla::UniquePtr<JSErrorResult> mRv;
|
||||
bool isCopy;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
static nsresult InitNSSInContent()
|
||||
|
|
|
@ -563,6 +563,8 @@ if CONFIG['OS_TARGET'] in ['Darwin', 'Linux', 'WINNT']:
|
|||
'-Wno-inconsistent-missing-override',
|
||||
'-Wno-overloaded-virtual',
|
||||
]
|
||||
if CONFIG['CLANG_CXX']:
|
||||
CXXFLAGS += ['-Wno-comma']
|
||||
|
||||
if CONFIG['_MSC_VER']:
|
||||
# This is intended as a temporary workaround to enable warning free building
|
||||
|
|
|
@ -157,11 +157,16 @@ TestCustomAccessor()
|
|||
|
||||
listTwo.pushBack(&one);
|
||||
listTwo.pushBack(&two);
|
||||
{ unsigned int check[] { 1, 2 }; CheckListValues(listOne, check); }
|
||||
{ unsigned int check[] { 1, 2 }; CheckListValues(listTwo, check); }
|
||||
|
||||
(void)listTwo.popBack();
|
||||
{ unsigned int check[] { 1, 2 }; CheckListValues(listOne, check); }
|
||||
{ unsigned int check[] { 1 }; CheckListValues(listTwo, check); }
|
||||
|
||||
(void)listOne.popBack();
|
||||
{ unsigned int check[] { 1 }; CheckListValues(listOne, check); }
|
||||
{ unsigned int check[] { 1 }; CheckListValues(listTwo, check); }
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -27,6 +27,13 @@ public class GeckoActivityMonitor implements Application.ActivityLifecycleCallba
|
|||
|
||||
private GeckoActivityMonitor() { }
|
||||
|
||||
private void updateActivity(final Activity activity) {
|
||||
if (currentActivity.get() == null) {
|
||||
appContext.onApplicationForeground();
|
||||
}
|
||||
currentActivity = new WeakReference<>(activity);
|
||||
}
|
||||
|
||||
public Activity getCurrentActivity() {
|
||||
return currentActivity.get();
|
||||
}
|
||||
|
@ -47,23 +54,23 @@ public class GeckoActivityMonitor implements Application.ActivityLifecycleCallba
|
|||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
if (currentActivity.get() == null) {
|
||||
appContext.onApplicationForeground();
|
||||
}
|
||||
currentActivity = new WeakReference<>(activity);
|
||||
updateActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) { }
|
||||
public void onActivityResumed(Activity activity) {
|
||||
updateActivity(activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) { }
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
// onStop for the previous activity is called after onStart for the new activity, so if
|
||||
// we're switching activities within our app, currentActivity should already refer to the
|
||||
// next activity at this point.
|
||||
// onStop for the previous activity is called after onStart/onResume for
|
||||
// the new/resumed activity, so if we're switching activities within our
|
||||
// app, mCurrentActivity should already refer to the next activity at
|
||||
// this point.
|
||||
// If it doesn't, it means we've been backgrounded.
|
||||
if (currentActivity.get() == activity) {
|
||||
currentActivity.clear();
|
||||
|
|
|
@ -337,7 +337,7 @@ public final class IntentHelper implements BundleEventListener {
|
|||
}
|
||||
|
||||
final Uri data = intent.getData();
|
||||
if (data != null && "file".equals(data.normalizeScheme().getScheme())) {
|
||||
if (data != null && "file".equals(normalizeUriScheme(data).getScheme())) {
|
||||
Log.w(LOGTAG, "Blocked intent with \"file://\" data scheme.");
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -4588,6 +4588,14 @@ Tab.prototype = {
|
|||
Services.obs.notifyObservers(this.browser, "Content:HistoryChange");
|
||||
},
|
||||
|
||||
OnLengthChanged: function(aCount) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
|
||||
OnIndexChanged: function(aIndex) {
|
||||
// Ignore, the method is implemented so that XPConnect doesn't throw!
|
||||
},
|
||||
|
||||
UpdateMediaPlaybackRelatedObserver: function(active) {
|
||||
// Media control is only used for the tab which has playing media, so we
|
||||
// only need to register observer after having the active media. And the
|
||||
|
|
|
@ -4624,8 +4624,8 @@ pref("webgl.disable-DOM-blit-uploads", false);
|
|||
pref("webgl.allow-fb-invalidation", false);
|
||||
pref("webgl.webgl2-compat-mode", false);
|
||||
|
||||
pref("webgl.max-perf-warnings", 0);
|
||||
pref("webgl.max-acceptable-fb-status-invals", 0);
|
||||
pref("webgl.perf.max-warnings", 0);
|
||||
pref("webgl.perf.max-acceptable-fb-status-invals", 0);
|
||||
|
||||
pref("webgl.enable-webgl2", true);
|
||||
|
||||
|
|
|
@ -28,14 +28,17 @@ using namespace mozilla;
|
|||
//
|
||||
// Once the event is found, it is dispatched to the main thread to notify
|
||||
// any window where window.crypto.enableSmartCardEvents is true.
|
||||
// Additionally, all observers of the topics "smartcard-insert" and
|
||||
// "smartcard-remove" are notified by the observer service of the appropriate
|
||||
// Additionally, all observers of the topics |kSmartcardInsert| and
|
||||
// |kSmartcardRemove| are notified by the observer service of the appropriate
|
||||
// event.
|
||||
//
|
||||
|
||||
#define kSmartcardInsert "smartcard-insert"
|
||||
#define kSmartcardRemove "smartcard-remove"
|
||||
|
||||
class nsTokenEventRunnable : public nsIRunnable {
|
||||
public:
|
||||
nsTokenEventRunnable(const nsAString& aType, const nsAString& aTokenName)
|
||||
nsTokenEventRunnable(const char* aType, const nsAString& aTokenName)
|
||||
: mType(aType)
|
||||
, mTokenName(aTokenName)
|
||||
{
|
||||
|
@ -47,7 +50,7 @@ public:
|
|||
private:
|
||||
virtual ~nsTokenEventRunnable() {}
|
||||
|
||||
nsString mType;
|
||||
const char* mType;
|
||||
nsString mTokenName;
|
||||
};
|
||||
|
||||
|
@ -63,11 +66,7 @@ nsTokenEventRunnable::Run()
|
|||
if (!observerService) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
// This conversion is safe because mType can only be "smartcard-insert"
|
||||
// or "smartcard-remove".
|
||||
NS_ConvertUTF16toUTF8 eventTypeUTF8(mType);
|
||||
return observerService->NotifyObservers(nullptr, eventTypeUTF8.get(),
|
||||
mTokenName.get());
|
||||
return observerService->NotifyObservers(nullptr, mType, mTokenName.get());
|
||||
}
|
||||
|
||||
// self linking and removing double linked entry
|
||||
|
@ -299,7 +298,7 @@ SmartCardMonitoringThread::GetTokenSeries(CK_SLOT_ID slotid)
|
|||
// helper function to pass the event off to nsNSSComponent.
|
||||
//
|
||||
void
|
||||
SmartCardMonitoringThread::SendEvent(const nsAString& eventType,
|
||||
SmartCardMonitoringThread::SendEvent(const char* eventType,
|
||||
const char* tokenName)
|
||||
{
|
||||
// The token name should be UTF8, but it's not clear that this is enforced
|
||||
|
@ -360,12 +359,12 @@ void SmartCardMonitoringThread::Execute()
|
|||
// event for the previous token, do so now...
|
||||
tokenName = GetTokenName(slotID);
|
||||
if (tokenName) {
|
||||
SendEvent(NS_LITERAL_STRING("smartcard-remove"), tokenName);
|
||||
SendEvent(kSmartcardRemove, tokenName);
|
||||
}
|
||||
tokenName = PK11_GetTokenName(slot.get());
|
||||
// save the token name and series
|
||||
SetTokenName(slotID, tokenName, series);
|
||||
SendEvent(NS_LITERAL_STRING("smartcard-insert"), tokenName);
|
||||
SendEvent(kSmartcardInsert, tokenName);
|
||||
}
|
||||
} else {
|
||||
// retrieve token name
|
||||
|
@ -374,7 +373,7 @@ void SmartCardMonitoringThread::Execute()
|
|||
// if there's not a token name, then the software isn't expecting
|
||||
// a (or another) remove event.
|
||||
if (tokenName) {
|
||||
SendEvent(NS_LITERAL_STRING("smartcard-remove"), tokenName);
|
||||
SendEvent(kSmartcardRemove, tokenName);
|
||||
// clear the token name (after we send it)
|
||||
SetTokenName(slotID, nullptr, 0);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class SmartCardMonitoringThread
|
|||
void SetTokenName(CK_SLOT_ID slotid, const char* tokenName, uint32_t series);
|
||||
const char* GetTokenName(CK_SLOT_ID slotid);
|
||||
uint32_t GetTokenSeries(CK_SLOT_ID slotid);
|
||||
void SendEvent(const nsAString& type, const char* tokenName);
|
||||
void SendEvent(const char* type, const char* tokenName);
|
||||
|
||||
SECMODModule* mModule;
|
||||
PLHashTable* mHash;
|
||||
|
|
|
@ -503,6 +503,7 @@ mochitest:
|
|||
android.*: 20
|
||||
macosx.*: 5
|
||||
windows.*: 5
|
||||
linux32/debug: 16
|
||||
linux.*: 10
|
||||
e10s:
|
||||
by-test-platform:
|
||||
|
|
|
@ -1003,6 +1003,7 @@ class TestInfoCommand(MachCommandBase):
|
|||
# This function attempts to find appropriate names for different
|
||||
# queries based on the specified test name.
|
||||
|
||||
import posixpath
|
||||
import re
|
||||
|
||||
# full_test_name is full path to file in hg (or git)
|
||||
|
@ -1023,6 +1024,7 @@ class TestInfoCommand(MachCommandBase):
|
|||
for line in out:
|
||||
print(line)
|
||||
if self.full_test_name:
|
||||
self.full_test_name.replace(os.sep, posixpath.sep)
|
||||
print("Found %s in source control." % self.full_test_name)
|
||||
else:
|
||||
print("Unable to validate test name '%s'!" % self.test_name)
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
<script language="javascript" type="text/javascript">
|
||||
|
||||
async function painted() {
|
||||
window.removeEventListener("MozAfterPaint", painted, true);
|
||||
|
||||
await TalosContentProfiler.pause();
|
||||
await TalosContentProfiler.initFromURLQueryParams(location.search);
|
||||
await TalosContentProfiler.finishStartupProfiling();
|
||||
|
||||
window.removeEventListener("MozAfterPaint", painted, true);
|
||||
|
||||
let startupInfo = await TalosPowersContent.getStartupInfo();
|
||||
|
||||
let startupTime = startupInfo['firstPaint'] - startupInfo['process'];
|
||||
|
|
|
@ -1179,7 +1179,12 @@ class ChoiceType extends Type {
|
|||
let n = choices.length - 1;
|
||||
choices[n] = `or ${choices[n]}`;
|
||||
|
||||
let message = `Value must either: ${choices.join(", ")}`;
|
||||
let message;
|
||||
if (typeof value === "object") {
|
||||
message = `Value must either: ${choices.join(", ")}`;
|
||||
} else {
|
||||
message = `Value ${JSON.stringify(value)} must either: ${choices.join(", ")}`;
|
||||
}
|
||||
|
||||
return context.error(message, null);
|
||||
}
|
||||
|
@ -1719,7 +1724,7 @@ class ArrayType extends Type {
|
|||
static parseSchema(schema, path, extraProperties = []) {
|
||||
this.checkSchemaProperties(schema, path, extraProperties);
|
||||
|
||||
let items = Schemas.parseSchema(schema.items, path);
|
||||
let items = Schemas.parseSchema(schema.items, path, ["onError"]);
|
||||
|
||||
return new this(schema, items, schema.minItems || 0, schema.maxItems || Infinity);
|
||||
}
|
||||
|
@ -1729,6 +1734,7 @@ class ArrayType extends Type {
|
|||
this.itemType = itemType;
|
||||
this.minItems = minItems;
|
||||
this.maxItems = maxItems;
|
||||
this.onError = schema.items.onError || null;
|
||||
}
|
||||
|
||||
normalize(value, context) {
|
||||
|
@ -1742,7 +1748,12 @@ class ArrayType extends Type {
|
|||
for (let [i, element] of value.entries()) {
|
||||
element = context.withPath(String(i), () => this.itemType.normalize(element, context));
|
||||
if (element.error) {
|
||||
return element;
|
||||
if (this.onError == "warn") {
|
||||
context.logError(element.error);
|
||||
} else if (this.onError != "ignore") {
|
||||
return element;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
result.push(element.value);
|
||||
}
|
||||
|
|
|
@ -168,13 +168,8 @@
|
|||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"choices": [
|
||||
{ "$ref": "Permission" },
|
||||
{
|
||||
"type": "string",
|
||||
"deprecated": "Unknown permission ${value}"
|
||||
}
|
||||
]
|
||||
"$ref": "Permission",
|
||||
"onError": "warn"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
|
|
|
@ -50,7 +50,7 @@ add_task(async function testUnknownProperties() {
|
|||
});
|
||||
|
||||
let messages = [
|
||||
{message: /processing permissions\.0: Unknown permission "unknownPermission"/},
|
||||
{message: /processing permissions\.0: Value "unknownPermission"/},
|
||||
{message: /processing unknown_property: An unexpected property was found in the WebExtension manifest/},
|
||||
];
|
||||
|
||||
|
|
|
@ -1091,7 +1091,7 @@ add_task(async function testChoices() {
|
|||
talliedErrors.length = 0;
|
||||
|
||||
Assert.throws(() => root.choices.meh("frog"),
|
||||
/Value must either: be one of \["foo", "bar", "baz"\], match the pattern \/florg\.\*meh\/, or be an integer value/);
|
||||
/Value "frog" must either: be one of \["foo", "bar", "baz"\], match the pattern \/florg\.\*meh\/, or be an integer value/);
|
||||
|
||||
Assert.throws(() => root.choices.meh(4),
|
||||
/be a string value, or be at least 12/);
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
add_task(async function test_unknown_permissions() {
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
permissions: [
|
||||
"activeTab",
|
||||
"fooUnknownPermission",
|
||||
"http://*/",
|
||||
"chrome://favicon/",
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
let {messages} = await promiseConsoleOutput(
|
||||
() => extension.startup());
|
||||
|
||||
const {WebExtensionPolicy} = Cu.import("resource://gre/modules/Extension.jsm", {});
|
||||
|
||||
let policy = WebExtensionPolicy.getByID(extension.id);
|
||||
Assert.deepEqual(Array.from(policy.permissions).sort(), ["activeTab", "http://*/*"]);
|
||||
|
||||
ok(messages.some(message => /Error processing permissions\.1: Value "fooUnknownPermission" must/.test(message)),
|
||||
'Got expected error for "fooUnknownPermission"');
|
||||
|
||||
ok(messages.some(message => /Error processing permissions\.3: Value "chrome:\/\/favicon\/" must/.test(message)),
|
||||
'Got expected error for "chrome://favicon/"');
|
||||
|
||||
await extension.unload();
|
||||
});
|
|
@ -88,6 +88,7 @@ skip-if = os == "android"
|
|||
[test_ext_themes_supported_properties.js]
|
||||
[test_ext_topSites.js]
|
||||
skip-if = os == "android"
|
||||
[test_ext_unknown_permissions.js]
|
||||
[test_ext_legacy_extension_context.js]
|
||||
[test_ext_legacy_extension_embedding.js]
|
||||
[test_locale_converter.js]
|
||||
|
|
|
@ -95,10 +95,7 @@ struct MOZ_NON_TEMPORARY_CLASS ScopedArrayBufferContents: public Scoped<ScopedAr
|
|||
explicit ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM):
|
||||
Scoped<ScopedArrayBufferContentsTraits>(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)
|
||||
{ }
|
||||
explicit ScopedArrayBufferContents(const ArrayBufferContents& v
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM):
|
||||
Scoped<ScopedArrayBufferContentsTraits>(v MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
|
||||
{ }
|
||||
|
||||
ScopedArrayBufferContents& operator=(ArrayBufferContents ptr) {
|
||||
Scoped<ScopedArrayBufferContentsTraits>::operator=(ptr);
|
||||
return *this;
|
||||
|
@ -918,4 +915,3 @@ NativeOSFileInternalsService::Read(const nsAString& aPath,
|
|||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -122,9 +122,12 @@ if CONFIG['GNU_CXX']:
|
|||
CXXFLAGS += [
|
||||
'-Wno-return-type',
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-unused-function',
|
||||
'-Wno-unused-local-typedef',
|
||||
]
|
||||
if CONFIG['CLANG_CXX']:
|
||||
CXXFLAGS += [
|
||||
'-Wno-comma',
|
||||
'-Wno-null-conversion',
|
||||
]
|
||||
elif CONFIG['_MSC_VER']:
|
||||
|
|
|
@ -916,6 +916,12 @@ nsFormFillController::HandleEvent(nsIDOMEvent* aEvent)
|
|||
return KeyPress(aEvent);
|
||||
case eEditorInput:
|
||||
{
|
||||
nsCOMPtr<nsINode> input = do_QueryInterface(
|
||||
aEvent->InternalDOMEvent()->GetTarget());
|
||||
if (!IsTextControl(input)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool unused = false;
|
||||
return (!mSuppressOnInput && mController && mFocusedInput) ?
|
||||
mController->HandleText(&unused) : NS_OK;
|
||||
|
@ -996,6 +1002,14 @@ nsFormFillController::RemoveForDocument(nsIDocument* aDoc)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsFormFillController::IsTextControl(nsINode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aNode);
|
||||
return formControl &&
|
||||
formControl->IsSingleLineTextControl(false);
|
||||
}
|
||||
|
||||
void
|
||||
nsFormFillController::MaybeStartControllingInput(nsIDOMHTMLInputElement* aInput)
|
||||
{
|
||||
|
@ -1004,8 +1018,7 @@ nsFormFillController::MaybeStartControllingInput(nsIDOMHTMLInputElement* aInput)
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aInput);
|
||||
if (!formControl || !formControl->IsSingleLineTextControl(false)) {
|
||||
if (!IsTextControl(inputNode)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1022,6 +1035,8 @@ nsFormFillController::MaybeStartControllingInput(nsIDOMHTMLInputElement* aInput)
|
|||
bool hasList = datalist != nullptr;
|
||||
|
||||
bool isPwmgrInput = false;
|
||||
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aInput);
|
||||
MOZ_ASSERT(formControl, "If we have a text control, we have a form control!");
|
||||
if (mPwmgrInputs.Get(inputNode) ||
|
||||
formControl->ControlType() == NS_FORM_INPUT_PASSWORD) {
|
||||
isPwmgrInput = true;
|
||||
|
@ -1385,11 +1400,6 @@ nsFormFillController::StopControllingInput()
|
|||
if (mFocusedInputNode) {
|
||||
MaybeRemoveMutationObserver(mFocusedInputNode);
|
||||
|
||||
auto formAutoComplete = GetFormAutoComplete();
|
||||
if (formAutoComplete) {
|
||||
formAutoComplete->StopControllingInput(mFocusedInput);
|
||||
}
|
||||
|
||||
mFocusedInputNode = nullptr;
|
||||
mFocusedInput = nullptr;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,8 @@ protected:
|
|||
void RemoveForDocument(nsIDocument* aDoc);
|
||||
bool IsEventTrusted(nsIDOMEvent *aEvent);
|
||||
|
||||
bool IsTextControl(nsINode* aNode);
|
||||
|
||||
// members //////////////////////////////////////////
|
||||
|
||||
nsCOMPtr<nsIAutoCompleteController> mController;
|
||||
|
|
|
@ -26,11 +26,6 @@ interface nsIFormAutoComplete: nsISupports {
|
|||
* to cancel an existing search, for example, in preparation for a new search.
|
||||
*/
|
||||
void stopAutoCompleteSearch();
|
||||
|
||||
/**
|
||||
* Since the controller is disconnecting, any related data must be cleared.
|
||||
*/
|
||||
void stopControllingInput(in nsIDOMHTMLInputElement aField);
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(604419ab-55a0-4831-9eca-1b9e67cc4751)]
|
||||
|
|
|
@ -115,11 +115,6 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
|
|||
printf("Finished running %s tests.\n", mTestName);
|
||||
}
|
||||
|
||||
bool failed()
|
||||
{
|
||||
return mServMgr == nullptr;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIFile> GetProfileDirectory()
|
||||
{
|
||||
if (mProfD) {
|
||||
|
|
|
@ -78,13 +78,13 @@ TracingMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
|
|||
{
|
||||
StreamCommonProps("tracing", aWriter, aProcessStartTime, aUniqueStacks);
|
||||
|
||||
if (GetCategory()) {
|
||||
aWriter.StringProperty("category", GetCategory());
|
||||
if (mCategory) {
|
||||
aWriter.StringProperty("category", mCategory);
|
||||
}
|
||||
|
||||
if (GetKind() == TRACING_INTERVAL_START) {
|
||||
if (mKind == TRACING_INTERVAL_START) {
|
||||
aWriter.StringProperty("interval", "start");
|
||||
} else if (GetKind() == TRACING_INTERVAL_END) {
|
||||
} else if (mKind == TRACING_INTERVAL_END) {
|
||||
aWriter.StringProperty("interval", "end");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2126,6 +2126,9 @@ profiler_init(void* aStackTop)
|
|||
PrintUsageThenExit(0); // terminates execution
|
||||
}
|
||||
|
||||
int entries = PROFILER_DEFAULT_ENTRIES;
|
||||
double interval = PROFILER_DEFAULT_INTERVAL;
|
||||
|
||||
{
|
||||
PSAutoLock lock(gPSMutex);
|
||||
|
||||
|
@ -2163,7 +2166,6 @@ profiler_init(void* aStackTop)
|
|||
|
||||
LOG("- MOZ_PROFILER_STARTUP is set");
|
||||
|
||||
int entries = PROFILER_DEFAULT_ENTRIES;
|
||||
const char* startupEntries = getenv("MOZ_PROFILER_STARTUP_ENTRIES");
|
||||
if (startupEntries) {
|
||||
errno = 0;
|
||||
|
@ -2175,7 +2177,6 @@ profiler_init(void* aStackTop)
|
|||
}
|
||||
}
|
||||
|
||||
double interval = PROFILER_DEFAULT_INTERVAL;
|
||||
const char* startupInterval = getenv("MOZ_PROFILER_STARTUP_INTERVAL");
|
||||
if (startupInterval) {
|
||||
errno = 0;
|
||||
|
@ -2193,8 +2194,8 @@ profiler_init(void* aStackTop)
|
|||
|
||||
// We do this with gPSMutex unlocked. The comment in profiler_stop() explains
|
||||
// why.
|
||||
NotifyProfilerStarted(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
|
||||
features, filters, MOZ_ARRAY_LENGTH(filters));
|
||||
NotifyProfilerStarted(entries, interval, features, filters,
|
||||
MOZ_ARRAY_LENGTH(filters));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2827,7 +2828,8 @@ profiler_get_backtrace()
|
|||
regs.Clear();
|
||||
#endif
|
||||
|
||||
auto buffer = MakeUnique<ProfileBuffer>(PROFILER_GET_BACKTRACE_ENTRIES);
|
||||
// 1000 should be plenty for a single backtrace.
|
||||
auto buffer = MakeUnique<ProfileBuffer>(1000);
|
||||
|
||||
DoSyncSample(lock, *info, now, regs, buffer.get());
|
||||
|
||||
|
@ -2978,12 +2980,6 @@ profiler_tracing(const char* aCategory, const char* aMarkerName,
|
|||
racy_profiler_add_marker(aMarkerName, Move(payload));
|
||||
}
|
||||
|
||||
void
|
||||
profiler_log(const char* aStr)
|
||||
{
|
||||
profiler_tracing("log", aStr);
|
||||
}
|
||||
|
||||
PseudoStack*
|
||||
profiler_get_pseudo_stack()
|
||||
{
|
||||
|
|
|
@ -405,8 +405,6 @@ PROFILER_FUNC_VOID(profiler_js_interrupt_callback())
|
|||
// whether the profiler is active or inactive.
|
||||
PROFILER_FUNC(double profiler_time(), 0)
|
||||
|
||||
PROFILER_FUNC_VOID(profiler_log(const char* aStr))
|
||||
|
||||
PROFILER_FUNC(int profiler_current_thread_id(), 0)
|
||||
|
||||
// This method suspends the thread identified by aThreadId, optionally samples
|
||||
|
@ -455,10 +453,6 @@ void profiler_add_marker(const char* aMarkerName,
|
|||
# define PROFILER_DEFAULT_ENTRIES 100000
|
||||
#endif
|
||||
|
||||
// In the case of profiler_get_backtrace we know that we only need enough space
|
||||
// for a single backtrace.
|
||||
#define PROFILER_GET_BACKTRACE_ENTRIES 1000
|
||||
|
||||
#define PROFILER_DEFAULT_INTERVAL 1
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -71,9 +71,6 @@ public:
|
|||
TracingMarkerPayload(const char* aCategory, TracingKind aKind,
|
||||
UniqueProfilerBacktrace aCause);
|
||||
|
||||
const char *GetCategory() const { return mCategory; }
|
||||
TracingKind GetKind() const { return mKind; }
|
||||
|
||||
virtual void StreamPayload(SpliceableJSONWriter& aWriter,
|
||||
const mozilla::TimeStamp& aProcessStartTime,
|
||||
UniqueStacks& aUniqueStacks) override;
|
||||
|
|
|
@ -376,8 +376,6 @@ TEST(GeckoProfiler, Markers)
|
|||
|
||||
{
|
||||
AutoProfilerTracing tracing("C", "A");
|
||||
|
||||
profiler_log("X"); // Just a specialized form of profiler_tracing().
|
||||
}
|
||||
|
||||
profiler_add_marker("M1");
|
||||
|
|
|
@ -37,6 +37,7 @@ FileDescriptorToHandle(int aFd)
|
|||
using namespace mozilla;
|
||||
|
||||
namespace {
|
||||
|
||||
struct DebugFilesAutoLockTraits
|
||||
{
|
||||
typedef PRLock* type;
|
||||
|
@ -49,7 +50,6 @@ class DebugFilesAutoLock : public Scoped<DebugFilesAutoLockTraits>
|
|||
{
|
||||
static PRLock* Lock;
|
||||
public:
|
||||
static void Clear();
|
||||
static PRLock* getDebugFileIDsLock()
|
||||
{
|
||||
// On windows this static is not thread safe, but we know that the first
|
||||
|
@ -75,12 +75,6 @@ public:
|
|||
};
|
||||
|
||||
PRLock* DebugFilesAutoLock::Lock;
|
||||
void
|
||||
DebugFilesAutoLock::Clear()
|
||||
{
|
||||
MOZ_ASSERT(Lock != nullptr);
|
||||
Lock = nullptr;
|
||||
}
|
||||
|
||||
// The ChunkedList<T> class implements, at the high level, a non-iterable
|
||||
// list of instances of T. Its goal is to be somehow minimalist for the
|
||||
|
@ -208,7 +202,6 @@ getDebugFileIDs()
|
|||
return DebugFileIDs;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace mozilla {
|
||||
|
|
Загрузка…
Ссылка в новой задаче