mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 851611 - Part 2: Update profiler calls. r=jrmuizel
--HG-- extra : rebase_source : 3032aaf7e50cdf9c350da688ec34e50a695fc7ca
This commit is contained in:
parent
77998a9630
commit
c4c6a0ddf5
@ -410,7 +410,7 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
||||
{
|
||||
NS_ENSURE_STATE(mURIToLoad && mOwnerContent && mOwnerContent->IsInDoc());
|
||||
|
||||
SAMPLE_LABEL("nsFrameLoader", "ReallyStartLoading");
|
||||
PROFILER_LABEL("nsFrameLoader", "ReallyStartLoading");
|
||||
|
||||
nsresult rv = MaybeCreateDocShell();
|
||||
if (NS_FAILED(rv)) {
|
||||
@ -2024,7 +2024,7 @@ nsFrameLoader::TryRemoteBrowser()
|
||||
return false;
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("nsFrameLoader", "CreateRemoteBrowser");
|
||||
PROFILER_LABEL("nsFrameLoader", "CreateRemoteBrowser");
|
||||
|
||||
MutableTabContext context;
|
||||
nsCOMPtr<mozIApplication> ownApp = GetOwnApp();
|
||||
|
@ -822,7 +822,7 @@ NS_IMETHODIMP
|
||||
nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
|
||||
nsISupports *aContext)
|
||||
{
|
||||
SAMPLE_LABEL("nsObjectLoadingContent", "OnStartRequest");
|
||||
PROFILER_LABEL("nsObjectLoadingContent", "OnStartRequest");
|
||||
|
||||
LOG(("OBJLC [%p]: Channel OnStartRequest", this));
|
||||
|
||||
|
@ -1855,7 +1855,7 @@ nsXMLHttpRequest::OnDataAvailable(nsIRequest *request,
|
||||
NS_IMETHODIMP
|
||||
nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
{
|
||||
SAMPLE_LABEL("nsXMLHttpRequest", "OnStartRequest");
|
||||
PROFILER_LABEL("nsXMLHttpRequest", "OnStartRequest");
|
||||
nsresult rv = NS_OK;
|
||||
if (!mFirstStartRequestSeen && mRequestObserver) {
|
||||
mFirstStartRequestSeen = true;
|
||||
@ -2041,7 +2041,7 @@ nsXMLHttpRequest::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
NS_IMETHODIMP
|
||||
nsXMLHttpRequest::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status)
|
||||
{
|
||||
SAMPLE_LABEL("content", "nsXMLHttpRequest::OnStopRequest");
|
||||
PROFILER_LABEL("content", "nsXMLHttpRequest::OnStopRequest");
|
||||
if (request != mChannel) {
|
||||
// Can this still happen?
|
||||
return NS_OK;
|
||||
|
@ -429,7 +429,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
||||
nsDispatchingCallback* aCallback,
|
||||
nsCOMArray<nsIDOMEventTarget>* aTargets)
|
||||
{
|
||||
SAMPLE_LABEL("nsEventDispatcher", "Dispatch");
|
||||
PROFILER_LABEL("nsEventDispatcher", "Dispatch");
|
||||
NS_ASSERTION(aEvent, "Trying to dispatch without nsEvent!");
|
||||
NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
|
||||
NS_ERROR_ILLEGAL_VALUE);
|
||||
|
@ -3932,7 +3932,7 @@ nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, uint32_t aMessage,
|
||||
return mPresContext->GetPrimaryFrameFor(content);
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("Input", "DispatchMouseEvent");
|
||||
PROFILER_LABEL("Input", "DispatchMouseEvent");
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsMouseEvent event(aEvent->mFlags.mIsTrusted, aMessage, aEvent->widget,
|
||||
nsMouseEvent::eReal);
|
||||
|
@ -185,7 +185,7 @@ nsGenericHTMLFrameElement::BindToTree(nsIDocument* aDocument,
|
||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||
"Missing a script blocker!");
|
||||
|
||||
SAMPLE_LABEL("nsGenericHTMLFrameElement", "BindToTree");
|
||||
PROFILER_LABEL("nsGenericHTMLFrameElement", "BindToTree");
|
||||
|
||||
// We're in a document now. Kick off the frame load.
|
||||
LoadSrc();
|
||||
|
@ -73,7 +73,7 @@ private:
|
||||
NS_IMETHODIMP
|
||||
PluginStreamListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt)
|
||||
{
|
||||
SAMPLE_LABEL("PluginStreamListener", "OnStartRequest");
|
||||
PROFILER_LABEL("PluginStreamListener", "OnStartRequest");
|
||||
|
||||
nsCOMPtr<nsIContent> embed = mPluginDoc->GetPluginContent();
|
||||
nsCOMPtr<nsIObjectLoadingContent> objlc = do_QueryInterface(embed);
|
||||
|
@ -579,7 +579,7 @@ nsDOMWindowUtils::SendMouseEventToWindow(const nsAString& aType,
|
||||
float aPressure,
|
||||
unsigned short aInputSourceArg)
|
||||
{
|
||||
SAMPLE_LABEL("nsDOMWindowUtils", "SendMouseEventToWindow");
|
||||
PROFILER_LABEL("nsDOMWindowUtils", "SendMouseEventToWindow");
|
||||
return SendMouseEventCommon(aType, aX, aY, aButton, aClickCount, aModifiers,
|
||||
aIgnoreRootScrollFrame, aPressure,
|
||||
aInputSourceArg, true, nullptr);
|
||||
@ -1139,7 +1139,7 @@ NS_IMETHODIMP
|
||||
nsDOMWindowUtils::GarbageCollect(nsICycleCollectorListener *aListener,
|
||||
int32_t aExtraForgetSkippableCalls)
|
||||
{
|
||||
SAMPLE_LABEL("GC", "GarbageCollect");
|
||||
PROFILER_LABEL("GC", "GarbageCollect");
|
||||
// Always permit this in debug builds.
|
||||
#ifndef DEBUG
|
||||
if (!nsContentUtils::IsCallerChrome()) {
|
||||
|
@ -1252,7 +1252,7 @@ nsJSContext::EvaluateString(const nsAString& aScript,
|
||||
bool aCoerceToString,
|
||||
JS::Value* aRetValue)
|
||||
{
|
||||
SAMPLE_LABEL("JS", "EvaluateString");
|
||||
PROFILER_LABEL("JS", "EvaluateString");
|
||||
MOZ_ASSERT_IF(aOptions.versionSet, aOptions.version != JSVERSION_UNKNOWN);
|
||||
MOZ_ASSERT_IF(aCoerceToString, aRetValue);
|
||||
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||
@ -1341,7 +1341,7 @@ nsJSContext::CompileScript(const PRUnichar* aText,
|
||||
nsScriptObjectHolder<JSScript>& aScriptObject,
|
||||
bool aSaveSource /* = false */)
|
||||
{
|
||||
SAMPLE_LABEL_PRINTF("JS", "Compile Script", "%s", aURL ? aURL : "");
|
||||
PROFILER_LABEL_PRINTF("JS", "Compile Script", "%s", aURL ? aURL : "");
|
||||
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aPrincipal);
|
||||
@ -1502,7 +1502,7 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, JSObject* aScope,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("JS", "CallEventHandler");
|
||||
PROFILER_LABEL("JS", "CallEventHandler");
|
||||
|
||||
nsAutoMicroTask mt;
|
||||
xpc_UnmarkGrayObject(aScope);
|
||||
@ -2559,7 +2559,7 @@ nsJSContext::GarbageCollectNow(JS::gcreason::Reason aReason,
|
||||
IsShrinking aShrinking,
|
||||
int64_t aSliceMillis)
|
||||
{
|
||||
SAMPLE_LABEL("GC", "GarbageCollectNow");
|
||||
PROFILER_LABEL("GC", "GarbageCollectNow");
|
||||
|
||||
MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC);
|
||||
|
||||
@ -2626,7 +2626,7 @@ nsJSContext::GarbageCollectNow(JS::gcreason::Reason aReason,
|
||||
void
|
||||
nsJSContext::ShrinkGCBuffersNow()
|
||||
{
|
||||
SAMPLE_LABEL("GC", "ShrinkGCBuffersNow");
|
||||
PROFILER_LABEL("GC", "ShrinkGCBuffersNow");
|
||||
|
||||
KillShrinkGCBuffersTimer();
|
||||
|
||||
@ -2740,7 +2740,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
||||
return;
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("CC", "CycleCollectNow");
|
||||
PROFILER_LABEL("CC", "CycleCollectNow");
|
||||
|
||||
PRTime start = PR_Now();
|
||||
|
||||
|
@ -443,7 +443,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
|
||||
nsISupports* aContext)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
SAMPLE_LABEL("nsPluginStreamListenerPeer", "OnStartRequest");
|
||||
PROFILER_LABEL("nsPluginStreamListenerPeer", "OnStartRequest");
|
||||
|
||||
if (mRequests.IndexOfObject(GetBaseRequest(request)) == -1) {
|
||||
NS_ASSERTION(mRequests.Count() == 0,
|
||||
|
@ -860,7 +860,7 @@ PluginModuleParent::NPP_NewStream(NPP instance, NPMIMEType type,
|
||||
NPStream* stream, NPBool seekable,
|
||||
uint16_t* stype)
|
||||
{
|
||||
SAMPLE_LABEL("PluginModuleParent", "NPP_NewStream");
|
||||
PROFILER_LABEL("PluginModuleParent", "NPP_NewStream");
|
||||
PluginInstanceParent* i = InstCast(instance);
|
||||
if (!i)
|
||||
return NPERR_GENERIC_ERROR;
|
||||
|
@ -142,7 +142,7 @@ StorageChild::GetKey(bool aCallerSecure, uint32_t aIndex, nsAString& aKey)
|
||||
nsIDOMStorageItem*
|
||||
StorageChild::GetValue(bool aCallerSecure, const nsAString& aKey, nsresult* rv)
|
||||
{
|
||||
SAMPLE_LABEL("StorageChild", "GetValue");
|
||||
PROFILER_LABEL("StorageChild", "GetValue");
|
||||
nsresult rv2 = *rv = NS_OK;
|
||||
StorageItem storageItem;
|
||||
SendGetValue(aCallerSecure, mSessionOnly, nsString(aKey), &storageItem, &rv2);
|
||||
|
@ -860,7 +860,7 @@ nsDOMStoragePersistentDB::GetKeyValue(DOMStorageImpl* aStorage,
|
||||
bool* aSecure)
|
||||
{
|
||||
Telemetry::AutoTimer<Telemetry::LOCALDOMSTORAGE_GETVALUE_MS> timer;
|
||||
SAMPLE_LABEL("nsDOMStoragePersistentDB", "GetKeyValue");
|
||||
PROFILER_LABEL("nsDOMStoragePersistentDB", "GetKeyValue");
|
||||
|
||||
nsresult rv = EnsureScopeLoaded(aStorage);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -162,7 +162,7 @@ public:
|
||||
|
||||
bool SwapBuffers()
|
||||
{
|
||||
SAMPLE_LABEL("GLContext", "SwapBuffers");
|
||||
PROFILER_LABEL("GLContext", "SwapBuffers");
|
||||
[mContext flushBuffer];
|
||||
return true;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ ThebesLayerBuffer::DrawBufferWithRotation(gfxContext* aTarget, float aOpacity,
|
||||
gfxASurface* aMask,
|
||||
const gfxMatrix* aMaskTransform)
|
||||
{
|
||||
SAMPLE_LABEL("ThebesLayerBuffer", "DrawBufferWithRotation");
|
||||
PROFILER_LABEL("ThebesLayerBuffer", "DrawBufferWithRotation");
|
||||
// Draw four quadrants. We could use REPEAT_, but it's probably better
|
||||
// not to, to be performance-safe.
|
||||
DrawBufferQuadrant(aTarget, LEFT, TOP, aOpacity, aMask, aMaskTransform);
|
||||
|
@ -523,7 +523,7 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
|
||||
void* aCallbackData,
|
||||
EndTransactionFlags aFlags)
|
||||
{
|
||||
SAMPLE_LABEL("BasicLayerManager", "EndTranscationInternal");
|
||||
PROFILER_LABEL("BasicLayerManager", "EndTranscationInternal");
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
MOZ_LAYERS_LOG((" ----- (beginning paint)"));
|
||||
Log();
|
||||
|
@ -86,7 +86,7 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
|
||||
void* aCallbackData,
|
||||
ReadbackProcessor* aReadback)
|
||||
{
|
||||
SAMPLE_LABEL("BasicThebesLayer", "PaintThebes");
|
||||
PROFILER_LABEL("BasicThebesLayer", "PaintThebes");
|
||||
NS_ASSERTION(BasicManager()->InDrawing(),
|
||||
"Can only draw in drawing phase");
|
||||
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
|
||||
|
@ -108,7 +108,7 @@ BasicTiledLayerBuffer::PaintThebes(BasicTiledThebesLayer* aLayer,
|
||||
if (useSinglePaintBuffer) {
|
||||
const nsIntRect bounds = aPaintRegion.GetBounds();
|
||||
{
|
||||
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferAlloc");
|
||||
PROFILER_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferAlloc");
|
||||
mSinglePaintBuffer = new gfxImageSurface(
|
||||
gfxIntSize(ceilf(bounds.width * mResolution),
|
||||
ceilf(bounds.height * mResolution)),
|
||||
@ -125,7 +125,7 @@ BasicTiledLayerBuffer::PaintThebes(BasicTiledThebesLayer* aLayer,
|
||||
}
|
||||
start = PR_IntervalNow();
|
||||
#endif
|
||||
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferDraw");
|
||||
PROFILER_LABEL("BasicTiledLayerBuffer", "PaintThebesSingleBufferDraw");
|
||||
|
||||
mCallback(mThebesLayer, ctxt, aPaintRegion, nsIntRegion(), mCallbackData);
|
||||
}
|
||||
@ -145,7 +145,7 @@ BasicTiledLayerBuffer::PaintThebes(BasicTiledThebesLayer* aLayer,
|
||||
start = PR_IntervalNow();
|
||||
#endif
|
||||
|
||||
SAMPLE_LABEL("BasicTiledLayerBuffer", "PaintThebesUpdate");
|
||||
PROFILER_LABEL("BasicTiledLayerBuffer", "PaintThebesUpdate");
|
||||
Update(aNewValidRegion, aPaintRegion);
|
||||
|
||||
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
|
||||
@ -221,7 +221,7 @@ BasicTiledLayerBuffer::ValidateTile(BasicTiledLayerTile aTile,
|
||||
const nsIntRegion& aDirtyRegion)
|
||||
{
|
||||
|
||||
SAMPLE_LABEL("BasicTiledLayerBuffer", "ValidateTile");
|
||||
PROFILER_LABEL("BasicTiledLayerBuffer", "ValidateTile");
|
||||
|
||||
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
|
||||
if (aDirtyRegion.IsComplex()) {
|
||||
@ -311,7 +311,7 @@ BasicTiledThebesLayer::ComputeProgressiveUpdateRegion(BasicTiledLayerBuffer& aTi
|
||||
if (BasicManager()->ProgressiveUpdateCallback(!staleRegion.Contains(aInvalidRegion),
|
||||
viewport,
|
||||
scaleX, scaleY, !drawingLowPrecision)) {
|
||||
SAMPLE_MARKER("Abort painting");
|
||||
PROFILER_MARKER("Abort painting");
|
||||
aRegionToPaint.SetEmpty();
|
||||
return aIsRepeated;
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ GrallocBufferActor::Create(const gfxIntSize& aSize,
|
||||
const gfxContentType& aContent,
|
||||
MaybeMagicGrallocBufferHandle* aOutHandle)
|
||||
{
|
||||
SAMPLE_LABEL("GrallocBufferActor", "Create");
|
||||
PROFILER_LABEL("GrallocBufferActor", "Create");
|
||||
GrallocBufferActor* actor = new GrallocBufferActor();
|
||||
*aOutHandle = null_t();
|
||||
android::PixelFormat format = PixelFormatForContentType(aContent);
|
||||
@ -224,7 +224,7 @@ ShadowLayerManager::OpenDescriptorForDirectTexturing(GLContext* aGL,
|
||||
const SurfaceDescriptor& aDescriptor,
|
||||
GLenum aWrapMode)
|
||||
{
|
||||
SAMPLE_LABEL("ShadowLayerManager", "OpenDescriptorForDirectTexturing");
|
||||
PROFILER_LABEL("ShadowLayerManager", "OpenDescriptorForDirectTexturing");
|
||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -301,7 +301,7 @@ ShadowLayerForwarder::PlatformAllocBuffer(const gfxIntSize& aSize,
|
||||
if (aSize.width < 64) {
|
||||
return false;
|
||||
}
|
||||
SAMPLE_LABEL("ShadowLayerForwarder", "PlatformAllocBuffer");
|
||||
PROFILER_LABEL("ShadowLayerForwarder", "PlatformAllocBuffer");
|
||||
// Gralloc buffers are efficiently mappable as gfxImageSurface, so
|
||||
// no need to check |aCaps & MAP_AS_IMAGE_SURFACE|.
|
||||
MaybeMagicGrallocBufferHandle handle;
|
||||
@ -339,7 +339,7 @@ GrallocBufferActor::GetFrom(const SurfaceDescriptorGralloc& aDescriptor)
|
||||
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
|
||||
const SurfaceDescriptor& aSurface)
|
||||
{
|
||||
SAMPLE_LABEL("ShadowLayerForwarder", "PlatformOpenDescriptor");
|
||||
PROFILER_LABEL("ShadowLayerForwarder", "PlatformOpenDescriptor");
|
||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aSurface.type()) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -414,7 +414,7 @@ ShadowLayerForwarder::PlatformDestroySharedSurface(SurfaceDescriptor* aSurface)
|
||||
/*static*/ bool
|
||||
ShadowLayerForwarder::PlatformCloseDescriptor(const SurfaceDescriptor& aDescriptor)
|
||||
{
|
||||
SAMPLE_LABEL("ShadowLayerForwarder", "PlatformCloseDescriptor");
|
||||
PROFILER_LABEL("ShadowLayerForwarder", "PlatformCloseDescriptor");
|
||||
if (SurfaceDescriptor::TSurfaceDescriptorGralloc != aDescriptor.type()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ ShadowLayerForwarder::PaintedCanvas(ShadowableLayer* aCanvas,
|
||||
bool
|
||||
ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies)
|
||||
{
|
||||
SAMPLE_LABEL("ShadowLayerForwarder", "EndTranscation");
|
||||
PROFILER_LABEL("ShadowLayerForwarder", "EndTranscation");
|
||||
RenderTraceScope rendertrace("Foward Transaction", "000091");
|
||||
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
||||
NS_ABORT_IF_FALSE(!mTxn->Finished(), "forgot BeginTransaction?");
|
||||
|
@ -931,7 +931,7 @@ static uint16_t sFrameCount = 0;
|
||||
void
|
||||
FPSState::DrawFrameCounter(GLContext* context)
|
||||
{
|
||||
SAMPLER_FRAME_NUMBER(sFrameCount);
|
||||
profiler_set_frame_number(sFrameCount);
|
||||
|
||||
context->fEnable(LOCAL_GL_SCISSOR_TEST);
|
||||
|
||||
@ -1038,7 +1038,7 @@ LayerManagerOGL::NotifyShadowTreeTransaction()
|
||||
void
|
||||
LayerManagerOGL::Render()
|
||||
{
|
||||
SAMPLE_LABEL("LayerManagerOGL", "Render");
|
||||
PROFILER_LABEL("LayerManagerOGL", "Render");
|
||||
if (mDestroyed) {
|
||||
NS_WARNING("Call on destroyed layer manager");
|
||||
return;
|
||||
|
@ -303,7 +303,7 @@ gfxContext::Stroke()
|
||||
void
|
||||
gfxContext::Fill()
|
||||
{
|
||||
SAMPLE_LABEL("gfxContext", "Fill");
|
||||
PROFILER_LABEL("gfxContext", "Fill");
|
||||
if (mCairo) {
|
||||
cairo_fill_preserve(mCairo);
|
||||
} else {
|
||||
@ -1413,7 +1413,7 @@ gfxContext::Mask(gfxPattern *pattern)
|
||||
void
|
||||
gfxContext::Mask(gfxASurface *surface, const gfxPoint& offset)
|
||||
{
|
||||
SAMPLE_LABEL("gfxContext", "Mask");
|
||||
PROFILER_LABEL("gfxContext", "Mask");
|
||||
if (mCairo) {
|
||||
cairo_mask_surface(mCairo, surface->CairoSurface(), offset.x, offset.y);
|
||||
} else {
|
||||
@ -1432,7 +1432,7 @@ gfxContext::Mask(gfxASurface *surface, const gfxPoint& offset)
|
||||
void
|
||||
gfxContext::Paint(gfxFloat alpha)
|
||||
{
|
||||
SAMPLE_LABEL("gfxContext", "Paint");
|
||||
PROFILER_LABEL("gfxContext", "Paint");
|
||||
if (mCairo) {
|
||||
cairo_paint_with_alpha(mCairo, alpha);
|
||||
} else {
|
||||
|
@ -1536,7 +1536,7 @@ struct GlyphBuffer {
|
||||
FlushStroke(aCR, aObjectPaint, aGlobalMatrix);
|
||||
}
|
||||
if (aDrawMode & gfxFont::GLYPH_FILL) {
|
||||
SAMPLE_LABEL("GlyphBuffer", "cairo_show_glyphs");
|
||||
PROFILER_LABEL("GlyphBuffer", "cairo_show_glyphs");
|
||||
nsRefPtr<gfxPattern> pattern;
|
||||
if (aObjectPaint &&
|
||||
!!(pattern = aObjectPaint->GetFillPattern(aGlobalMatrix))) {
|
||||
|
@ -221,7 +221,7 @@ CreateSamplingRestrictedDrawable(gfxDrawable* aDrawable,
|
||||
const gfxRect& aSubimage,
|
||||
const gfxImageSurface::gfxImageFormat aFormat)
|
||||
{
|
||||
SAMPLE_LABEL("gfxUtils", "CreateSamplingRestricedDrawable");
|
||||
PROFILER_LABEL("gfxUtils", "CreateSamplingRestricedDrawable");
|
||||
gfxRect userSpaceClipExtents = aContext->GetClipExtents();
|
||||
// This isn't optimal --- if aContext has a rotation then GetClipExtents
|
||||
// will have to do a bounding-box computation, and TransformBounds might
|
||||
@ -418,7 +418,7 @@ gfxUtils::DrawPixelSnapped(gfxContext* aContext,
|
||||
gfxPattern::GraphicsFilter aFilter,
|
||||
uint32_t aImageFlags)
|
||||
{
|
||||
SAMPLE_LABEL("gfxUtils", "DrawPixelSnapped");
|
||||
PROFILER_LABEL("gfxUtils", "DrawPixelSnapped");
|
||||
bool doTile = !aImageRect.Contains(aSourceRect) &&
|
||||
!(aImageFlags & imgIContainer::FLAG_CLAMP);
|
||||
|
||||
|
@ -68,7 +68,7 @@ Decoder::InitSharedDecoder()
|
||||
void
|
||||
Decoder::Write(const char* aBuffer, uint32_t aCount)
|
||||
{
|
||||
SAMPLE_LABEL("ImageDecoder", "Write");
|
||||
PROFILER_LABEL("ImageDecoder", "Write");
|
||||
|
||||
// We're strict about decoder errors
|
||||
NS_ABORT_IF_FALSE(!HasDecoderError(),
|
||||
|
@ -2847,7 +2847,7 @@ RasterImage::RequestDecodeCore(RequestDecodeType aDecodeType)
|
||||
// large images will decode a bit and post themselves to the event loop
|
||||
// to finish decoding.
|
||||
if (!mDecoded && !mInDecoder && mHasSourceData && aDecodeType == SOMEWHAT_SYNCHRONOUS) {
|
||||
SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString().get());
|
||||
PROFILER_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString().get());
|
||||
DecodeWorker::Singleton()->DecodeABitOf(this);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2866,7 +2866,7 @@ RasterImage::SyncDecode()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
SAMPLE_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString().get());;
|
||||
PROFILER_LABEL_PRINTF("RasterImage", "SyncDecode", "%s", GetURIString().get());;
|
||||
|
||||
// If we're decoded already, no worries
|
||||
if (mDecoded)
|
||||
|
@ -438,7 +438,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter,
|
||||
const nsIntMargin &aPadding, const nsIntRect &aSubimage,
|
||||
uint32_t aImageFlags)
|
||||
{
|
||||
SAMPLE_LABEL("image", "imgFrame::Draw");
|
||||
PROFILER_LABEL("image", "imgFrame::Draw");
|
||||
NS_ASSERTION(!aFill.IsEmpty(), "zero dest size --- fix caller");
|
||||
NS_ASSERTION(!aSubimage.IsEmpty(), "zero source size --- fix caller");
|
||||
NS_ASSERTION(!mPalettedImageData, "Directly drawing a paletted image!");
|
||||
|
@ -2048,7 +2048,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
|
||||
uint32_t aFlags,
|
||||
const nsIFrame* aForceActiveScrolledRoot)
|
||||
{
|
||||
SAMPLE_LABEL("ContainerState", "ProcessDisplayItems");
|
||||
PROFILER_LABEL("ContainerState", "ProcessDisplayItems");
|
||||
|
||||
const nsIFrame* lastActiveScrolledRoot = nullptr;
|
||||
nsPoint topLeft;
|
||||
@ -3183,7 +3183,7 @@ FrameLayerBuilder::DrawThebesLayer(ThebesLayer* aLayer,
|
||||
const nsIntRegion& aRegionToInvalidate,
|
||||
void* aCallbackData)
|
||||
{
|
||||
SAMPLE_LABEL("gfx", "DrawThebesLayer");
|
||||
PROFILER_LABEL("gfx", "DrawThebesLayer");
|
||||
|
||||
nsDisplayListBuilder* builder = static_cast<nsDisplayListBuilder*>
|
||||
(aCallbackData);
|
||||
|
@ -135,7 +135,7 @@ RestyleTracker::ProcessOneRestyle(Element* aElement,
|
||||
void
|
||||
RestyleTracker::DoProcessRestyles()
|
||||
{
|
||||
SAMPLE_LABEL("CSS", "ProcessRestyles");
|
||||
PROFILER_LABEL("CSS", "ProcessRestyles");
|
||||
// Make sure to not rebuild quote or counter lists while we're
|
||||
// processing restyles
|
||||
mFrameConstructor->BeginUpdate();
|
||||
|
@ -8215,7 +8215,7 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
||||
if (!count)
|
||||
return NS_OK;
|
||||
|
||||
SAMPLE_LABEL("CSS", "ProcessRestyledFrames");
|
||||
PROFILER_LABEL("CSS", "ProcessRestyledFrames");
|
||||
|
||||
// Make sure to not rebuild quote or counter lists while we're
|
||||
// processing restyles
|
||||
|
@ -583,7 +583,7 @@ nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
|
||||
nsStyleContext* aStyleContext,
|
||||
int aSkipSides)
|
||||
{
|
||||
SAMPLE_LABEL("nsCSSRendering", "PaintBorder");
|
||||
PROFILER_LABEL("nsCSSRendering", "PaintBorder");
|
||||
nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited();
|
||||
const nsStyleBorder *styleBorder = aStyleContext->StyleBorder();
|
||||
// Don't check RelevantLinkVisited here, since we want to take the
|
||||
@ -1541,7 +1541,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
|
||||
nsRect* aBGClipRect,
|
||||
int32_t aLayer)
|
||||
{
|
||||
SAMPLE_LABEL("nsCSSRendering", "PaintBackground");
|
||||
PROFILER_LABEL("nsCSSRendering", "PaintBackground");
|
||||
NS_PRECONDITION(aForFrame,
|
||||
"Frame is expected to be provided to PaintBackground");
|
||||
|
||||
@ -1578,7 +1578,7 @@ nsCSSRendering::PaintBackgroundColor(nsPresContext* aPresContext,
|
||||
const nsRect& aBorderArea,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
SAMPLE_LABEL("nsCSSRendering", "PaintBackgroundColor");
|
||||
PROFILER_LABEL("nsCSSRendering", "PaintBackgroundColor");
|
||||
NS_PRECONDITION(aForFrame,
|
||||
"Frame is expected to be provided to PaintBackground");
|
||||
|
||||
@ -2086,7 +2086,7 @@ nsCSSRendering::PaintGradient(nsPresContext* aPresContext,
|
||||
const nsRect& aOneCellArea,
|
||||
const nsRect& aFillArea)
|
||||
{
|
||||
SAMPLE_LABEL("nsCSSRendering", "PaintGradient");
|
||||
PROFILER_LABEL("nsCSSRendering", "PaintGradient");
|
||||
Telemetry::AutoTimer<Telemetry::GRADIENT_DURATION, Telemetry::Microsecond> gradientTimer;
|
||||
if (aOneCellArea.IsEmpty())
|
||||
return;
|
||||
|
@ -1954,7 +1954,7 @@ nsCSSBorderRenderer::DrawBorders()
|
||||
DrawBorderSides(SIDE_BITS_ALL);
|
||||
SN("---------------- (1)");
|
||||
} else {
|
||||
SAMPLE_LABEL("nsCSSBorderRenderer", "DrawBorders::multipass");
|
||||
PROFILER_LABEL("nsCSSBorderRenderer", "DrawBorders::multipass");
|
||||
/* We have more than one pass to go. Draw the corners separately from the sides. */
|
||||
|
||||
/*
|
||||
|
@ -893,7 +893,7 @@ nsDisplayList::GetBounds(nsDisplayListBuilder* aBuilder) const {
|
||||
bool
|
||||
nsDisplayList::ComputeVisibilityForRoot(nsDisplayListBuilder* aBuilder,
|
||||
nsRegion* aVisibleRegion) {
|
||||
SAMPLE_LABEL("nsDisplayList", "ComputeVisibilityForRoot");
|
||||
PROFILER_LABEL("nsDisplayList", "ComputeVisibilityForRoot");
|
||||
nsRegion r;
|
||||
r.And(*aVisibleRegion, GetBounds(aBuilder));
|
||||
return ComputeVisibilityForSublist(aBuilder, nullptr, aVisibleRegion, r.GetBounds(), r.GetBounds());
|
||||
@ -1029,7 +1029,7 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
|
||||
void nsDisplayList::PaintRoot(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx,
|
||||
uint32_t aFlags) const {
|
||||
SAMPLE_LABEL("nsDisplayList", "PaintRoot");
|
||||
PROFILER_LABEL("nsDisplayList", "PaintRoot");
|
||||
PaintForFrame(aBuilder, aCtx, aBuilder->RootReferenceFrame(), aFlags);
|
||||
}
|
||||
|
||||
@ -2447,7 +2447,7 @@ nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsAutoTArray<nsRect,10> rects;
|
||||
ComputeDisjointRectangles(mVisibleRegion, &rects);
|
||||
|
||||
SAMPLE_LABEL("nsDisplayBoxShadowOuter", "Paint");
|
||||
PROFILER_LABEL("nsDisplayBoxShadowOuter", "Paint");
|
||||
for (uint32_t i = 0; i < rects.Length(); ++i) {
|
||||
aCtx->PushState();
|
||||
aCtx->IntersectClip(rects[i]);
|
||||
@ -2506,7 +2506,7 @@ nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsAutoTArray<nsRect,10> rects;
|
||||
ComputeDisjointRectangles(mVisibleRegion, &rects);
|
||||
|
||||
SAMPLE_LABEL("nsDisplayBoxShadowInner", "Paint");
|
||||
PROFILER_LABEL("nsDisplayBoxShadowInner", "Paint");
|
||||
for (uint32_t i = 0; i < rects.Length(); ++i) {
|
||||
aCtx->PushState();
|
||||
aCtx->IntersectClip(rects[i]);
|
||||
|
@ -1658,7 +1658,7 @@ nsFrameManager::ComputeStyleChangeFor(nsIFrame *aFrame,
|
||||
RestyleTracker& aRestyleTracker,
|
||||
bool aRestyleDescendants)
|
||||
{
|
||||
SAMPLE_LABEL("CSS", "ComputeStyleChangeFor");
|
||||
PROFILER_LABEL("CSS", "ComputeStyleChangeFor");
|
||||
|
||||
nsIContent *content = aFrame->GetContent();
|
||||
if (aMinChange) {
|
||||
|
@ -1744,7 +1744,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt,
|
||||
bool aShouldIgnoreSuppression,
|
||||
bool aIgnoreRootScrollFrame)
|
||||
{
|
||||
SAMPLE_LABEL("nsLayoutUtils", "GetFrameForPoint");
|
||||
PROFILER_LABEL("nsLayoutUtils", "GetFrameForPoint");
|
||||
nsresult rv;
|
||||
nsAutoTArray<nsIFrame*,8> outFrames;
|
||||
rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames,
|
||||
@ -1759,7 +1759,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect,
|
||||
bool aShouldIgnoreSuppression,
|
||||
bool aIgnoreRootScrollFrame)
|
||||
{
|
||||
SAMPLE_LABEL("nsLayoutUtils","GetFramesForArea");
|
||||
PROFILER_LABEL("nsLayoutUtils","GetFramesForArea");
|
||||
nsDisplayListBuilder builder(aFrame, nsDisplayListBuilder::EVENT_DELIVERY,
|
||||
false);
|
||||
nsDisplayList list;
|
||||
@ -1799,7 +1799,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
|
||||
const nsRegion& aDirtyRegion, nscolor aBackstop,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
SAMPLE_LABEL("nsLayoutUtils","PaintFrame");
|
||||
PROFILER_LABEL("nsLayoutUtils","PaintFrame");
|
||||
if (aFlags & PAINT_WIDGET_LAYERS) {
|
||||
nsView* view = aFrame->GetView();
|
||||
if (!(view && view->GetWidget() && GetDisplayRootFrame(aFrame) == aFrame)) {
|
||||
@ -1917,7 +1917,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
|
||||
nsRect dirtyRect = visibleRegion.GetBounds();
|
||||
builder.EnterPresShell(aFrame, dirtyRect);
|
||||
{
|
||||
SAMPLE_LABEL("nsLayoutUtils","PaintFrame::BuildDisplayList");
|
||||
PROFILER_LABEL("nsLayoutUtils","PaintFrame::BuildDisplayList");
|
||||
aFrame->BuildDisplayListForStackingContext(&builder, dirtyRect, &list);
|
||||
}
|
||||
const bool paintAllContinuations = aFlags & PAINT_ALL_CONTINUATIONS;
|
||||
@ -1930,7 +1930,7 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
|
||||
if (paintAllContinuations) {
|
||||
nsIFrame* currentFrame = aFrame;
|
||||
while ((currentFrame = currentFrame->GetNextContinuation()) != nullptr) {
|
||||
SAMPLE_LABEL("nsLayoutUtils","PaintFrame::ContinuationsBuildDisplayList");
|
||||
PROFILER_LABEL("nsLayoutUtils","PaintFrame::ContinuationsBuildDisplayList");
|
||||
nsRect frameDirty = dirtyRect - builder.ToReferenceFrame(currentFrame);
|
||||
currentFrame->BuildDisplayListForStackingContext(&builder,
|
||||
frameDirty, &list);
|
||||
@ -4163,7 +4163,7 @@ nsLayoutUtils::DrawBackgroundImage(nsRenderingContext* aRenderingContext,
|
||||
const nsRect& aDirty,
|
||||
uint32_t aImageFlags)
|
||||
{
|
||||
SAMPLE_LABEL("layout", "nsLayoutUtils::DrawBackgroundImage");
|
||||
PROFILER_LABEL("layout", "nsLayoutUtils::DrawBackgroundImage");
|
||||
|
||||
if (UseBackgroundNearestFiltering()) {
|
||||
aGraphicsFilter = gfxPattern::FILTER_NEAREST;
|
||||
|
@ -3806,7 +3806,7 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush)
|
||||
// Make sure that we don't miss things added to mozFlushType!
|
||||
MOZ_ASSERT(static_cast<uint32_t>(flushType) <= ArrayLength(flushTypeNames));
|
||||
|
||||
SAMPLE_LABEL_PRINTF("layout", "Flush", "(Flush_%s)",
|
||||
PROFILER_LABEL_PRINTF("layout", "Flush", "(Flush_%s)",
|
||||
flushTypeNames[flushType - 1]);
|
||||
#endif
|
||||
|
||||
@ -5497,7 +5497,7 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
const nsRegion& aDirtyRegion,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
SAMPLE_LABEL("Paint", "PresShell::Paint");
|
||||
PROFILER_LABEL("Paint", "PresShell::Paint");
|
||||
NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
|
||||
NS_ASSERTION(aViewToPaint, "null view");
|
||||
|
||||
@ -7750,7 +7750,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
||||
nsIURI *uri = mDocument->GetDocumentURI();
|
||||
if (uri)
|
||||
uri->GetSpec(docURL);
|
||||
SAMPLE_LABEL_PRINTF("layout", "DoReflow", "(%s)", docURL.get());
|
||||
PROFILER_LABEL_PRINTF("layout", "DoReflow", "(%s)", docURL.get());
|
||||
|
||||
if (mReflowContinueTimer) {
|
||||
mReflowContinueTimer->Cancel();
|
||||
|
@ -828,7 +828,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
return;
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("nsRefreshDriver", "Tick");
|
||||
PROFILER_LABEL("nsRefreshDriver", "Tick");
|
||||
|
||||
// We're either frozen or we were disconnected (likely in the middle
|
||||
// of a tick iteration). Just do nothing here, since our
|
||||
|
@ -4593,7 +4593,7 @@ public:
|
||||
void
|
||||
nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx) {
|
||||
SAMPLE_LABEL("nsDisplayText", "Paint");
|
||||
PROFILER_LABEL("nsDisplayText", "Paint");
|
||||
// Add 1 pixel of dirty area around mVisibleRect to allow us to paint
|
||||
// antialiased pixels beyond the measured text extents.
|
||||
// This is temporary until we do this in the actual calculation of text extents.
|
||||
@ -5390,7 +5390,7 @@ nsTextFrame::PaintOneShadow(uint32_t aOffset, uint32_t aLength,
|
||||
const nsCharClipDisplayItem::ClipEdges& aClipEdges,
|
||||
nscoord aLeftSideOffset, gfxRect& aBoundingBox)
|
||||
{
|
||||
SAMPLE_LABEL("nsTextFrame", "PaintOneShadow");
|
||||
PROFILER_LABEL("nsTextFrame", "PaintOneShadow");
|
||||
gfxPoint shadowOffset(aShadowDetails->mXOffset, aShadowDetails->mYOffset);
|
||||
nscoord blurRadius = std::max(aShadowDetails->mRadius, 0);
|
||||
|
||||
|
@ -62,7 +62,7 @@ ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
SAMPLE_LABEL("ViewportFrame", "BuildDisplayList");
|
||||
PROFILER_LABEL("ViewportFrame", "BuildDisplayList");
|
||||
nsIFrame* kid = mFrames.FirstChild();
|
||||
if (!kid)
|
||||
return;
|
||||
|
@ -411,7 +411,7 @@ nsChangeHint
|
||||
nsStyleContext::CalcStyleDifference(nsStyleContext* aOther,
|
||||
nsChangeHint aParentHintsNotHandledForDescendants)
|
||||
{
|
||||
SAMPLE_LABEL("nsStyleContext", "CalcStyleDifference");
|
||||
PROFILER_LABEL("nsStyleContext", "CalcStyleDifference");
|
||||
|
||||
NS_ABORT_IF_FALSE(NS_IsHintSubset(aParentHintsNotHandledForDescendants,
|
||||
nsChangeHint_Hints_NotHandledForDescendants),
|
||||
|
@ -910,7 +910,7 @@ nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc aCollectorFunc,
|
||||
RuleProcessorData* aData, Element* aElement,
|
||||
nsRuleWalker* aRuleWalker)
|
||||
{
|
||||
SAMPLE_LABEL("nsStyleSet", "FileRules");
|
||||
PROFILER_LABEL("nsStyleSet", "FileRules");
|
||||
|
||||
// Cascading order:
|
||||
// [least important]
|
||||
|
@ -353,7 +353,7 @@ nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *stream)
|
||||
{
|
||||
LOG(("nsInputStreamPump::OnInputStreamReady [this=%x]\n", this));
|
||||
|
||||
SAMPLE_LABEL("Input", "nsInputStreamPump::OnInputStreamReady");
|
||||
PROFILER_LABEL("Input", "nsInputStreamPump::OnInputStreamReady");
|
||||
// this function has been called from a PLEvent, so we can safely call
|
||||
// any listener or progress sink methods directly from here.
|
||||
|
||||
@ -400,7 +400,7 @@ nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *stream)
|
||||
uint32_t
|
||||
nsInputStreamPump::OnStateStart()
|
||||
{
|
||||
SAMPLE_LABEL("nsInputStreamPump", "OnStateStart");
|
||||
PROFILER_LABEL("nsInputStreamPump", "OnStateStart");
|
||||
LOG((" OnStateStart [this=%x]\n", this));
|
||||
|
||||
nsresult rv;
|
||||
@ -428,7 +428,7 @@ nsInputStreamPump::OnStateStart()
|
||||
uint32_t
|
||||
nsInputStreamPump::OnStateTransfer()
|
||||
{
|
||||
SAMPLE_LABEL("Input", "nsInputStreamPump::OnStateTransfer");
|
||||
PROFILER_LABEL("Input", "nsInputStreamPump::OnStateTransfer");
|
||||
LOG((" OnStateTransfer [this=%x]\n", this));
|
||||
|
||||
// if canceled, go directly to STATE_STOP...
|
||||
@ -536,7 +536,7 @@ nsInputStreamPump::OnStateTransfer()
|
||||
uint32_t
|
||||
nsInputStreamPump::OnStateStop()
|
||||
{
|
||||
SAMPLE_LABEL("Input", "nsInputStreamPump::OnStateTransfer");
|
||||
PROFILER_LABEL("Input", "nsInputStreamPump::OnStateTransfer");
|
||||
LOG((" OnStateStop [this=%x status=%x]\n", this, mStatus));
|
||||
|
||||
// if an error occurred, we must be sure to pass the error onto the async
|
||||
|
@ -93,7 +93,7 @@ NS_IMETHODIMP
|
||||
nsStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt,
|
||||
nsresult aStatus)
|
||||
{
|
||||
SAMPLE_LABEL("network", "nsStreamLoader::OnStopRequest");
|
||||
PROFILER_LABEL("network", "nsStreamLoader::OnStopRequest");
|
||||
if (mObserver) {
|
||||
// provide nsIStreamLoader::request during call to OnStreamComplete
|
||||
mRequest = request;
|
||||
|
@ -4843,7 +4843,7 @@ nsHttpChannel::GetRequestMethod(nsACString& aMethod)
|
||||
NS_IMETHODIMP
|
||||
nsHttpChannel::OnStartRequest(nsIRequest *request, nsISupports *ctxt)
|
||||
{
|
||||
SAMPLE_LABEL("nsHttpChannel", "OnStartRequest");
|
||||
PROFILER_LABEL("nsHttpChannel", "OnStartRequest");
|
||||
if (!(mCanceled || NS_FAILED(mStatus))) {
|
||||
// capture the request's status, so our consumers will know ASAP of any
|
||||
// connection failures, etc - bug 93581
|
||||
@ -4949,7 +4949,7 @@ nsHttpChannel::ContinueOnStartRequest3(nsresult result)
|
||||
NS_IMETHODIMP
|
||||
nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult status)
|
||||
{
|
||||
SAMPLE_LABEL("network", "nsHttpChannel::OnStopRequest");
|
||||
PROFILER_LABEL("network", "nsHttpChannel::OnStopRequest");
|
||||
LOG(("nsHttpChannel::OnStopRequest [this=%p request=%p status=%x]\n",
|
||||
this, request, status));
|
||||
|
||||
@ -5093,7 +5093,7 @@ nsHttpChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
|
||||
nsIInputStream *input,
|
||||
uint64_t offset, uint32_t count)
|
||||
{
|
||||
SAMPLE_LABEL("network", "nsHttpChannel::OnDataAvailable");
|
||||
PROFILER_LABEL("network", "nsHttpChannel::OnDataAvailable");
|
||||
LOG(("nsHttpChannel::OnDataAvailable [this=%p request=%p offset=%llu count=%u]\n",
|
||||
this, request, offset, count));
|
||||
|
||||
|
@ -453,7 +453,7 @@ class nsHtml5FlushLoopGuard
|
||||
void
|
||||
nsHtml5TreeOpExecutor::RunFlushLoop()
|
||||
{
|
||||
SAMPLE_LABEL("html5", "RunFlushLoop");
|
||||
PROFILER_LABEL("html5", "RunFlushLoop");
|
||||
if (mRunFlushLoopOnStack) {
|
||||
// There's already a RunFlushLoop() on the call stack.
|
||||
return;
|
||||
|
@ -472,7 +472,7 @@ nsresult
|
||||
Connection::initialize()
|
||||
{
|
||||
NS_ASSERTION (!mDBConn, "Initialize called on already opened database!");
|
||||
SAMPLE_LABEL("storage", "Connection::initialize");
|
||||
PROFILER_LABEL("storage", "Connection::initialize");
|
||||
|
||||
// in memory database requested, sqlite uses a magic file name
|
||||
int srv = ::sqlite3_open_v2(":memory:", &mDBConn, mFlags, NULL);
|
||||
@ -489,7 +489,7 @@ Connection::initialize(nsIFile *aDatabaseFile)
|
||||
{
|
||||
NS_ASSERTION (aDatabaseFile, "Passed null file!");
|
||||
NS_ASSERTION (!mDBConn, "Initialize called on already opened database!");
|
||||
SAMPLE_LABEL("storage", "Connection::initialize");
|
||||
PROFILER_LABEL("storage", "Connection::initialize");
|
||||
|
||||
mDatabaseFile = aDatabaseFile;
|
||||
|
||||
@ -517,7 +517,7 @@ Connection::initialize(nsIFileURL *aFileURL)
|
||||
{
|
||||
NS_ASSERTION (aFileURL, "Passed null file URL!");
|
||||
NS_ASSERTION (!mDBConn, "Initialize called on already opened database!");
|
||||
SAMPLE_LABEL("storage", "Connection::initialize");
|
||||
PROFILER_LABEL("storage", "Connection::initialize");
|
||||
|
||||
nsCOMPtr<nsIFile> databaseFile;
|
||||
nsresult rv = aFileURL->GetFile(getter_AddRefs(databaseFile));
|
||||
@ -986,7 +986,7 @@ NS_IMETHODIMP
|
||||
Connection::Clone(bool aReadOnly,
|
||||
mozIStorageConnection **_connection)
|
||||
{
|
||||
SAMPLE_LABEL("storage", "Connection::Clone");
|
||||
PROFILER_LABEL("storage", "Connection::Clone");
|
||||
if (!mDBConn)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
if (!mDatabaseFile)
|
||||
|
@ -552,7 +552,7 @@ Statement::Execute()
|
||||
NS_IMETHODIMP
|
||||
Statement::ExecuteStep(bool *_moreResults)
|
||||
{
|
||||
SAMPLE_LABEL("storage", "Statement::ExecuteStep");
|
||||
PROFILER_LABEL("storage", "Statement::ExecuteStep");
|
||||
if (!mDBStatement)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
|
@ -262,7 +262,7 @@ nsAnnotationService::SetItemAnnotation(int64_t aItemId,
|
||||
int32_t aFlags,
|
||||
uint16_t aExpiration)
|
||||
{
|
||||
SAMPLE_LABEL("AnnotationService", "SetItemAnnotation");
|
||||
PROFILER_LABEL("AnnotationService", "SetItemAnnotation");
|
||||
NS_ENSURE_ARG_MIN(aItemId, 1);
|
||||
NS_ENSURE_ARG(aValue);
|
||||
|
||||
|
@ -641,7 +641,7 @@ nsNavBookmarks::InsertBookmark(int64_t aFolder,
|
||||
NS_IMETHODIMP
|
||||
nsNavBookmarks::RemoveItem(int64_t aItemId)
|
||||
{
|
||||
SAMPLE_LABEL("bookmarks", "RemoveItem");
|
||||
PROFILER_LABEL("bookmarks", "RemoveItem");
|
||||
NS_ENSURE_ARG(!IsRoot(aItemId));
|
||||
|
||||
BookmarkData bookmark;
|
||||
@ -1128,7 +1128,7 @@ nsNavBookmarks::GetDescendantChildren(int64_t aFolderId,
|
||||
NS_IMETHODIMP
|
||||
nsNavBookmarks::RemoveFolderChildren(int64_t aFolderId)
|
||||
{
|
||||
SAMPLE_LABEL("bookmarks", "RemoveFolderChilder");
|
||||
PROFILER_LABEL("bookmarks", "RemoveFolderChilder");
|
||||
NS_ENSURE_ARG_MIN(aFolderId, 1);
|
||||
NS_ENSURE_ARG(aFolderId != mRoot);
|
||||
|
||||
@ -2633,7 +2633,7 @@ nsNavBookmarks::EnsureKeywordsHash() {
|
||||
NS_IMETHODIMP
|
||||
nsNavBookmarks::RunInBatchMode(nsINavHistoryBatchCallback* aCallback,
|
||||
nsISupports* aUserData) {
|
||||
SAMPLE_LABEL("bookmarks", "RunInBatchMode");
|
||||
PROFILER_LABEL("bookmarks", "RunInBatchMode");
|
||||
NS_ENSURE_ARG(aCallback);
|
||||
|
||||
mBatching = true;
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
|
||||
static void Record(Event ev) {
|
||||
SAMPLE_MARKER(Describe(ev));
|
||||
PROFILER_MARKER(Describe(ev));
|
||||
Record(ev, PR_Now());
|
||||
}
|
||||
|
||||
|
@ -373,7 +373,7 @@ nsAppStartup::Quit(uint32_t aMode)
|
||||
}
|
||||
}
|
||||
|
||||
SAMPLE_MARKER("Shutdown start");
|
||||
PROFILER_MARKER("Shutdown start");
|
||||
mozilla::RecordShutdownStartTimeStamp();
|
||||
mShuttingDown = true;
|
||||
if (!mRestart) {
|
||||
|
@ -1115,7 +1115,7 @@ ScopedXPCOMStartup::~ScopedXPCOMStartup()
|
||||
appStartup->DestroyHiddenWindow();
|
||||
|
||||
gDirServiceProvider->DoShutdown();
|
||||
SAMPLE_MARKER("Shutdown early");
|
||||
PROFILER_MARKER("Shutdown early");
|
||||
|
||||
WriteConsoleLog();
|
||||
|
||||
@ -3871,7 +3871,7 @@ XREMain::XRE_mainRun()
|
||||
}
|
||||
|
||||
#ifdef MOZ_INSTRUMENT_EVENT_LOOP
|
||||
if (PR_GetEnv("MOZ_INSTRUMENT_EVENT_LOOP") || SAMPLER_IS_ACTIVE()) {
|
||||
if (PR_GetEnv("MOZ_INSTRUMENT_EVENT_LOOP") || profiler_is_active()) {
|
||||
mozilla::InitEventTracing();
|
||||
}
|
||||
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
|
||||
@ -3893,8 +3893,8 @@ XREMain::XRE_mainRun()
|
||||
int
|
||||
XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
{
|
||||
SAMPLER_INIT();
|
||||
SAMPLE_LABEL("Startup", "XRE_Main");
|
||||
profiler_init();
|
||||
PROFILER_LABEL("Startup", "XRE_Main");
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@ -3994,7 +3994,7 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
MOZ_gdk_display_close(mGdkDisplay);
|
||||
#endif
|
||||
|
||||
SAMPLER_SHUTDOWN();
|
||||
profiler_shutdown();
|
||||
rv = LaunchChild(mNativeApp, true);
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
@ -4017,7 +4017,7 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
|
||||
XRE_DeinitCommandLine();
|
||||
|
||||
SAMPLER_SHUTDOWN();
|
||||
profiler_shutdown();
|
||||
|
||||
return NS_FAILED(rv) ? 1 : 0;
|
||||
}
|
||||
@ -4089,8 +4089,8 @@ public:
|
||||
int
|
||||
XRE_mainMetro(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
{
|
||||
SAMPLER_INIT();
|
||||
SAMPLE_LABEL("Startup", "XRE_Main");
|
||||
profiler_init();
|
||||
PROFILER_LABEL("Startup", "XRE_Main");
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
@ -4130,7 +4130,7 @@ XRE_mainMetro(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||
// thread that called XRE_metroStartup.
|
||||
NS_ASSERTION(!xreMainPtr->mScopedXPCom,
|
||||
"XPCOM Shutdown hasn't occured, and we are exiting.");
|
||||
SAMPLER_SHUTDOWN();
|
||||
profiler_shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -282,8 +282,8 @@ XRE_InitChildProcess(int aArgc,
|
||||
NS_ENSURE_ARG_MIN(aArgc, 2);
|
||||
NS_ENSURE_ARG_POINTER(aArgv);
|
||||
NS_ENSURE_ARG_POINTER(aArgv[0]);
|
||||
SAMPLER_INIT();
|
||||
SAMPLE_LABEL("Startup", "XRE_InitChildProcess");
|
||||
profiler_init();
|
||||
PROFILER_LABEL("Startup", "XRE_InitChildProcess");
|
||||
|
||||
sChildProcessType = aProcess;
|
||||
|
||||
|
@ -60,11 +60,11 @@ nsProfiler::Observe(nsISupports *aSubject,
|
||||
nsCOMPtr<nsILoadContext> loadContext = do_QueryInterface(parentWebNav);
|
||||
if (loadContext && loadContext->UsePrivateBrowsing() && !mLockedForPrivateBrowsing) {
|
||||
mLockedForPrivateBrowsing = true;
|
||||
SAMPLER_LOCK();
|
||||
profiler_lock();
|
||||
}
|
||||
} else if (strcmp(aTopic, "last-pb-context-exited") == 0) {
|
||||
mLockedForPrivateBrowsing = false;
|
||||
SAMPLER_UNLOCK();
|
||||
profiler_unlock();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -77,7 +77,7 @@ nsProfiler::StartProfiler(uint32_t aEntries, uint32_t aInterval,
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
SAMPLER_START(aEntries, aInterval, aFeatures, aFeatureCount);
|
||||
profiler_start(aEntries, aInterval, aFeatures, aFeatureCount);
|
||||
#ifdef MOZ_INSTRUMENT_EVENT_LOOP
|
||||
mozilla::InitEventTracing();
|
||||
#endif
|
||||
@ -87,21 +87,21 @@ nsProfiler::StartProfiler(uint32_t aEntries, uint32_t aInterval,
|
||||
NS_IMETHODIMP
|
||||
nsProfiler::StopProfiler()
|
||||
{
|
||||
SAMPLER_STOP();
|
||||
profiler_stop();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProfiler::AddMarker(const char *aMarker)
|
||||
{
|
||||
SAMPLE_MARKER(aMarker);
|
||||
PROFILER_MARKER(aMarker);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProfiler::GetProfile(char **aProfile)
|
||||
{
|
||||
char *profile = SAMPLER_GET_PROFILE();
|
||||
char *profile = profiler_get_profile();
|
||||
if (profile) {
|
||||
uint32_t len = strlen(profile);
|
||||
char *profileStr = static_cast<char *>
|
||||
@ -218,7 +218,7 @@ nsProfiler::GetFeatures(uint32_t *aCount, char ***aFeatures)
|
||||
{
|
||||
uint32_t len = 0;
|
||||
|
||||
const char **features = SAMPLER_GET_FEATURES();
|
||||
const char **features = profiler_get_features();
|
||||
if (!features) {
|
||||
*aCount = 0;
|
||||
*aFeatures = nullptr;
|
||||
|
@ -291,8 +291,8 @@ static struct sigaction old_sigstart_signal_handler;
|
||||
const int SIGSTART = SIGUSR1;
|
||||
|
||||
static void StartSignalHandler(int signal, siginfo_t* info, void* context) {
|
||||
SAMPLER_START(PROFILE_DEFAULT_ENTRY, PROFILE_DEFAULT_INTERVAL,
|
||||
PROFILE_DEFAULT_FEATURES, PROFILE_DEFAULT_FEATURE_COUNT);
|
||||
profiler_start(PROFILE_DEFAULT_ENTRY, PROFILE_DEFAULT_INTERVAL,
|
||||
PROFILE_DEFAULT_FEATURES, PROFILE_DEFAULT_FEATURE_COUNT);
|
||||
}
|
||||
|
||||
void OS::RegisterStartHandler()
|
||||
|
@ -116,7 +116,7 @@ static inline void profile_set_frame_number(int frameNumber) {}
|
||||
static inline char* profiler_get_profile() { return nullptr; }
|
||||
|
||||
// Get the profile encoded as a JSON object.
|
||||
static inline JSObject* profiler_get_profile_object() { return nullptr; }
|
||||
static inline JSObject* profiler_get_profile_jsobject(JSContext* aCx) { return nullptr; }
|
||||
|
||||
// Get the features supported by the profiler that are accepted by profiler_init.
|
||||
// Returns a null terminated char* array.
|
||||
|
@ -198,6 +198,16 @@ char* profiler_get_profile()
|
||||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
JSObject* profiler_get_profile_jsobject(JSContext* aCx)
|
||||
{
|
||||
if (!sps_version2()) {
|
||||
return mozilla_sampler_get_profile_data1(aCx);
|
||||
} else {
|
||||
return mozilla_sampler_get_profile_data2(aCx);
|
||||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
const char** profiler_get_features()
|
||||
{
|
||||
|
@ -664,7 +664,7 @@ void nsViewManager::DidPaintWindow()
|
||||
void
|
||||
nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsView* aView, nsEventStatus* aStatus)
|
||||
{
|
||||
SAMPLE_LABEL("event", "nsViewManager::DispatchEvent");
|
||||
PROFILER_LABEL("event", "nsViewManager::DispatchEvent");
|
||||
|
||||
if ((NS_IS_MOUSE_EVENT(aEvent) &&
|
||||
// Ignore mouse events that we synthesize.
|
||||
|
@ -277,14 +277,14 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
||||
{
|
||||
EVLOG("nsAppShell::ProcessNextNativeEvent %d", mayWait);
|
||||
|
||||
SAMPLE_LABEL("nsAppShell", "ProcessNextNativeEvent");
|
||||
PROFILER_LABEL("nsAppShell", "ProcessNextNativeEvent");
|
||||
nsAutoPtr<AndroidGeckoEvent> curEvent;
|
||||
{
|
||||
MutexAutoLock lock(mCondLock);
|
||||
|
||||
curEvent = PopNextEvent();
|
||||
if (!curEvent && mayWait) {
|
||||
SAMPLE_LABEL("nsAppShell::ProcessNextNativeEvent", "Wait");
|
||||
PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent", "Wait");
|
||||
// hmm, should we really hardcode this 10s?
|
||||
#if defined(DEBUG_ANDROID_EVENTS)
|
||||
PRTime t0, t1;
|
||||
|
@ -352,7 +352,7 @@ void
|
||||
nsAppShell::ProcessGeckoEvents(void* aInfo)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
SAMPLE_LABEL("Events", "ProcessGeckoEvents");
|
||||
PROFILER_LABEL("Events", "ProcessGeckoEvents");
|
||||
nsAppShell* self = static_cast<nsAppShell*> (aInfo);
|
||||
|
||||
if (self->mRunningEventLoop) {
|
||||
|
@ -2582,7 +2582,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
SAMPLE_LABEL("widget", "ChildView::drawRect");
|
||||
PROFILER_LABEL("widget", "ChildView::drawRect");
|
||||
|
||||
nsIntRegion region;
|
||||
nsIntRect boundingRect = mGeckoChild->CocoaPointsToDevPixels(aRect);
|
||||
@ -2687,7 +2687,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
|
||||
- (void)drawUsingOpenGL
|
||||
{
|
||||
SAMPLE_LABEL("widget", "ChildView::drawUsingOpenGL");
|
||||
PROFILER_LABEL("widget", "ChildView::drawUsingOpenGL");
|
||||
|
||||
if (![self isUsingOpenGL] || !mGeckoChild->IsVisible())
|
||||
return;
|
||||
|
@ -711,12 +711,12 @@ nsAppShell::ScheduleNativeEventCallback()
|
||||
bool
|
||||
nsAppShell::ProcessNextNativeEvent(bool mayWait)
|
||||
{
|
||||
SAMPLE_LABEL("nsAppShell", "ProcessNextNativeEvent");
|
||||
PROFILER_LABEL("nsAppShell", "ProcessNextNativeEvent");
|
||||
epoll_event events[16] = {{ 0 }};
|
||||
|
||||
int event_count;
|
||||
{
|
||||
SAMPLE_LABEL("nsAppShell", "ProcessNextNativeEvent::Wait");
|
||||
PROFILER_LABEL("nsAppShell", "ProcessNextNativeEvent::Wait");
|
||||
if ((event_count = epoll_wait(epollfd, events, 16, mayWait ? -1 : 0)) <= 0)
|
||||
return true;
|
||||
}
|
||||
|
@ -2889,7 +2889,7 @@ nsCycleCollector_shutdown()
|
||||
MOZ_ASSERT(!sCollectorThread, "Should have finished before!");
|
||||
|
||||
if (sCollector) {
|
||||
SAMPLE_LABEL("CC", "nsCycleCollector_shutdown");
|
||||
PROFILER_LABEL("CC", "nsCycleCollector_shutdown");
|
||||
sCollector->Shutdown();
|
||||
delete sCollector;
|
||||
sCollector = nullptr;
|
||||
|
@ -318,7 +318,7 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
||||
nsIFile* binDirectory,
|
||||
nsIDirectoryServiceProvider* appFileLocationProvider)
|
||||
{
|
||||
SAMPLER_INIT();
|
||||
profiler_init();
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// We are not shutting down
|
||||
@ -648,7 +648,7 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
moduleLoaders = nullptr;
|
||||
}
|
||||
|
||||
SAMPLE_MARKER("Shutdown xpcom");
|
||||
PROFILER_MARKER("Shutdown xpcom");
|
||||
// If we are doing any shutdown checks, poison writes.
|
||||
if (gShutdownChecks != SCM_NOTHING) {
|
||||
mozilla::PoisonWrite();
|
||||
|
@ -494,7 +494,7 @@ void nsTimerImpl::Fire()
|
||||
if (mCanceled)
|
||||
return;
|
||||
|
||||
SAMPLE_LABEL("Timer", "Fire");
|
||||
PROFILER_LABEL("Timer", "Fire");
|
||||
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
#ifdef DEBUG_TIMERS
|
||||
|
Loading…
Reference in New Issue
Block a user