mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 792502 - Kill the FunctionTimer code; r=vlad
This commit is contained in:
parent
09e5ef62cd
commit
8cc30b88b2
@ -55,7 +55,6 @@
|
|||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "nsNPAPIPluginInstance.h"
|
#include "nsNPAPIPluginInstance.h"
|
||||||
#include "nsObjectFrame.h"
|
#include "nsObjectFrame.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
@ -88,7 +87,6 @@ bool nsAccessibilityService::gIsShutdown = true;
|
|||||||
nsAccessibilityService::nsAccessibilityService() :
|
nsAccessibilityService::nsAccessibilityService() :
|
||||||
nsAccDocManager(), FocusManager()
|
nsAccDocManager(), FocusManager()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAccessibilityService::~nsAccessibilityService()
|
nsAccessibilityService::~nsAccessibilityService()
|
||||||
|
13
configure.in
13
configure.in
@ -7265,19 +7265,6 @@ dnl =
|
|||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
MOZ_ARG_HEADER(Profiling and Instrumenting)
|
MOZ_ARG_HEADER(Profiling and Instrumenting)
|
||||||
|
|
||||||
dnl ========================================================
|
|
||||||
dnl = Enable NS_FUNCTION_TIMER, which provides Function
|
|
||||||
dnl = timing for identifying code bottlenecks
|
|
||||||
dnl = NS_FUNCTION_TIMER is off by default.
|
|
||||||
dnl ========================================================
|
|
||||||
MOZ_ARG_ENABLE_BOOL(functiontimer,
|
|
||||||
[ --enable-functiontimer Enable NS_FUNCTION_TIMER ],
|
|
||||||
NS_FUNCTION_TIMER=1,
|
|
||||||
NS_FUNCTION_TIMER= )
|
|
||||||
if test -n "$NS_FUNCTION_TIMER"; then
|
|
||||||
AC_DEFINE(NS_FUNCTION_TIMER)
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
dnl = Enable runtime visual profiling logger
|
dnl = Enable runtime visual profiling logger
|
||||||
dnl ========================================================
|
dnl ========================================================
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
#include "nsIDOMDOMStringList.h"
|
#include "nsIDOMDOMStringList.h"
|
||||||
#include "nsIDOMDOMImplementation.h"
|
#include "nsIDOMDOMImplementation.h"
|
||||||
#include "nsIDOMDocumentXBL.h"
|
#include "nsIDOMDocumentXBL.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsGenericElement.h"
|
#include "nsGenericElement.h"
|
||||||
#include "nsGenericHTMLElement.h"
|
#include "nsGenericHTMLElement.h"
|
||||||
#include "nsIDOMCDATASection.h"
|
#include "nsIDOMCDATASection.h"
|
||||||
@ -4238,7 +4237,6 @@ nsDocument::LookupImageElement(const nsAString& aId)
|
|||||||
void
|
void
|
||||||
nsDocument::DispatchContentLoadedEvents()
|
nsDocument::DispatchContentLoadedEvents()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
// If you add early returns from this method, make sure you're
|
// If you add early returns from this method, make sure you're
|
||||||
// calling UnblockOnload properly.
|
// calling UnblockOnload properly.
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@
|
|||||||
#include "nsCrossSiteListenerProxy.h"
|
#include "nsCrossSiteListenerProxy.h"
|
||||||
#include "nsSandboxFlags.h"
|
#include "nsSandboxFlags.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/CORSMode.h"
|
#include "mozilla/CORSMode.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
@ -702,8 +701,6 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
|
|||||||
nsAFlatString* script;
|
nsAFlatString* script;
|
||||||
nsAutoString textData;
|
nsAutoString textData;
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDocument> doc;
|
nsCOMPtr<nsIDocument> doc;
|
||||||
|
|
||||||
nsCOMPtr<nsINode> scriptElem = do_QueryInterface(aRequest->mElement);
|
nsCOMPtr<nsINode> scriptElem = do_QueryInterface(aRequest->mElement);
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "nsEventListenerManager.h"
|
#include "nsEventListenerManager.h"
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsMutationEvent.h"
|
#include "nsMutationEvent.h"
|
||||||
#include NEW_H
|
#include NEW_H
|
||||||
#include "nsFixedSizeAllocator.h"
|
#include "nsFixedSizeAllocator.h"
|
||||||
@ -461,12 +460,6 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
|
|||||||
NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
|
NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
|
||||||
NS_ERROR_DOM_INVALID_STATE_ERR);
|
NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
const char* timer_event_name = nsDOMEvent::GetEventName(aEvent->message);
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(20, "Dispatching '%s' event",
|
|
||||||
timer_event_name ? timer_event_name : "<other>");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTarget);
|
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTarget);
|
||||||
|
|
||||||
bool retargeted = false;
|
bool retargeted = false;
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIDOMElement.h"
|
#include "nsIDOMElement.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsContentUtils.h"
|
#include "nsContentUtils.h"
|
||||||
#include "nsIPresShell.h"
|
#include "nsIPresShell.h"
|
||||||
#include "nsIXMLContentSink.h"
|
#include "nsIXMLContentSink.h"
|
||||||
@ -996,8 +995,6 @@ nsBindingManager::ProcessAttachedQueue(uint32_t aSkipSize)
|
|||||||
if (mProcessingAttachedStack || mAttachedStack.Length() <= aSkipSize)
|
if (mProcessingAttachedStack || mAttachedStack.Length() <= aSkipSize)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
mProcessingAttachedStack = true;
|
mProcessingAttachedStack = true;
|
||||||
|
|
||||||
// Excute constructors. Do this from high index to low
|
// Excute constructors. Do this from high index to low
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsXBLProtoImplField.h"
|
#include "nsXBLProtoImplField.h"
|
||||||
#include "nsIScriptContext.h"
|
#include "nsIScriptContext.h"
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
@ -79,7 +78,6 @@ nsXBLProtoImplField::InstallField(nsIScriptContext* aContext,
|
|||||||
nsIURI* aBindingDocURI,
|
nsIURI* aBindingDocURI,
|
||||||
bool* aDidInstall) const
|
bool* aDidInstall) const
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(5);
|
|
||||||
NS_PRECONDITION(aBoundNode,
|
NS_PRECONDITION(aBoundNode,
|
||||||
"uh-oh, bound node should NOT be null or bad things will "
|
"uh-oh, bound node should NOT be null or bad things will "
|
||||||
"happen");
|
"happen");
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIScriptGlobalObject.h"
|
#include "nsIScriptGlobalObject.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "nsXBLProtoImplMethod.h"
|
#include "nsXBLProtoImplMethod.h"
|
||||||
@ -139,7 +138,6 @@ nsresult
|
|||||||
nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString& aClassStr,
|
nsXBLProtoImplMethod::CompileMember(nsIScriptContext* aContext, const nsCString& aClassStr,
|
||||||
JSObject* aClassObject)
|
JSObject* aClassObject)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(5);
|
|
||||||
NS_PRECONDITION(!IsCompiled(),
|
NS_PRECONDITION(!IsCompiled(),
|
||||||
"Trying to compile an already-compiled method");
|
"Trying to compile an already-compiled method");
|
||||||
NS_PRECONDITION(aClassObject,
|
NS_PRECONDITION(aClassObject,
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "nsIXMLContentSink.h"
|
#include "nsIXMLContentSink.h"
|
||||||
#include "nsContentCID.h"
|
#include "nsContentCID.h"
|
||||||
#include "nsXMLDocument.h"
|
#include "nsXMLDocument.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsIMemory.h"
|
#include "nsIMemory.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
@ -1067,8 +1066,6 @@ nsXBLService::FetchBindingDocument(nsIContent* aBoundElement, nsIDocument* aBoun
|
|||||||
nsIURI* aDocumentURI, nsIURI* aBindingURI,
|
nsIURI* aDocumentURI, nsIURI* aBindingURI,
|
||||||
bool aForceSyncLoad, nsIDocument** aResult)
|
bool aForceSyncLoad, nsIDocument** aResult)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
// Initialize our out pointer to nullptr
|
// Initialize our out pointer to nullptr
|
||||||
*aResult = nullptr;
|
*aResult = nullptr;
|
||||||
|
@ -58,7 +58,6 @@
|
|||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
#include "rdf.h"
|
#include "rdf.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsXBLService.h"
|
#include "nsXBLService.h"
|
||||||
#include "nsCExternalHandlerService.h"
|
#include "nsCExternalHandlerService.h"
|
||||||
#include "nsMimeTypes.h"
|
#include "nsMimeTypes.h"
|
||||||
@ -2816,7 +2815,6 @@ FirePendingMergeNotification(nsIURI* aKey, nsCOMPtr<nsIObserver>& aObserver, voi
|
|||||||
nsresult
|
nsresult
|
||||||
nsXULDocument::ResumeWalk()
|
nsXULDocument::ResumeWalk()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
// Walk the prototype and build the delegate content model. The
|
// Walk the prototype and build the delegate content model. The
|
||||||
// walk is performed in a top-down, left-to-right fashion. That
|
// walk is performed in a top-down, left-to-right fashion. That
|
||||||
// is, a parent is built before any of its children; a node is
|
// is, a parent is built before any of its children; a node is
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsIConsoleService.h"
|
#include "nsIConsoleService.h"
|
||||||
#include "nsIScriptError.h"
|
#include "nsIScriptError.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsIDOMScriptObjectFactory.h"
|
#include "nsIDOMScriptObjectFactory.h"
|
||||||
#include "nsDOMCID.h"
|
#include "nsDOMCID.h"
|
||||||
#include "nsNodeInfoManager.h"
|
#include "nsNodeInfoManager.h"
|
||||||
@ -245,7 +244,6 @@ nsXULPrototypeDocument::NewXULPDGlobalObject()
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
|
nsXULPrototypeDocument::Read(nsIObjectInputStream* aStream)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
rv = aStream->ReadObject(true, getter_AddRefs(mURI));
|
rv = aStream->ReadObject(true, getter_AddRefs(mURI));
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
#include "nsIAsyncVerifyRedirectCallback.h"
|
#include "nsIAsyncVerifyRedirectCallback.h"
|
||||||
#include "nsIUploadChannel.h"
|
#include "nsIUploadChannel.h"
|
||||||
#include "nsISecurityEventSink.h"
|
#include "nsISecurityEventSink.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsIScriptSecurityManager.h"
|
#include "nsIScriptSecurityManager.h"
|
||||||
#include "nsIJSContextStack.h"
|
#include "nsIJSContextStack.h"
|
||||||
#include "nsIScriptObjectPrincipal.h"
|
#include "nsIScriptObjectPrincipal.h"
|
||||||
@ -6662,8 +6661,6 @@ nsDocShell::EnsureContentViewer()
|
|||||||
if (mIsBeingDestroyed)
|
if (mIsBeingDestroyed)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> baseURI;
|
nsCOMPtr<nsIURI> baseURI;
|
||||||
nsIPrincipal* principal = GetInheritedPrincipal(false);
|
nsIPrincipal* principal = GetInheritedPrincipal(false);
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
nsCOMPtr<nsIDocShellTreeItem> parentItem;
|
||||||
@ -11200,8 +11197,6 @@ nsDocShell::EnsureScriptEnvironment()
|
|||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
NS_ASSERTION(!mInEnsureScriptEnv,
|
NS_ASSERTION(!mInEnsureScriptEnv,
|
||||||
"Infinite loop! Calling EnsureScriptEnvironment() from "
|
"Infinite loop! Calling EnsureScriptEnvironment() from "
|
||||||
|
@ -150,7 +150,6 @@
|
|||||||
#include "nsIDOMFile.h"
|
#include "nsIDOMFile.h"
|
||||||
#include "nsIDOMFileList.h"
|
#include "nsIDOMFileList.h"
|
||||||
#include "nsIURIFixup.h"
|
#include "nsIURIFixup.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsCDefaultURIFixup.h"
|
#include "nsCDefaultURIFixup.h"
|
||||||
#include "nsEventDispatcher.h"
|
#include "nsEventDispatcher.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
@ -198,7 +197,6 @@
|
|||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsXPCOMCID.h"
|
#include "nsXPCOMCID.h"
|
||||||
#include "GeneratedEvents.h"
|
#include "GeneratedEvents.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozIThirdPartyUtil.h"
|
#include "mozIThirdPartyUtil.h"
|
||||||
|
|
||||||
#ifdef MOZ_LOGGING
|
#ifdef MOZ_LOGGING
|
||||||
@ -1735,8 +1733,6 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
|
|||||||
nsISupports* aState,
|
nsISupports* aState,
|
||||||
bool aForceReuseInnerWindow)
|
bool aForceReuseInnerWindow)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_PRECONDITION(mDocumentPrincipal == nullptr,
|
NS_PRECONDITION(mDocumentPrincipal == nullptr,
|
||||||
"mDocumentPrincipal prematurely set!");
|
"mDocumentPrincipal prematurely set!");
|
||||||
MOZ_ASSERT(aDocument);
|
MOZ_ASSERT(aDocument);
|
||||||
@ -9604,8 +9600,6 @@ nsGlobalWindow::RunTimeoutHandler(nsTimeout* aTimeout,
|
|||||||
uint32_t lineNo = 0;
|
uint32_t lineNo = 0;
|
||||||
handler->GetLocation(&filename, &lineNo);
|
handler->GetLocation(&filename, &lineNo);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("(file: %s, line: %d)", filename, lineNo);
|
|
||||||
|
|
||||||
bool is_undefined;
|
bool is_undefined;
|
||||||
aScx->EvaluateString(nsDependentString(script), FastGetGlobalJSObject(),
|
aScx->EvaluateString(nsDependentString(script), FastGetGlobalJSObject(),
|
||||||
timeout->mPrincipal, timeout->mPrincipal,
|
timeout->mPrincipal, timeout->mPrincipal,
|
||||||
@ -9737,8 +9731,6 @@ nsGlobalWindow::RunTimeout(nsTimeout *aTimeout)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_ASSERTION(IsInnerWindow(), "Timeout running on outer window!");
|
NS_ASSERTION(IsInnerWindow(), "Timeout running on outer window!");
|
||||||
NS_ASSERTION(!IsFrozen(), "Timeout running on a window in the bfcache!");
|
NS_ASSERTION(!IsFrozen(), "Timeout running on a window in the bfcache!");
|
||||||
|
|
||||||
|
@ -75,7 +75,6 @@
|
|||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
#include "prthread.h"
|
#include "prthread.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/dom/BindingUtils.h"
|
#include "mozilla/dom/BindingUtils.h"
|
||||||
@ -1236,9 +1235,6 @@ nsJSContext::EvaluateStringWithValue(const nsAString& aScript,
|
|||||||
JS::Value* aRetValue,
|
JS::Value* aRetValue,
|
||||||
bool* aIsUndefined)
|
bool* aIsUndefined)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, aURL, aLineNo);
|
|
||||||
|
|
||||||
SAMPLE_LABEL("JS", "EvaluateStringWithValue");
|
SAMPLE_LABEL("JS", "EvaluateStringWithValue");
|
||||||
NS_ABORT_IF_FALSE(aScopeObject,
|
NS_ABORT_IF_FALSE(aScopeObject,
|
||||||
"Shouldn't call EvaluateStringWithValue with null scope object.");
|
"Shouldn't call EvaluateStringWithValue with null scope object.");
|
||||||
@ -1422,9 +1418,6 @@ nsJSContext::EvaluateString(const nsAString& aScript,
|
|||||||
nsAString *aRetValue,
|
nsAString *aRetValue,
|
||||||
bool* aIsUndefined)
|
bool* aIsUndefined)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, aURL, aLineNo);
|
|
||||||
|
|
||||||
SAMPLE_LABEL("JS", "EvaluateString");
|
SAMPLE_LABEL("JS", "EvaluateString");
|
||||||
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
||||||
@ -1739,9 +1732,6 @@ nsJSContext::CompileEventHandler(nsIAtom *aName,
|
|||||||
uint32_t aVersion,
|
uint32_t aVersion,
|
||||||
nsScriptObjectHolder<JSObject>& aHandler)
|
nsScriptObjectHolder<JSObject>& aHandler)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (url: %s, line: %d)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, aURL, aLineNo);
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
NS_ENSURE_TRUE(mIsInitialized, NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
||||||
NS_PRECONDITION(AtomIsEventHandlerName(aName), "Bad event name");
|
NS_PRECONDITION(AtomIsEventHandlerName(aName), "Bad event name");
|
||||||
@ -1801,9 +1791,6 @@ nsJSContext::CompileFunction(JSObject* aTarget,
|
|||||||
bool aShared,
|
bool aShared,
|
||||||
JSObject** aFunctionObject)
|
JSObject** aFunctionObject)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_FMT(1.0, "%s (line %d) (function: %s, url: %s, line: %d)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, aName.BeginReading(), aURL, aLineNo);
|
|
||||||
|
|
||||||
NS_ABORT_IF_FALSE(aFunctionObject,
|
NS_ABORT_IF_FALSE(aFunctionObject,
|
||||||
"Shouldn't call CompileFunction with null return value.");
|
"Shouldn't call CompileFunction with null return value.");
|
||||||
|
|
||||||
@ -1860,17 +1847,6 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, JSObject* aScope,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
{
|
|
||||||
JSObject *obj = aHandler;
|
|
||||||
if (js::IsFunctionProxy(obj))
|
|
||||||
obj = js::UnwrapObject(obj);
|
|
||||||
JSString *id = JS_GetFunctionId(static_cast<JSFunction *>(JS_GetPrivate(obj)));
|
|
||||||
JSAutoByteString bytes;
|
|
||||||
const char *name = !id ? "anonymous" : bytes.encode(mContext, id) ? bytes.ptr() : "<error>";
|
|
||||||
NS_TIME_FUNCTION_FMT(1.0, "%s (line %d) (function: %s)", MOZ_FUNCTION_NAME, __LINE__, name);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
SAMPLE_LABEL("JS", "CallEventHandler");
|
SAMPLE_LABEL("JS", "CallEventHandler");
|
||||||
|
|
||||||
nsAutoMicroTask mt;
|
nsAutoMicroTask mt;
|
||||||
@ -2022,8 +1998,6 @@ nsresult
|
|||||||
nsJSContext::Deserialize(nsIObjectInputStream* aStream,
|
nsJSContext::Deserialize(nsIObjectInputStream* aStream,
|
||||||
nsScriptObjectHolder<JSScript>& aResult)
|
nsScriptObjectHolder<JSScript>& aResult)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
JSScript *script;
|
JSScript *script;
|
||||||
nsresult rv = nsContentUtils::XPConnect()->ReadScript(aStream, mContext, &script);
|
nsresult rv = nsContentUtils::XPConnect()->ReadScript(aStream, mContext, &script);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
@ -2908,7 +2882,6 @@ nsJSContext::GarbageCollectNow(js::gcreason::Reason aReason,
|
|||||||
IsShrinking aShrinking,
|
IsShrinking aShrinking,
|
||||||
int64_t aSliceMillis)
|
int64_t aSliceMillis)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
SAMPLE_LABEL("GC", "GarbageCollectNow");
|
SAMPLE_LABEL("GC", "GarbageCollectNow");
|
||||||
|
|
||||||
MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC);
|
MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC);
|
||||||
@ -2976,7 +2949,6 @@ nsJSContext::GarbageCollectNow(js::gcreason::Reason aReason,
|
|||||||
void
|
void
|
||||||
nsJSContext::ShrinkGCBuffersNow()
|
nsJSContext::ShrinkGCBuffersNow()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
SAMPLE_LABEL("GC", "ShrinkGCBuffersNow");
|
SAMPLE_LABEL("GC", "ShrinkGCBuffersNow");
|
||||||
|
|
||||||
KillShrinkGCBuffersTimer();
|
KillShrinkGCBuffersTimer();
|
||||||
@ -3079,7 +3051,6 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SAMPLE_LABEL("GC", "CycleCollectNow");
|
SAMPLE_LABEL("GC", "CycleCollectNow");
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
KillCCTimer();
|
KillCCTimer();
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "mozFlushType.h" // for mozFlushType::Flush_Frames
|
#include "mozFlushType.h" // for mozFlushType::Flush_Frames
|
||||||
#include "mozISpellCheckingEngine.h"
|
#include "mozISpellCheckingEngine.h"
|
||||||
#include "mozInlineSpellChecker.h" // for mozInlineSpellChecker
|
#include "mozInlineSpellChecker.h" // for mozInlineSpellChecker
|
||||||
#include "mozilla/FunctionTimer.h" // for NS_TIME_FUNCTION
|
|
||||||
#include "mozilla/Preferences.h" // for Preferences
|
#include "mozilla/Preferences.h" // for Preferences
|
||||||
#include "mozilla/Selection.h" // for Selection, etc
|
#include "mozilla/Selection.h" // for Selection, etc
|
||||||
#include "mozilla/Services.h" // for GetObserverService
|
#include "mozilla/Services.h" // for GetObserverService
|
||||||
@ -1311,8 +1310,6 @@ NS_IMETHODIMP nsEditor::Observe(nsISupports* aSubj, const char *aTopic,
|
|||||||
|
|
||||||
NS_IMETHODIMP nsEditor::SyncRealTimeSpell()
|
NS_IMETHODIMP nsEditor::SyncRealTimeSpell()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
bool enable = GetDesiredSpellCheckState();
|
bool enable = GetDesiredSpellCheckState();
|
||||||
|
|
||||||
// Initializes mInlineSpellChecker
|
// Initializes mInlineSpellChecker
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Selection.h"
|
#include "mozilla/Selection.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
@ -118,8 +117,6 @@ NS_IMETHODIMP nsPlaintextEditor::Init(nsIDOMDocument *aDoc,
|
|||||||
nsISelectionController *aSelCon,
|
nsISelectionController *aSelCon,
|
||||||
uint32_t aFlags)
|
uint32_t aFlags)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_PRECONDITION(aDoc, "bad arg");
|
NS_PRECONDITION(aDoc, "bad arg");
|
||||||
NS_ENSURE_TRUE(aDoc, NS_ERROR_NULL_POINTER);
|
NS_ENSURE_TRUE(aDoc, NS_ERROR_NULL_POINTER);
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "nsAppStartupNotifier.h"
|
#include "nsAppStartupNotifier.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS1(nsAppStartupNotifier, nsIObserver)
|
NS_IMPL_ISUPPORTS1(nsAppStartupNotifier, nsIObserver)
|
||||||
|
|
||||||
@ -26,8 +25,6 @@ nsAppStartupNotifier::~nsAppStartupNotifier()
|
|||||||
|
|
||||||
NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
|
NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_ENSURE_ARG(aTopic);
|
NS_ENSURE_ARG(aTopic);
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
@ -41,8 +38,6 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a
|
|||||||
getter_AddRefs(enumerator));
|
getter_AddRefs(enumerator));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("EnumerateCategory");
|
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> entry;
|
nsCOMPtr<nsISupports> entry;
|
||||||
while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) {
|
while (NS_SUCCEEDED(enumerator->GetNext(getter_AddRefs(entry)))) {
|
||||||
nsCOMPtr<nsISupportsCString> category = do_QueryInterface(entry, &rv);
|
nsCOMPtr<nsISupportsCString> category = do_QueryInterface(entry, &rv);
|
||||||
@ -87,8 +82,6 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("observer: category: %s cid: %s", categoryEntry.get(), nsPromiseFlatCString(contractId).get());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
#include "TexturePoolOGL.h"
|
#include "TexturePoolOGL.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Assertions.h"
|
#include "mozilla/Assertions.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
@ -1361,8 +1360,6 @@ qcms_profile *
|
|||||||
gfxPlatform::GetCMSOutputProfile()
|
gfxPlatform::GetCMSOutputProfile()
|
||||||
{
|
{
|
||||||
if (!gCMSOutputProfile) {
|
if (!gCMSOutputProfile) {
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
/* Determine if we're using the internal override to force sRGB as
|
/* Determine if we're using the internal override to force sRGB as
|
||||||
an output profile for reftests. See Bug 452125.
|
an output profile for reftests. See Bug 452125.
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
#include "nsIMemoryReporter.h"
|
#include "nsIMemoryReporter.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
class CharMapHashKey : public PLDHashEntryHdr
|
class CharMapHashKey : public PLDHashEntryHdr
|
||||||
@ -89,8 +88,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static nsresult Init() {
|
static nsresult Init() {
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_ASSERTION(!sPlatformFontList, "What's this doing here?");
|
NS_ASSERTION(!sPlatformFontList, "What's this doing here?");
|
||||||
gfxPlatform::GetPlatform()->CreatePlatformFontList();
|
gfxPlatform::GetPlatform()->CreatePlatformFontList();
|
||||||
if (!sPlatformFontList) {
|
if (!sPlatformFontList) {
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
#include "ImageLogging.h"
|
#include "ImageLogging.h"
|
||||||
@ -868,8 +867,6 @@ void imgLoader::GlobalInit()
|
|||||||
|
|
||||||
nsresult imgLoader::InitCache()
|
nsresult imgLoader::InitCache()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||||
if (!os)
|
if (!os)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
@ -68,7 +68,6 @@
|
|||||||
|
|
||||||
#include "jsdbgapi.h"
|
#include "jsdbgapi.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
using namespace mozilla::scache;
|
using namespace mozilla::scache;
|
||||||
@ -388,7 +387,6 @@ NS_IMPL_ISUPPORTS3(mozJSComponentLoader,
|
|||||||
nsresult
|
nsresult
|
||||||
mozJSComponentLoader::ReallyInit()
|
mozJSComponentLoader::ReallyInit()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
|
|
||||||
@ -464,11 +462,6 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile)
|
|||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
NS_TIME_FUNCTION_FMT("%s (line %d) (file: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, spec.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!mInitialized) {
|
if (!mInitialized) {
|
||||||
rv = ReallyInit();
|
rv = ReallyInit();
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
@ -974,9 +967,6 @@ mozJSComponentLoader::Import(const nsACString& registryLocation,
|
|||||||
uint8_t optionalArgc,
|
uint8_t optionalArgc,
|
||||||
JS::Value* retval)
|
JS::Value* retval)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_FMT("%s (line %d) (file: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, registryLocation.BeginReading());
|
|
||||||
|
|
||||||
JSAutoRequest ar(cx);
|
JSAutoRequest ar(cx);
|
||||||
|
|
||||||
JS::Value targetVal = targetVal_;
|
JS::Value targetVal = targetVal_;
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include "jsfriendapi.h"
|
#include "jsfriendapi.h"
|
||||||
#include "nsJSPrincipals.h"
|
#include "nsJSPrincipals.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/scache/StartupCache.h"
|
#include "mozilla/scache/StartupCache.h"
|
||||||
#include "mozilla/scache/StartupCacheUtils.h"
|
#include "mozilla/scache/StartupCacheUtils.h"
|
||||||
|
|
||||||
@ -155,11 +154,6 @@ mozJSSubScriptLoader::LoadSubScript(const nsAString& url,
|
|||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
NS_TIME_FUNCTION_FMT("%s (line %d) (url: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, NS_LossyConvertUTF16toASCII(url).get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* set the system principal if it's not here already */
|
/* set the system principal if it's not here already */
|
||||||
if (!mSystemPrincipal) {
|
if (!mSystemPrincipal) {
|
||||||
nsCOMPtr<nsIScriptSecurityManager> secman =
|
nsCOMPtr<nsIScriptSecurityManager> secman =
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include "nsIMemoryReporter.h"
|
#include "nsIMemoryReporter.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "prsystem.h"
|
#include "prsystem.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
@ -2103,7 +2102,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
|
|||||||
JS_NewDHashTable(JS_DHashGetStubOps(), nullptr,
|
JS_NewDHashTable(JS_DHashGetStubOps(), nullptr,
|
||||||
sizeof(JSDHashEntryStub), 128);
|
sizeof(JSDHashEntryStub), 128);
|
||||||
#endif
|
#endif
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
DOM_InitInterfaces();
|
DOM_InitInterfaces();
|
||||||
Preferences::AddBoolVarCache(&gNewDOMBindingsEnabled, "dom.new_bindings",
|
Preferences::AddBoolVarCache(&gNewDOMBindingsEnabled, "dom.new_bindings",
|
||||||
@ -2225,8 +2223,6 @@ bool InternStaticDictionaryJSVals(JSContext* aCx);
|
|||||||
JSBool
|
JSBool
|
||||||
XPCJSRuntime::OnJSContextNew(JSContext *cx)
|
XPCJSRuntime::OnJSContextNew(JSContext *cx)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
// if it is our first context then we need to generate our string ids
|
// if it is our first context then we need to generate our string ids
|
||||||
JSBool ok = true;
|
JSBool ok = true;
|
||||||
if (JSID_IS_VOID(mStrIDs[0])) {
|
if (JSID_IS_VOID(mStrIDs[0])) {
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIContentViewerContainer.h"
|
#include "nsIContentViewerContainer.h"
|
||||||
#include "nsIContentViewer.h"
|
#include "nsIContentViewer.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsIDocumentViewerPrint.h"
|
#include "nsIDocumentViewerPrint.h"
|
||||||
#include "nsIDOMBeforeUnloadEvent.h"
|
#include "nsIDOMBeforeUnloadEvent.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
@ -960,7 +959,6 @@ void DocumentViewerImpl::SetNavigationTiming(nsDOMNavigationTiming* timing)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
DocumentViewerImpl::LoadComplete(nsresult aStatus)
|
DocumentViewerImpl::LoadComplete(nsresult aStatus)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
/* We need to protect ourself against auto-destruction in case the
|
/* We need to protect ourself against auto-destruction in case the
|
||||||
window is closed while processing the OnLoad event. See bug
|
window is closed while processing the OnLoad event. See bug
|
||||||
http://bugzilla.mozilla.org/show_bug.cgi?id=78445 for more
|
http://bugzilla.mozilla.org/show_bug.cgi?id=78445 for more
|
||||||
|
@ -169,7 +169,6 @@
|
|||||||
#include "imgIEncoder.h"
|
#include "imgIEncoder.h"
|
||||||
#include "gfxPlatform.h"
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "sampler.h"
|
#include "sampler.h"
|
||||||
@ -178,20 +177,6 @@
|
|||||||
#include "Layers.h"
|
#include "Layers.h"
|
||||||
#include "nsAsyncDOMEvent.h"
|
#include "nsAsyncDOMEvent.h"
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
#define NS_TIME_FUNCTION_DECLARE_DOCURL \
|
|
||||||
nsAutoCString docURL__("N/A"); \
|
|
||||||
nsIURI *uri__ = mDocument->GetDocumentURI(); \
|
|
||||||
if (uri__) uri__->GetSpec(docURL__);
|
|
||||||
#define NS_TIME_FUNCTION_WITH_DOCURL \
|
|
||||||
NS_TIME_FUNCTION_DECLARE_DOCURL \
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, \
|
|
||||||
"%s (line %d) (document: %s)", MOZ_FUNCTION_NAME, \
|
|
||||||
__LINE__, docURL__.get())
|
|
||||||
#else
|
|
||||||
#define NS_TIME_FUNCTION_WITH_DOCURL do{} while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ANCHOR_SCROLL_FLAGS (SCROLL_OVERFLOW_HIDDEN | SCROLL_NO_PARENT_FRAMES)
|
#define ANCHOR_SCROLL_FLAGS (SCROLL_OVERFLOW_HIDDEN | SCROLL_NO_PARENT_FRAMES)
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
@ -781,8 +766,6 @@ PresShell::Init(nsIDocument* aDocument,
|
|||||||
nsStyleSet* aStyleSet,
|
nsStyleSet* aStyleSet,
|
||||||
nsCompatibility aCompatMode)
|
nsCompatibility aCompatMode)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_PRECONDITION(nullptr != aDocument, "null ptr");
|
NS_PRECONDITION(nullptr != aDocument, "null ptr");
|
||||||
NS_PRECONDITION(nullptr != aPresContext, "null ptr");
|
NS_PRECONDITION(nullptr != aPresContext, "null ptr");
|
||||||
NS_PRECONDITION(nullptr != aViewManager, "null ptr");
|
NS_PRECONDITION(nullptr != aViewManager, "null ptr");
|
||||||
@ -918,8 +901,6 @@ PresShell::Init(nsIDocument* aDocument,
|
|||||||
void
|
void
|
||||||
PresShell::Destroy()
|
PresShell::Destroy()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||||
"destroy called on presshell while scripts not blocked");
|
"destroy called on presshell while scripts not blocked");
|
||||||
|
|
||||||
@ -1115,8 +1096,6 @@ nsIPresShell::GetAuthorStyleDisabled() const
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::SetPreferenceStyleRules(bool aForceReflow)
|
PresShell::SetPreferenceStyleRules(bool aForceReflow)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
if (!mDocument) {
|
if (!mDocument) {
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
@ -1206,8 +1185,6 @@ nsresult PresShell::ClearPreferenceStyleRules(void)
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::CreatePreferenceStyleSheet()
|
PresShell::CreatePreferenceStyleSheet()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ASSERTION(!mPrefStyleSheet, "prefStyleSheet already exists");
|
NS_ASSERTION(!mPrefStyleSheet, "prefStyleSheet already exists");
|
||||||
mPrefStyleSheet = new nsCSSStyleSheet(CORS_NONE);
|
mPrefStyleSheet = new nsCSSStyleSheet(CORS_NONE);
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
@ -1247,8 +1224,6 @@ static uint32_t sInsertPrefSheetRulesAt = 2;
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::SetPrefNoScriptRule()
|
PresShell::SetPrefNoScriptRule()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
// also handle the case where print is done from print preview
|
// also handle the case where print is done from print preview
|
||||||
@ -1276,8 +1251,6 @@ PresShell::SetPrefNoScriptRule()
|
|||||||
|
|
||||||
nsresult PresShell::SetPrefNoFramesRule(void)
|
nsresult PresShell::SetPrefNoFramesRule(void)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
||||||
if (!mPresContext) {
|
if (!mPresContext) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -1313,8 +1286,6 @@ nsresult PresShell::SetPrefNoFramesRule(void)
|
|||||||
|
|
||||||
nsresult PresShell::SetPrefLinkRules(void)
|
nsresult PresShell::SetPrefLinkRules(void)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
||||||
if (!mPresContext) {
|
if (!mPresContext) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -1390,8 +1361,6 @@ nsresult PresShell::SetPrefLinkRules(void)
|
|||||||
|
|
||||||
nsresult PresShell::SetPrefFocusRules(void)
|
nsresult PresShell::SetPrefFocusRules(void)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
NS_ASSERTION(mPresContext,"null prescontext not allowed");
|
||||||
nsresult result = NS_OK;
|
nsresult result = NS_OK;
|
||||||
|
|
||||||
@ -1628,7 +1597,6 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
|
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
|
||||||
|
|
||||||
NS_ASSERTION(!mDidInitialize, "Why are we being called?");
|
NS_ASSERTION(!mDidInitialize, "Why are we being called?");
|
||||||
@ -1709,8 +1677,6 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
|||||||
// Run the XBL binding constructors for any new frames we've constructed
|
// Run the XBL binding constructors for any new frames we've constructed
|
||||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("XBL binding constructors fired");
|
|
||||||
|
|
||||||
// Constructors may have killed us too
|
// Constructors may have killed us too
|
||||||
NS_ENSURE_STATE(!mHaveShutDown);
|
NS_ENSURE_STATE(!mHaveShutDown);
|
||||||
|
|
||||||
@ -1971,8 +1937,6 @@ PresShell::SetIgnoreFrameDestruction(bool aIgnore)
|
|||||||
void
|
void
|
||||||
PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
|
PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
if (!mIgnoreFrameDestruction) {
|
if (!mIgnoreFrameDestruction) {
|
||||||
mDocument->StyleImageLoader()->DropRequestsForFrame(aFrame);
|
mDocument->StyleImageLoader()->DropRequestsForFrame(aFrame);
|
||||||
|
|
||||||
@ -2475,15 +2439,6 @@ void
|
|||||||
PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty,
|
||||||
nsFrameState aBitToAdd)
|
nsFrameState aBitToAdd)
|
||||||
{
|
{
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
NS_TIME_FUNCTION_DECLARE_DOCURL;
|
|
||||||
nsAutoCString frameType__("N/A");
|
|
||||||
nsIAtom *atomType__ = aFrame ? aFrame->GetType() : nullptr;
|
|
||||||
if (atomType__) atomType__->ToUTF8String(frameType__);
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, frame type: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, docURL__.get(), frameType__.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
NS_PRECONDITION(aBitToAdd == NS_FRAME_IS_DIRTY ||
|
NS_PRECONDITION(aBitToAdd == NS_FRAME_IS_DIRTY ||
|
||||||
aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN,
|
aBitToAdd == NS_FRAME_HAS_DIRTY_CHILDREN,
|
||||||
"Unexpected bits being added");
|
"Unexpected bits being added");
|
||||||
@ -2703,8 +2658,6 @@ PresShell::CancelAllPendingReflows()
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::RecreateFramesFor(nsIContent* aContent)
|
PresShell::RecreateFramesFor(nsIContent* aContent)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(mPresContext, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(mPresContext, NS_ERROR_FAILURE);
|
||||||
if (!mDidInitialize) {
|
if (!mDidInitialize) {
|
||||||
// Nothing to do here. In fact, if we proceed and aContent is the
|
// Nothing to do here. In fact, if we proceed and aContent is the
|
||||||
@ -2767,8 +2720,6 @@ PresShell::ClearFrameRefs(nsIFrame* aFrame)
|
|||||||
already_AddRefed<nsRenderingContext>
|
already_AddRefed<nsRenderingContext>
|
||||||
PresShell::GetReferenceRenderingContext()
|
PresShell::GetReferenceRenderingContext()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
nsDeviceContext* devCtx = mPresContext->DeviceContext();
|
nsDeviceContext* devCtx = mPresContext->DeviceContext();
|
||||||
nsRefPtr<nsRenderingContext> rc;
|
nsRefPtr<nsRenderingContext> rc;
|
||||||
if (mPresContext->IsScreen()) {
|
if (mPresContext->IsScreen()) {
|
||||||
@ -3512,8 +3463,6 @@ nsIPresShell::ClearMouseCapture(nsIFrame* aFrame)
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, bool aLeavingPage)
|
PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, bool aLeavingPage)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
NS_PRECONDITION(nullptr != aState, "null state pointer");
|
NS_PRECONDITION(nullptr != aState, "null state pointer");
|
||||||
@ -3765,19 +3714,6 @@ PresShell::FlushPendingNotifications(mozFlushType aType)
|
|||||||
* SetNeedStyleFlush calls on the document.
|
* SetNeedStyleFlush calls on the document.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
NS_TIME_FUNCTION_DECLARE_DOCURL;
|
|
||||||
static const char *flushTypeNames[] = {
|
|
||||||
"Flush_Content",
|
|
||||||
"Flush_ContentAndNotify",
|
|
||||||
"Flush_Styles",
|
|
||||||
"Flush_InterruptibleLayout",
|
|
||||||
"Flush_Layout",
|
|
||||||
"Flush_Display"
|
|
||||||
};
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, type: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, docURL__.get(), flushTypeNames[aType - 1]);
|
|
||||||
#endif
|
|
||||||
SAMPLE_LABEL("layout", "FlushPendingNotifications");
|
SAMPLE_LABEL("layout", "FlushPendingNotifications");
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
#ifdef ACCESSIBILITY
|
||||||
@ -4281,8 +4217,6 @@ PresShell::RenderDocument(const nsRect& aRect, uint32_t aFlags,
|
|||||||
nscolor aBackgroundColor,
|
nscolor aBackgroundColor,
|
||||||
gfxContext* aThebesContext)
|
gfxContext* aThebesContext)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(!(aFlags & RENDER_IS_UNTRUSTED), NS_ERROR_NOT_IMPLEMENTED);
|
NS_ENSURE_TRUE(!(aFlags & RENDER_IS_UNTRUSTED), NS_ERROR_NOT_IMPLEMENTED);
|
||||||
|
|
||||||
nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
|
nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
|
||||||
@ -4426,8 +4360,6 @@ PresShell::ClipListToRange(nsDisplayListBuilder *aBuilder,
|
|||||||
nsDisplayList* aList,
|
nsDisplayList* aList,
|
||||||
nsRange* aRange)
|
nsRange* aRange)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
|
|
||||||
// iterate though the display items and add up the bounding boxes of each.
|
// iterate though the display items and add up the bounding boxes of each.
|
||||||
// This will allow the total area of the frames within the range to be
|
// This will allow the total area of the frames within the range to be
|
||||||
// determined. To do this, remove an item from the bottom of the list, check
|
// determined. To do this, remove an item from the bottom of the list, check
|
||||||
@ -4533,8 +4465,6 @@ PresShell::CreateRangePaintInfo(nsIDOMRange* aRange,
|
|||||||
nsRect& aSurfaceRect,
|
nsRect& aSurfaceRect,
|
||||||
bool aForPrimarySelection)
|
bool aForPrimarySelection)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
|
|
||||||
RangePaintInfo* info = nullptr;
|
RangePaintInfo* info = nullptr;
|
||||||
|
|
||||||
nsRange* range = static_cast<nsRange*>(aRange);
|
nsRange* range = static_cast<nsRange*>(aRange);
|
||||||
@ -4620,8 +4550,6 @@ PresShell::PaintRangePaintInfo(nsTArray<nsAutoPtr<RangePaintInfo> >* aItems,
|
|||||||
nsIntPoint& aPoint,
|
nsIntPoint& aPoint,
|
||||||
nsIntRect* aScreenRect)
|
nsIntRect* aScreenRect)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
|
|
||||||
nsPresContext* pc = GetPresContext();
|
nsPresContext* pc = GetPresContext();
|
||||||
if (!pc || aArea.width == 0 || aArea.height == 0)
|
if (!pc || aArea.width == 0 || aArea.height == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -5251,17 +5179,6 @@ PresShell::Paint(nsIView* aViewToPaint,
|
|||||||
PaintType aType,
|
PaintType aType,
|
||||||
bool aWillSendDidPaint)
|
bool aWillSendDidPaint)
|
||||||
{
|
{
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
NS_TIME_FUNCTION_DECLARE_DOCURL;
|
|
||||||
const nsRect& bounds__ = aDirtyRegion.GetBounds();
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(1.0, "%s (line %d) (document: %s, dirty rect: (<%f, %f>, <%f, %f>)",
|
|
||||||
MOZ_FUNCTION_NAME, __LINE__, docURL__.get(),
|
|
||||||
NSCoordToFloat(bounds__.x),
|
|
||||||
NSCoordToFloat(bounds__.y),
|
|
||||||
NSCoordToFloat(bounds__.XMost()),
|
|
||||||
NSCoordToFloat(bounds__.YMost()));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SAMPLE_LABEL("Paint", "PresShell::Paint");
|
SAMPLE_LABEL("Paint", "PresShell::Paint");
|
||||||
NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
|
NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
|
||||||
NS_ASSERTION(aViewToPaint, "null view");
|
NS_ASSERTION(aViewToPaint, "null view");
|
||||||
@ -5678,8 +5595,6 @@ PresShell::HandleEvent(nsIFrame *aFrame,
|
|||||||
if (!nsContentUtils::IsSafeToRunScript())
|
if (!nsContentUtils::IsSafeToRunScript())
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
nsIContent* capturingContent =
|
nsIContent* capturingContent =
|
||||||
NS_IS_MOUSE_EVENT(aEvent) || aEvent->eventStructType == NS_WHEEL_EVENT ?
|
NS_IS_MOUSE_EVENT(aEvent) || aEvent->eventStructType == NS_WHEEL_EVENT ?
|
||||||
GetCapturingContent() : nullptr;
|
GetCapturingContent() : nullptr;
|
||||||
@ -6274,8 +6189,6 @@ static bool CanHandleContextMenuEvent(nsMouseEvent* aMouseEvent,
|
|||||||
nsresult
|
nsresult
|
||||||
PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
|
PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN(1.0);
|
|
||||||
|
|
||||||
nsRefPtr<nsEventStateManager> manager = mPresContext->EventStateManager();
|
nsRefPtr<nsEventStateManager> manager = mPresContext->EventStateManager();
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
@ -7353,8 +7266,6 @@ PresShell::ScheduleReflowOffTimer()
|
|||||||
bool
|
bool
|
||||||
PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
PresShell::DoReflow(nsIFrame* target, bool aInterruptible)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
|
|
||||||
nsAutoCString docURL("N/A");
|
nsAutoCString docURL("N/A");
|
||||||
nsIURI *uri = mDocument->GetDocumentURI();
|
nsIURI *uri = mDocument->GetDocumentURI();
|
||||||
if (uri)
|
if (uri)
|
||||||
@ -7550,7 +7461,6 @@ PresShell::ProcessReflowCommands(bool aInterruptible)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_WITH_DOCURL;
|
|
||||||
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
|
mozilla::TimeStamp timerStart = mozilla::TimeStamp::Now();
|
||||||
bool interrupted = false;
|
bool interrupted = false;
|
||||||
if (!mDirtyRoots.IsEmpty()) {
|
if (!mDirtyRoots.IsEmpty()) {
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "nsCharsetSource.h"
|
#include "nsCharsetSource.h"
|
||||||
#include "nsMimeTypes.h"
|
#include "nsMimeTypes.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
// plugins
|
// plugins
|
||||||
#include "nsIPluginHost.h"
|
#include "nsIPluginHost.h"
|
||||||
@ -145,16 +144,6 @@ nsContentDLF::CreateInstance(const char* aCommand,
|
|||||||
nsIStreamListener** aDocListener,
|
nsIStreamListener** aDocListener,
|
||||||
nsIContentViewer** aDocViewer)
|
nsIContentViewer** aDocViewer)
|
||||||
{
|
{
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsAutoCString channelURL__("N/A");
|
|
||||||
nsCOMPtr<nsIURI> url__;
|
|
||||||
if (aChannel && NS_SUCCEEDED(aChannel->GetURI(getter_AddRefs(url__)))) {
|
|
||||||
url__->GetSpec(channelURL__);
|
|
||||||
}
|
|
||||||
NS_TIME_FUNCTION_FMT("%s (line %d) (url: %s)", MOZ_FUNCTION_NAME,
|
|
||||||
__LINE__, channelURL__.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Declare "type" here. This is because although the variable itself only
|
// Declare "type" here. This is because although the variable itself only
|
||||||
// needs limited scope, we need to use the raw string memory -- as returned
|
// needs limited scope, we need to use the raw string memory -- as returned
|
||||||
// by "type.get()" farther down in the function.
|
// by "type.get()" farther down in the function.
|
||||||
@ -297,8 +286,6 @@ nsContentDLF::CreateInstanceForDocument(nsISupports* aContainer,
|
|||||||
const char *aCommand,
|
const char *aCommand,
|
||||||
nsIContentViewer** aContentViewer)
|
nsIContentViewer** aContentViewer)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||||
nsresult rv = NS_NewContentViewer(getter_AddRefs(contentViewer));
|
nsresult rv = NS_NewContentViewer(getter_AddRefs(contentViewer));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
@ -314,8 +301,6 @@ nsContentDLF::CreateBlankDocument(nsILoadGroup *aLoadGroup,
|
|||||||
nsIPrincipal* aPrincipal,
|
nsIPrincipal* aPrincipal,
|
||||||
nsIDocument **aDocument)
|
nsIDocument **aDocument)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
*aDocument = nullptr;
|
*aDocument = nullptr;
|
||||||
|
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
@ -396,8 +381,6 @@ nsContentDLF::CreateDocument(const char* aCommand,
|
|||||||
nsIStreamListener** aDocListener,
|
nsIStreamListener** aDocListener,
|
||||||
nsIContentViewer** aContentViewer)
|
nsIContentViewer** aContentViewer)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsCOMPtr<nsIURI> aURL;
|
nsCOMPtr<nsIURI> aURL;
|
||||||
@ -446,8 +429,6 @@ nsContentDLF::CreateXULDocument(const char* aCommand,
|
|||||||
nsIStreamListener** aDocListener,
|
nsIStreamListener** aDocListener,
|
||||||
nsIContentViewer** aContentViewer)
|
nsIContentViewer** aContentViewer)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsIDocument> doc = do_CreateInstance(kXULDocumentCID, &rv);
|
nsCOMPtr<nsIDocument> doc = do_CreateInstance(kXULDocumentCID, &rv);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
@ -71,7 +71,6 @@
|
|||||||
#include "nsPresState.h"
|
#include "nsPresState.h"
|
||||||
#include "nsContentList.h"
|
#include "nsContentList.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Selection.h"
|
#include "mozilla/Selection.h"
|
||||||
|
|
||||||
#define DEFAULT_COLUMN_WIDTH 20
|
#define DEFAULT_COLUMN_WIDTH 20
|
||||||
@ -292,8 +291,6 @@ nsTextControlFrame::EnsureEditorInitialized()
|
|||||||
if (mUseEditor)
|
if (mUseEditor)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsIDocument* doc = mContent->GetCurrentDoc();
|
nsIDocument* doc = mContent->GetCurrentDoc();
|
||||||
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
#include "nsIChannelPolicy.h"
|
#include "nsIChannelPolicy.h"
|
||||||
#include "nsIContentSecurityPolicy.h"
|
#include "nsIContentSecurityPolicy.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OVERALL ARCHITECTURE
|
* OVERALL ARCHITECTURE
|
||||||
@ -1387,13 +1386,6 @@ Loader::LoadSheet(SheetLoadData* aLoadData, StyleSheetState aSheetState)
|
|||||||
"Shouldn't use system principal for async loads");
|
"Shouldn't use system principal for async loads");
|
||||||
NS_ASSERTION(mLoadingDatas.IsInitialized(), "mLoadingDatas should be initialized by now.");
|
NS_ASSERTION(mLoadingDatas.IsInitialized(), "mLoadingDatas should be initialized by now.");
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsAutoCString spec__("N/A");
|
|
||||||
if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__);
|
|
||||||
NS_TIME_FUNCTION_FMT("Loading stylesheet (url: %s, %ssync)",
|
|
||||||
spec__.get(), aLoadData->mSyncLoad ? "" : "a");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
LOG_URI(" Load from: '%s'", aLoadData->mURI);
|
LOG_URI(" Load from: '%s'", aLoadData->mURI);
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
@ -1623,12 +1615,6 @@ Loader::ParseSheet(const nsAString& aInput,
|
|||||||
NS_PRECONDITION(aLoadData, "Must have load data");
|
NS_PRECONDITION(aLoadData, "Must have load data");
|
||||||
NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into");
|
NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into");
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsAutoCString spec__("N/A");
|
|
||||||
if (aLoadData->mURI) aLoadData->mURI->GetSpec(spec__);
|
|
||||||
NS_TIME_FUNCTION_FMT("Parsing stylesheet (url: %s)", spec__.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
aCompleted = false;
|
aCompleted = false;
|
||||||
|
|
||||||
nsCSSParser parser(this, aLoadData->mSheet);
|
nsCSSParser parser(this, aLoadData->mSheet);
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "nsWildCard.h"
|
#include "nsWildCard.h"
|
||||||
#include "nsZipArchive.h"
|
#include "nsZipArchive.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -517,9 +516,6 @@ nsZipItem* nsZipArchive::CreateZipItem()
|
|||||||
//---------------------------------------------
|
//---------------------------------------------
|
||||||
nsresult nsZipArchive::BuildFileList()
|
nsresult nsZipArchive::BuildFileList()
|
||||||
{
|
{
|
||||||
#ifndef XP_WIN
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
#endif
|
|
||||||
// Get archive size using end pos
|
// Get archive size using end pos
|
||||||
const uint8_t* buf;
|
const uint8_t* buf;
|
||||||
const uint8_t* startp = mFd->mFileData;
|
const uint8_t* startp = mFd->mFileData;
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include "nsIUploadChannel2.h"
|
#include "nsIUploadChannel2.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
|
#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
|
||||||
#include "nsNativeConnectionHelper.h"
|
#include "nsNativeConnectionHelper.h"
|
||||||
@ -157,8 +156,6 @@ nsIOService::nsIOService()
|
|||||||
nsresult
|
nsresult
|
||||||
nsIOService::Init()
|
nsIOService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
// We need to get references to the DNS service so that we can shut it
|
// We need to get references to the DNS service so that we can shut it
|
||||||
@ -171,8 +168,6 @@ nsIOService::Init()
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("got DNS Service");
|
|
||||||
|
|
||||||
// XXX hack until xpidl supports error info directly (bug 13423)
|
// XXX hack until xpidl supports error info directly (bug 13423)
|
||||||
nsCOMPtr<nsIErrorService> errorService = do_GetService(NS_ERRORSERVICE_CONTRACTID);
|
nsCOMPtr<nsIErrorService> errorService = do_GetService(NS_ERRORSERVICE_CONTRACTID);
|
||||||
if (errorService) {
|
if (errorService) {
|
||||||
@ -181,8 +176,6 @@ nsIOService::Init()
|
|||||||
else
|
else
|
||||||
NS_WARNING("failed to get error service");
|
NS_WARNING("failed to get error service");
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("got Error Service");
|
|
||||||
|
|
||||||
// setup our bad port list stuff
|
// setup our bad port list stuff
|
||||||
for(int i=0; gBadPortList[i]; i++)
|
for(int i=0; gBadPortList[i]; i++)
|
||||||
mRestrictedPortList.AppendElement(gBadPortList[i]);
|
mRestrictedPortList.AppendElement(gBadPortList[i]);
|
||||||
@ -210,14 +203,10 @@ nsIOService::Init()
|
|||||||
else
|
else
|
||||||
NS_WARNING("failed to get observer service");
|
NS_WARNING("failed to get observer service");
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Registered observers");
|
|
||||||
|
|
||||||
gIOService = this;
|
gIOService = this;
|
||||||
|
|
||||||
InitializeNetworkLinkService();
|
InitializeNetworkLinkService();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Set up network link service");
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,8 +219,6 @@ nsIOService::~nsIOService()
|
|||||||
nsresult
|
nsresult
|
||||||
nsIOService::InitializeSocketTransportService()
|
nsIOService::InitializeSocketTransportService()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
if (!mSocketTransportService) {
|
if (!mSocketTransportService) {
|
||||||
@ -254,8 +241,6 @@ nsIOService::InitializeSocketTransportService()
|
|||||||
nsresult
|
nsresult
|
||||||
nsIOService::InitializeNetworkLinkService()
|
nsIOService::InitializeNetworkLinkService()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
if (mNetworkLinkServiceInitialized)
|
if (mNetworkLinkServiceInitialized)
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "nsServiceManagerUtils.h"
|
#include "nsServiceManagerUtils.h"
|
||||||
#include "nsIOService.h"
|
#include "nsIOService.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
// XXX: There is no good header file to put these in. :(
|
// XXX: There is no good header file to put these in. :(
|
||||||
namespace mozilla { namespace psm {
|
namespace mozilla { namespace psm {
|
||||||
@ -416,8 +415,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS6(nsSocketTransportService,
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsSocketTransportService::Init()
|
nsSocketTransportService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
if (!NS_IsMainThread()) {
|
if (!NS_IsMainThread()) {
|
||||||
NS_ERROR("wrong thread");
|
NS_ERROR("wrong thread");
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
@ -447,8 +444,6 @@ nsSocketTransportService::Init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Created thread");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIThread> thread;
|
nsCOMPtr<nsIThread> thread;
|
||||||
nsresult rv = NS_NewThread(getter_AddRefs(thread), this);
|
nsresult rv = NS_NewThread(getter_AddRefs(thread), this);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
@ -464,8 +459,6 @@ nsSocketTransportService::Init()
|
|||||||
tmpPrefService->AddObserver(SEND_BUFFER_PREF, this, false);
|
tmpPrefService->AddObserver(SEND_BUFFER_PREF, this, false);
|
||||||
UpdatePrefs();
|
UpdatePrefs();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("UpdatePrefs");
|
|
||||||
|
|
||||||
mInitialized = true;
|
mInitialized = true;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
3
netwerk/cache/nsCacheService.cpp
vendored
3
netwerk/cache/nsCacheService.cpp
vendored
@ -37,7 +37,6 @@
|
|||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#include "mozilla/net/NeckoCommon.h"
|
#include "mozilla/net/NeckoCommon.h"
|
||||||
|
|
||||||
@ -1109,8 +1108,6 @@ nsCacheService::~nsCacheService()
|
|||||||
nsresult
|
nsresult
|
||||||
nsCacheService::Init()
|
nsCacheService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
// Thie method must be called on the main thread because mCacheIOThread must
|
// Thie method must be called on the main thread because mCacheIOThread must
|
||||||
// only be modified on the main thread.
|
// only be modified on the main thread.
|
||||||
if (!NS_IsMainThread()) {
|
if (!NS_IsMainThread()) {
|
||||||
|
3
netwerk/cache/nsDiskCacheDevice.cpp
vendored
3
netwerk/cache/nsDiskCacheDevice.cpp
vendored
@ -44,7 +44,6 @@
|
|||||||
#include "nsCOMArray.h"
|
#include "nsCOMArray.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
#include "nsISimpleEnumerator.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
@ -386,8 +385,6 @@ nsDiskCacheDevice::~nsDiskCacheDevice()
|
|||||||
nsresult
|
nsresult
|
||||||
nsDiskCacheDevice::Init()
|
nsDiskCacheDevice::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
if (Initialized()) {
|
if (Initialized()) {
|
||||||
|
3
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
3
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
@ -35,7 +35,6 @@
|
|||||||
#include "nsICacheVisitor.h"
|
#include "nsICacheVisitor.h"
|
||||||
#include "nsISeekableStream.h"
|
#include "nsISeekableStream.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
#include "sqlite3.h"
|
#include "sqlite3.h"
|
||||||
@ -1051,8 +1050,6 @@ struct StatementSql {
|
|||||||
nsresult
|
nsresult
|
||||||
nsOfflineCacheDevice::Init()
|
nsOfflineCacheDevice::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(!mDB, NS_ERROR_ALREADY_INITIALIZED);
|
NS_ENSURE_TRUE(!mDB, NS_ERROR_ALREADY_INITIALIZED);
|
||||||
|
|
||||||
// SetCacheParentDirectory must have been called
|
// SetCacheParentDirectory must have been called
|
||||||
|
@ -46,7 +46,6 @@
|
|||||||
#include "nsIPrivateBrowsingService.h"
|
#include "nsIPrivateBrowsingService.h"
|
||||||
#include "nsNetCID.h"
|
#include "nsNetCID.h"
|
||||||
#include "mozilla/storage.h"
|
#include "mozilla/storage.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Util.h" // for DebugOnly
|
#include "mozilla/Util.h" // for DebugOnly
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
@ -608,8 +607,6 @@ nsCookieService::nsCookieService()
|
|||||||
nsresult
|
nsresult
|
||||||
nsCookieService::Init()
|
nsCookieService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
mTLDService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv);
|
mTLDService = do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "nsIOService.h"
|
#include "nsIOService.h"
|
||||||
#include "nsCharSeparatedTokenizer.h"
|
#include "nsCharSeparatedTokenizer.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
@ -364,8 +363,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsDNSService, nsIDNSService, nsPIDNSService,
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsDNSService::Init()
|
nsDNSService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
if (mResolver)
|
if (mResolver)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
NS_ENSURE_TRUE(!mResolver, NS_ERROR_ALREADY_INITIALIZED);
|
NS_ENSURE_TRUE(!mResolver, NS_ERROR_ALREADY_INITIALIZED);
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "prnetdb.h"
|
#include "prnetdb.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@ -61,8 +60,6 @@ nsDomainEntry::FuncForStaticAsserts(void)
|
|||||||
nsresult
|
nsresult
|
||||||
nsEffectiveTLDService::Init()
|
nsEffectiveTLDService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
const ETLDEntry *entries = nsDomainEntry::entries;
|
const ETLDEntry *entries = nsDomainEntry::entries;
|
||||||
|
|
||||||
// We'll probably have to rehash at least once, since nsTHashtable doesn't
|
// We'll probably have to rehash at least once, since nsTHashtable doesn't
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
#include "mozilla/HashFunctions.h"
|
#include "mozilla/HashFunctions.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
@ -367,8 +366,6 @@ nsHostResolver::~nsHostResolver()
|
|||||||
nsresult
|
nsresult
|
||||||
nsHostResolver::Init()
|
nsHostResolver::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
PL_DHashTableInit(&mDB, &gHostDB_ops, nullptr, sizeof(nsHostDBEnt), 0);
|
PL_DHashTableInit(&mDB, &gHostDB_ops, nullptr, sizeof(nsHostDBEnt), 0);
|
||||||
|
|
||||||
mShutdown = false;
|
mShutdown = false;
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "nsISupportsPrimitives.h"
|
#include "nsISupportsPrimitives.h"
|
||||||
#include "punycode.h"
|
#include "punycode.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// RFC 1034 - 3.1. Name space specifications and terminology
|
// RFC 1034 - 3.1. Name space specifications and terminology
|
||||||
@ -47,8 +46,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsIDNService,
|
|||||||
|
|
||||||
nsresult nsIDNService::Init()
|
nsresult nsIDNService::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
nsCOMPtr<nsIPrefService> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||||
if (prefs)
|
if (prefs)
|
||||||
prefs->GetBranch(NS_NET_PREF_IDNWHITELIST, getter_AddRefs(mIDNWhitelistPrefBranch));
|
prefs->GetBranch(NS_NET_PREF_IDNWHITELIST, getter_AddRefs(mIDNWhitelistPrefBranch));
|
||||||
|
@ -63,7 +63,6 @@ using namespace mozilla;
|
|||||||
using namespace mozilla::net;
|
using namespace mozilla::net;
|
||||||
#include "mozilla/net/HttpChannelChild.h"
|
#include "mozilla/net/HttpChannelChild.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// defined by the socket transport service while active
|
// defined by the socket transport service while active
|
||||||
@ -208,8 +207,6 @@ nsHttpHandler::~nsHttpHandler()
|
|||||||
nsresult
|
nsresult
|
||||||
nsHttpHandler::Init()
|
nsHttpHandler::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
LOG(("nsHttpHandler::Init\n"));
|
LOG(("nsHttpHandler::Init\n"));
|
||||||
@ -310,8 +307,6 @@ nsHttpHandler::Init()
|
|||||||
nsresult
|
nsresult
|
||||||
nsHttpHandler::InitConnectionMgr()
|
nsHttpHandler::InitConnectionMgr()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
if (!mConnMgr) {
|
if (!mConnMgr) {
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include "nsServiceManagerUtils.h" // do_GetService
|
#include "nsServiceManagerUtils.h" // do_GetService
|
||||||
#include "nsIHttpActivityObserver.h"
|
#include "nsIHttpActivityObserver.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@ -173,8 +172,6 @@ nsHttpTransaction::Init(uint8_t caps,
|
|||||||
nsITransportEventSink *eventsink,
|
nsITransportEventSink *eventsink,
|
||||||
nsIAsyncInputStream **responseBody)
|
nsIAsyncInputStream **responseBody)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
LOG(("nsHttpTransaction::Init [this=%x caps=%x]\n", this, caps));
|
LOG(("nsHttpTransaction::Init [this=%x caps=%x]\n", this, caps));
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include "nsZipArchive.h"
|
#include "nsZipArchive.h"
|
||||||
#include "mozilla/Omnijar.h"
|
#include "mozilla/Omnijar.h"
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "nsThreadUtils.h"
|
#include "nsThreadUtils.h"
|
||||||
#include "nsXULAppAPI.h"
|
#include "nsXULAppAPI.h"
|
||||||
@ -485,7 +484,6 @@ StartupCache::WaitOnWriteThread()
|
|||||||
if (!mWriteThread || mWriteThread == PR_GetCurrentThread())
|
if (!mWriteThread || mWriteThread == PR_GetCurrentThread())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MIN(30);
|
|
||||||
PR_JoinThread(mWriteThread);
|
PR_JoinThread(mWriteThread);
|
||||||
mWriteThread = NULL;
|
mWriteThread = NULL;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include "nsIPromptService.h"
|
#include "nsIPromptService.h"
|
||||||
#include "nsIMemoryReporter.h"
|
#include "nsIMemoryReporter.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Util.h"
|
#include "mozilla/Util.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -571,8 +570,6 @@ const sqlite3_mem_methods memMethods = {
|
|||||||
nsresult
|
nsresult
|
||||||
Service::initialize()
|
Service::initialize()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
#ifdef MOZ_STORAGE_MEMORY
|
#ifdef MOZ_STORAGE_MEMORY
|
||||||
@ -729,12 +726,6 @@ Service::OpenDatabase(nsIFile *aDatabaseFile,
|
|||||||
{
|
{
|
||||||
NS_ENSURE_ARG(aDatabaseFile);
|
NS_ENSURE_ARG(aDatabaseFile);
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsCString leafname;
|
|
||||||
(void)aDatabaseFile->GetNativeLeafName(leafname);
|
|
||||||
NS_TIME_FUNCTION_FMT("mozIStorageService::OpenDatabase(%s)", leafname.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
||||||
// reasons.
|
// reasons.
|
||||||
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
|
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
|
||||||
@ -755,13 +746,6 @@ Service::OpenUnsharedDatabase(nsIFile *aDatabaseFile,
|
|||||||
{
|
{
|
||||||
NS_ENSURE_ARG(aDatabaseFile);
|
NS_ENSURE_ARG(aDatabaseFile);
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsCString leafname;
|
|
||||||
(void)aDatabaseFile->GetNativeLeafName(leafname);
|
|
||||||
NS_TIME_FUNCTION_FMT("mozIStorageService::OpenUnsharedDatabase(%s)",
|
|
||||||
leafname.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
||||||
// reasons.
|
// reasons.
|
||||||
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_PRIVATECACHE |
|
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_PRIVATECACHE |
|
||||||
@ -868,13 +852,6 @@ Service::OpenDatabaseWithVFS(nsIFile *aDatabaseFile,
|
|||||||
{
|
{
|
||||||
NS_ENSURE_ARG(aDatabaseFile);
|
NS_ENSURE_ARG(aDatabaseFile);
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
nsCString leafname;
|
|
||||||
(void)aDatabaseFile->GetNativeLeafName(leafname);
|
|
||||||
NS_TIME_FUNCTION_FMT("mozIStorageService::OpenDatabaseWithVFS(%s)",
|
|
||||||
leafname.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
// Always ensure that SQLITE_OPEN_CREATE is passed in for compatibility
|
||||||
// reasons.
|
// reasons.
|
||||||
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
|
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_SHAREDCACHE |
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "prlog.h"
|
#include "prlog.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
extern PRLogModuleInfo* gStorageLog;
|
extern PRLogModuleInfo* gStorageLog;
|
||||||
@ -557,9 +556,6 @@ Statement::ExecuteStep(bool *_moreResults)
|
|||||||
if (!mDBStatement)
|
if (!mDBStatement)
|
||||||
return NS_ERROR_NOT_INITIALIZED;
|
return NS_ERROR_NOT_INITIALIZED;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(5, "mozIStorageStatement::ExecuteStep(%s) (0x%p)",
|
|
||||||
mDBConnection->getFilename().get(), mDBStatement);
|
|
||||||
|
|
||||||
// Bind any parameters first before executing.
|
// Bind any parameters first before executing.
|
||||||
if (mParamsArray) {
|
if (mParamsArray) {
|
||||||
// If we have more than one row of parameters to bind, they shouldn't be
|
// If we have more than one row of parameters to bind, they shouldn't be
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "nsPrintfCString.h"
|
#include "nsPrintfCString.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "mozilla/storage.h"
|
#include "mozilla/storage.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Util.h"
|
#include "mozilla/Util.h"
|
||||||
|
|
||||||
#include "sampler.h"
|
#include "sampler.h"
|
||||||
@ -237,8 +236,6 @@ NS_IMPL_ISUPPORTS5(nsNavBookmarks
|
|||||||
nsresult
|
nsresult
|
||||||
nsNavBookmarks::Init()
|
nsNavBookmarks::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
mDB = Database::GetDatabase();
|
mDB = Database::GetDatabase();
|
||||||
NS_ENSURE_STATE(mDB);
|
NS_ENSURE_STATE(mDB);
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsMathUtils.h"
|
#include "nsMathUtils.h"
|
||||||
#include "mozilla/storage.h"
|
#include "mozilla/storage.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Util.h"
|
#include "mozilla/Util.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
@ -290,8 +289,6 @@ nsNavHistory::~nsNavHistory()
|
|||||||
nsresult
|
nsresult
|
||||||
nsNavHistory::Init()
|
nsNavHistory::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
LoadPrefs();
|
LoadPrefs();
|
||||||
|
|
||||||
mDB = Database::GetDatabase();
|
mDB = Database::GetDatabase();
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "nsAppShellCID.h"
|
#include "nsAppShellCID.h"
|
||||||
#include "nsXPCOMCIDInternal.h"
|
#include "nsXPCOMCIDInternal.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsIXPConnect.h"
|
#include "nsIXPConnect.h"
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
@ -172,22 +171,17 @@ nsAppStartup::nsAppStartup() :
|
|||||||
nsresult
|
nsresult
|
||||||
nsAppStartup::Init()
|
nsAppStartup::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
// Create widget application shell
|
// Create widget application shell
|
||||||
mAppShell = do_GetService(kAppShellCID, &rv);
|
mAppShell = do_GetService(kAppShellCID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Got AppShell service");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIObserverService> os =
|
nsCOMPtr<nsIObserverService> os =
|
||||||
mozilla::services::GetObserverService();
|
mozilla::services::GetObserverService();
|
||||||
if (!os)
|
if (!os)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Got Observer service");
|
|
||||||
|
|
||||||
os->AddObserver(this, "quit-application-forced", true);
|
os->AddObserver(this, "quit-application-forced", true);
|
||||||
os->AddObserver(this, "sessionstore-windows-restored", true);
|
os->AddObserver(this, "sessionstore-windows-restored", true);
|
||||||
os->AddObserver(this, "profile-change-teardown", true);
|
os->AddObserver(this, "profile-change-teardown", true);
|
||||||
|
@ -91,7 +91,6 @@
|
|||||||
#include "nsIDocShell.h"
|
#include "nsIDocShell.h"
|
||||||
#include "nsAppShellCID.h"
|
#include "nsAppShellCID.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/unused.h"
|
#include "mozilla/unused.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
@ -184,7 +183,6 @@ using mozilla::unused;
|
|||||||
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_ANDROID
|
#ifdef MOZ_WIDGET_ANDROID
|
||||||
#include "AndroidBridge.h"
|
#include "AndroidBridge.h"
|
||||||
@ -1232,7 +1230,6 @@ nsSingletonFactory::LockFactory(bool)
|
|||||||
nsresult
|
nsresult
|
||||||
ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
|
ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
NS_IF_ADDREF(gNativeAppSupport = native);
|
NS_IF_ADDREF(gNativeAppSupport = native);
|
||||||
@ -1240,24 +1237,17 @@ ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native)
|
|||||||
// Inform the chrome registry about OS accessibility
|
// Inform the chrome registry about OS accessibility
|
||||||
nsCOMPtr<nsIToolkitChromeRegistry> cr =
|
nsCOMPtr<nsIToolkitChromeRegistry> cr =
|
||||||
mozilla::services::GetToolkitChromeRegistryService();
|
mozilla::services::GetToolkitChromeRegistryService();
|
||||||
NS_TIME_FUNCTION_MARK("Got ToolkitChromeRegistry service");
|
|
||||||
|
|
||||||
if (cr)
|
if (cr)
|
||||||
cr->CheckForOSAccessibility();
|
cr->CheckForOSAccessibility();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("OS Accessibility check");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWindowCreator> creator (do_GetService(NS_APPSTARTUP_CONTRACTID));
|
nsCOMPtr<nsIWindowCreator> creator (do_GetService(NS_APPSTARTUP_CONTRACTID));
|
||||||
if (!creator) return NS_ERROR_UNEXPECTED;
|
if (!creator) return NS_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Got AppStartup service");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIWindowWatcher> wwatch
|
nsCOMPtr<nsIWindowWatcher> wwatch
|
||||||
(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
|
(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Got WindowWatcher service");
|
|
||||||
|
|
||||||
return wwatch->SetWindowCreator(creator);
|
return wwatch->SetWindowCreator(creator);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2798,8 +2788,6 @@ public:
|
|||||||
int
|
int
|
||||||
XREMain::XRE_mainInit(const nsXREAppData* aAppData, bool* aExitFlag)
|
XREMain::XRE_mainInit(const nsXREAppData* aAppData, bool* aExitFlag)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
if (!aExitFlag)
|
if (!aExitFlag)
|
||||||
return 1;
|
return 1;
|
||||||
*aExitFlag = false;
|
*aExitFlag = false;
|
||||||
@ -3193,7 +3181,6 @@ XREMain::XRE_mainInit(const nsXREAppData* aAppData, bool* aExitFlag)
|
|||||||
int
|
int
|
||||||
XREMain::XRE_mainStartup(bool* aExitFlag)
|
XREMain::XRE_mainStartup(bool* aExitFlag)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
if (!aExitFlag)
|
if (!aExitFlag)
|
||||||
@ -3570,7 +3557,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
|
|||||||
nsresult
|
nsresult
|
||||||
XREMain::XRE_mainRun()
|
XREMain::XRE_mainRun()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
NS_ASSERTION(mScopedXPCom, "Scoped xpcom not initialized.");
|
NS_ASSERTION(mScopedXPCom, "Scoped xpcom not initialized.");
|
||||||
|
|
||||||
@ -3581,31 +3567,22 @@ XREMain::XRE_mainRun()
|
|||||||
nsCOMPtr<nsISupports> comp;
|
nsCOMPtr<nsISupports> comp;
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/preferences-service;1");
|
comp = do_GetService("@mozilla.org/preferences-service;1");
|
||||||
NS_TIME_FUNCTION_MARK("Pref Service");
|
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/network/socket-transport-service;1");
|
comp = do_GetService("@mozilla.org/network/socket-transport-service;1");
|
||||||
NS_TIME_FUNCTION_MARK("Socket Transport Service");
|
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/network/dns-service;1");
|
comp = do_GetService("@mozilla.org/network/dns-service;1");
|
||||||
NS_TIME_FUNCTION_MARK("DNS Service");
|
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/network/io-service;1");
|
comp = do_GetService("@mozilla.org/network/io-service;1");
|
||||||
NS_TIME_FUNCTION_MARK("IO Service");
|
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/chrome/chrome-registry;1");
|
comp = do_GetService("@mozilla.org/chrome/chrome-registry;1");
|
||||||
NS_TIME_FUNCTION_MARK("Chrome Registry Service");
|
|
||||||
|
|
||||||
comp = do_GetService("@mozilla.org/focus-event-suppressor-service;1");
|
comp = do_GetService("@mozilla.org/focus-event-suppressor-service;1");
|
||||||
NS_TIME_FUNCTION_MARK("Focus Event Suppressor Service");
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rv = mScopedXPCom->SetWindowCreator(mNativeApp);
|
rv = mScopedXPCom->SetWindowCreator(mNativeApp);
|
||||||
NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: SetWindowCreator");
|
|
||||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: Done");
|
|
||||||
|
|
||||||
#ifdef MOZ_CRASHREPORTER
|
#ifdef MOZ_CRASHREPORTER
|
||||||
// tell the crash reporter to also send the release channel
|
// tell the crash reporter to also send the release channel
|
||||||
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
|
nsCOMPtr<nsIPrefService> prefs = do_GetService("@mozilla.org/preferences-service;1", &rv);
|
||||||
@ -3624,8 +3601,6 @@ XREMain::XRE_mainRun()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: AppStartup");
|
|
||||||
|
|
||||||
if (mStartOffline) {
|
if (mStartOffline) {
|
||||||
nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
|
nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
|
||||||
NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(io, NS_ERROR_FAILURE);
|
||||||
@ -3641,14 +3616,10 @@ XREMain::XRE_mainRun()
|
|||||||
startupNotifier->Observe(nullptr, APPSTARTUP_TOPIC, nullptr);
|
startupNotifier->Observe(nullptr, APPSTARTUP_TOPIC, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Finished startupNotifier");
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAppStartup> appStartup
|
nsCOMPtr<nsIAppStartup> appStartup
|
||||||
(do_GetService(NS_APPSTARTUP_CONTRACTID));
|
(do_GetService(NS_APPSTARTUP_CONTRACTID));
|
||||||
NS_ENSURE_TRUE(appStartup, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(appStartup, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Created AppStartup");
|
|
||||||
|
|
||||||
if (gDoMigration) {
|
if (gDoMigration) {
|
||||||
nsCOMPtr<nsIFile> file;
|
nsCOMPtr<nsIFile> file;
|
||||||
mDirProvider.GetAppDir()->Clone(getter_AddRefs(file));
|
mDirProvider.GetAppDir()->Clone(getter_AddRefs(file));
|
||||||
@ -3702,12 +3673,8 @@ XREMain::XRE_mainRun()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Profile migration");
|
|
||||||
|
|
||||||
mDirProvider.DoStartup();
|
mDirProvider.DoStartup();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("dirProvider.DoStartup() (profile-after-change)");
|
|
||||||
|
|
||||||
appStartup->GetShuttingDown(&mShuttingDown);
|
appStartup->GetShuttingDown(&mShuttingDown);
|
||||||
|
|
||||||
nsCOMPtr<nsICommandLineRunner> cmdLine;
|
nsCOMPtr<nsICommandLineRunner> cmdLine;
|
||||||
@ -3731,10 +3698,6 @@ XREMain::XRE_mainRun()
|
|||||||
if (obsService) {
|
if (obsService) {
|
||||||
obsService->NotifyObservers(cmdLine, "command-line-startup", nullptr);
|
obsService->NotifyObservers(cmdLine, "command-line-startup", nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Early command line init");
|
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: prepare for Run");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveStateForAppInitiatedRestart();
|
SaveStateForAppInitiatedRestart();
|
||||||
@ -3749,11 +3712,7 @@ XREMain::XRE_mainRun()
|
|||||||
SaveToEnv("XUL_APP_FILE=");
|
SaveToEnv("XUL_APP_FILE=");
|
||||||
SaveToEnv("XRE_BINARY_PATH=");
|
SaveToEnv("XRE_BINARY_PATH=");
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("env munging");
|
|
||||||
|
|
||||||
if (!mShuttingDown) {
|
if (!mShuttingDown) {
|
||||||
NS_TIME_FUNCTION_MARK("Next: CreateHiddenWindow");
|
|
||||||
|
|
||||||
rv = appStartup->CreateHiddenWindow();
|
rv = appStartup->CreateHiddenWindow();
|
||||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
@ -3789,8 +3748,6 @@ XREMain::XRE_mainRun()
|
|||||||
if (obsService)
|
if (obsService)
|
||||||
obsService->NotifyObservers(nullptr, "final-ui-startup", nullptr);
|
obsService->NotifyObservers(nullptr, "final-ui-startup", nullptr);
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("final-ui-startup done");
|
|
||||||
|
|
||||||
appStartup->GetShuttingDown(&mShuttingDown);
|
appStartup->GetShuttingDown(&mShuttingDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3821,10 +3778,6 @@ XREMain::XRE_mainRun()
|
|||||||
}
|
}
|
||||||
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
|
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: Run");
|
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("appStartup->Run");
|
|
||||||
|
|
||||||
{
|
{
|
||||||
rv = appStartup->Run();
|
rv = appStartup->Run();
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
@ -3833,10 +3786,6 @@ XREMain::XRE_mainRun()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: Finish");
|
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("appStartup->Run done");
|
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3846,14 +3795,11 @@ XREMain::XRE_mainRun()
|
|||||||
int
|
int
|
||||||
XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
SAMPLER_INIT();
|
SAMPLER_INIT();
|
||||||
SAMPLE_LABEL("Startup", "XRE_Main");
|
SAMPLE_LABEL("Startup", "XRE_Main");
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("XRE_main init");
|
|
||||||
|
|
||||||
gArgc = argc;
|
gArgc = argc;
|
||||||
gArgv = argv;
|
gArgv = argv;
|
||||||
|
|
||||||
@ -3883,7 +3829,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
|||||||
if (result != 0 || exit)
|
if (result != 0 || exit)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("XRE_main startup");
|
|
||||||
// startup
|
// startup
|
||||||
result = XRE_mainStartup(&exit);
|
result = XRE_mainStartup(&exit);
|
||||||
if (result != 0 || exit)
|
if (result != 0 || exit)
|
||||||
@ -3892,20 +3837,16 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
|||||||
bool appInitiatedRestart = false;
|
bool appInitiatedRestart = false;
|
||||||
|
|
||||||
// Start the real application
|
// Start the real application
|
||||||
NS_TIME_FUNCTION_MARK("XRE_main ScopedXPCOMStartup");
|
|
||||||
mScopedXPCom = new ScopedXPCOMStartup();
|
mScopedXPCom = new ScopedXPCOMStartup();
|
||||||
if (!mScopedXPCom)
|
if (!mScopedXPCom)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("ScopedXPCOMStartup: Initialize");
|
|
||||||
rv = mScopedXPCom->Initialize();
|
rv = mScopedXPCom->Initialize();
|
||||||
NS_ENSURE_SUCCESS(rv, 1);
|
NS_ENSURE_SUCCESS(rv, 1);
|
||||||
|
|
||||||
// run!
|
// run!
|
||||||
NS_TIME_FUNCTION_MARK("XRE_main run");
|
|
||||||
rv = XRE_mainRun();
|
rv = XRE_mainRun();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("XRE_main shutdown");
|
|
||||||
#ifdef MOZ_INSTRUMENT_EVENT_LOOP
|
#ifdef MOZ_INSTRUMENT_EVENT_LOOP
|
||||||
mozilla::ShutdownEventTracing();
|
mozilla::ShutdownEventTracing();
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,19 +48,6 @@
|
|||||||
#include "nsDocLoader.h"
|
#include "nsDocLoader.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
#define TIME_URILOADER_FUNCTION(req) \
|
|
||||||
nsAutoCString name__("N/A"); \
|
|
||||||
(req)->GetName(name__); \
|
|
||||||
NS_TIME_FUNCTION_FMT("%s (line %d) (request: %s)", \
|
|
||||||
MOZ_FUNCTION_NAME, \
|
|
||||||
__LINE__, \
|
|
||||||
name__.get())
|
|
||||||
#else
|
|
||||||
#define TIME_URILOADER_FUNCTION(req) do {} while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
PRLogModuleInfo* nsURILoader::mLog = nullptr;
|
PRLogModuleInfo* nsURILoader::mLog = nullptr;
|
||||||
#endif
|
#endif
|
||||||
@ -205,8 +192,6 @@ nsresult nsDocumentOpenInfo::Prepare()
|
|||||||
|
|
||||||
NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest *request, nsISupports * aCtxt)
|
NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest *request, nsISupports * aCtxt)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(request);
|
|
||||||
|
|
||||||
LOG(("[0x%p] nsDocumentOpenInfo::OnStartRequest", this));
|
LOG(("[0x%p] nsDocumentOpenInfo::OnStartRequest", this));
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
@ -282,8 +267,6 @@ nsDocumentOpenInfo::OnDataAvailable(nsIRequest *request, nsISupports * aCtxt,
|
|||||||
nsIInputStream * inStr,
|
nsIInputStream * inStr,
|
||||||
uint64_t sourceOffset, uint32_t count)
|
uint64_t sourceOffset, uint32_t count)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(request);
|
|
||||||
|
|
||||||
// if we have retarged to the end stream listener, then forward the call....
|
// if we have retarged to the end stream listener, then forward the call....
|
||||||
// otherwise, don't do anything
|
// otherwise, don't do anything
|
||||||
|
|
||||||
@ -297,8 +280,6 @@ nsDocumentOpenInfo::OnDataAvailable(nsIRequest *request, nsISupports * aCtxt,
|
|||||||
NS_IMETHODIMP nsDocumentOpenInfo::OnStopRequest(nsIRequest *request, nsISupports *aCtxt,
|
NS_IMETHODIMP nsDocumentOpenInfo::OnStopRequest(nsIRequest *request, nsISupports *aCtxt,
|
||||||
nsresult aStatus)
|
nsresult aStatus)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(request);
|
|
||||||
|
|
||||||
LOG(("[0x%p] nsDocumentOpenInfo::OnStopRequest", this));
|
LOG(("[0x%p] nsDocumentOpenInfo::OnStopRequest", this));
|
||||||
|
|
||||||
if ( m_targetStreamListener)
|
if ( m_targetStreamListener)
|
||||||
@ -321,8 +302,6 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStopRequest(nsIRequest *request, nsISupports
|
|||||||
|
|
||||||
nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports * aCtxt)
|
nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports * aCtxt)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(request);
|
|
||||||
|
|
||||||
LOG(("[0x%p] nsDocumentOpenInfo::DispatchContent for type '%s'", this, mContentType.get()));
|
LOG(("[0x%p] nsDocumentOpenInfo::DispatchContent for type '%s'", this, mContentType.get()));
|
||||||
|
|
||||||
NS_PRECONDITION(!m_targetStreamListener,
|
NS_PRECONDITION(!m_targetStreamListener,
|
||||||
@ -553,8 +532,6 @@ nsDocumentOpenInfo::ConvertData(nsIRequest *request,
|
|||||||
const nsACString& aSrcContentType,
|
const nsACString& aSrcContentType,
|
||||||
const nsACString& aOutContentType)
|
const nsACString& aOutContentType)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(request);
|
|
||||||
|
|
||||||
LOG(("[0x%p] nsDocumentOpenInfo::ConvertData from '%s' to '%s'", this,
|
LOG(("[0x%p] nsDocumentOpenInfo::ConvertData from '%s' to '%s'", this,
|
||||||
PromiseFlatCString(aSrcContentType).get(),
|
PromiseFlatCString(aSrcContentType).get(),
|
||||||
PromiseFlatCString(aOutContentType).get()));
|
PromiseFlatCString(aOutContentType).get()));
|
||||||
@ -611,8 +588,6 @@ bool
|
|||||||
nsDocumentOpenInfo::TryContentListener(nsIURIContentListener* aListener,
|
nsDocumentOpenInfo::TryContentListener(nsIURIContentListener* aListener,
|
||||||
nsIChannel* aChannel)
|
nsIChannel* aChannel)
|
||||||
{
|
{
|
||||||
TIME_URILOADER_FUNCTION(aChannel);
|
|
||||||
|
|
||||||
LOG(("[0x%p] nsDocumentOpenInfo::TryContentListener; mFlags = 0x%x",
|
LOG(("[0x%p] nsDocumentOpenInfo::TryContentListener; mFlags = 0x%x",
|
||||||
this, mFlags));
|
this, mFlags));
|
||||||
|
|
||||||
@ -757,8 +732,6 @@ NS_IMETHODIMP nsURILoader::OpenURI(nsIChannel *channel,
|
|||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(channel);
|
NS_ENSURE_ARG_POINTER(channel);
|
||||||
|
|
||||||
TIME_URILOADER_FUNCTION(channel);
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
if (LOG_ENABLED()) {
|
if (LOG_ENABLED()) {
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
@ -806,8 +779,6 @@ nsresult nsURILoader::OpenChannel(nsIChannel* channel,
|
|||||||
NS_ASSERTION(channel, "Trying to open a null channel!");
|
NS_ASSERTION(channel, "Trying to open a null channel!");
|
||||||
NS_ASSERTION(aWindowContext, "Window context must not be null");
|
NS_ASSERTION(aWindowContext, "Window context must not be null");
|
||||||
|
|
||||||
TIME_URILOADER_FUNCTION(channel);
|
|
||||||
|
|
||||||
#ifdef PR_LOGGING
|
#ifdef PR_LOGGING
|
||||||
if (LOG_ENABLED()) {
|
if (LOG_ENABLED()) {
|
||||||
nsCOMPtr<nsIURI> uri;
|
nsCOMPtr<nsIURI> uri;
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "GfxInfo.h"
|
#include "GfxInfo.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "nsHashKeys.h"
|
#include "nsHashKeys.h"
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include "GfxInfo.h"
|
#include "GfxInfo.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsCocoaFeatures.h"
|
#include "nsCocoaFeatures.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
|
|
||||||
@ -103,8 +102,6 @@ GfxInfo::GetDeviceInfo()
|
|||||||
nsresult
|
nsresult
|
||||||
GfxInfo::Init()
|
GfxInfo::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = GfxInfoBase::Init();
|
nsresult rv = GfxInfoBase::Init();
|
||||||
|
|
||||||
// Calling CGLQueryRendererInfo causes us to switch to the discrete GPU
|
// Calling CGLQueryRendererInfo causes us to switch to the discrete GPU
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include "GfxInfo.h"
|
#include "GfxInfo.h"
|
||||||
#include "GfxInfoWebGL.h"
|
#include "GfxInfoWebGL.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
#include "prprf.h"
|
#include "prprf.h"
|
||||||
#include "GfxDriverInfo.h"
|
#include "GfxDriverInfo.h"
|
||||||
@ -242,8 +241,6 @@ ParseIDFromDeviceID(const nsAString &key, const char *prefix, int length)
|
|||||||
nsresult
|
nsresult
|
||||||
GfxInfo::Init()
|
GfxInfo::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = GfxInfoBase::Init();
|
nsresult rv = GfxInfoBase::Init();
|
||||||
|
|
||||||
DISPLAY_DEVICEW displayDevice;
|
DISPLAY_DEVICEW displayDevice;
|
||||||
|
@ -158,7 +158,6 @@
|
|||||||
|
|
||||||
#include "nsWindowDefs.h"
|
#include "nsWindowDefs.h"
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsCrashOnException.h"
|
#include "nsCrashOnException.h"
|
||||||
#include "nsIXULRuntime.h"
|
#include "nsIXULRuntime.h"
|
||||||
|
|
||||||
@ -1064,18 +1063,6 @@ NS_METHOD nsWindow::Show(bool bState)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
static bool firstShow = true;
|
|
||||||
if (firstShow &&
|
|
||||||
(mWindowType == eWindowType_toplevel ||
|
|
||||||
mWindowType == eWindowType_dialog ||
|
|
||||||
mWindowType == eWindowType_popup))
|
|
||||||
{
|
|
||||||
firstShow = false;
|
|
||||||
mozilla::FunctionTimer::LogMessage("@ First toplevel/dialog/popup showing");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool syncInvalidate = false;
|
bool syncInvalidate = false;
|
||||||
|
|
||||||
bool wasVisible = mIsVisible;
|
bool wasVisible = mIsVisible;
|
||||||
@ -4280,10 +4267,6 @@ LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
|||||||
|
|
||||||
LRESULT CALLBACK nsWindow::WindowProcInternal(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK nsWindow::WindowProcInternal(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_MIN_FMT(5.0, "%s (line %d) (hWnd: %p, msg: %p, wParam: %p, lParam: %p",
|
|
||||||
MOZ_FUNCTION_NAME, __LINE__, hWnd, msg,
|
|
||||||
wParam, lParam);
|
|
||||||
|
|
||||||
if (::GetWindowLongPtrW(hWnd, GWLP_ID) == eFakeTrackPointScrollableID) {
|
if (::GetWindowLongPtrW(hWnd, GWLP_ID) == eFakeTrackPointScrollableID) {
|
||||||
// This message was sent to the FAKETRACKPOINTSCROLLABLE.
|
// This message was sent to the FAKETRACKPOINTSCROLLABLE.
|
||||||
if (msg == WM_HSCROLL) {
|
if (msg == WM_HSCROLL) {
|
||||||
|
@ -1,119 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
// needed to get vsnprintf with glibc
|
|
||||||
#ifndef _ISOC99_SOURCE
|
|
||||||
#define _ISOC99_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "prenv.h"
|
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#define vsnprintf _vsnprintf
|
|
||||||
#include <windows.h>
|
|
||||||
#include <mmsystem.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace mozilla;
|
|
||||||
|
|
||||||
// This /must/ come before the call to InitTimers below,
|
|
||||||
// or its constructor will be called after we've already
|
|
||||||
// assigned the Now() value to it.
|
|
||||||
static TimeStamp sAppStart;
|
|
||||||
|
|
||||||
nsAutoPtr<FunctionTimerLog> FunctionTimer::sLog;
|
|
||||||
char *FunctionTimer::sBuf1 = nullptr;
|
|
||||||
char *FunctionTimer::sBuf2 = nullptr;
|
|
||||||
int FunctionTimer::sBufSize = FunctionTimer::InitTimers();
|
|
||||||
unsigned FunctionTimer::sDepth = 0;
|
|
||||||
|
|
||||||
int
|
|
||||||
FunctionTimer::InitTimers()
|
|
||||||
{
|
|
||||||
if (PR_GetEnv("MOZ_FT") == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
// ensure that this is initialized before us
|
|
||||||
TimeStamp::Startup();
|
|
||||||
|
|
||||||
sLog = new FunctionTimerLog(PR_GetEnv("MOZ_FT"));
|
|
||||||
sBuf1 = (char *) malloc(BUF_LOG_LENGTH);
|
|
||||||
sBuf2 = (char *) malloc(BUF_LOG_LENGTH);
|
|
||||||
sAppStart = TimeStamp::Now();
|
|
||||||
|
|
||||||
return BUF_LOG_LENGTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionTimerLog::FunctionTimerLog(const char *fname)
|
|
||||||
: mLatest(sAppStart)
|
|
||||||
{
|
|
||||||
if (strcmp(fname, "stdout") == 0) {
|
|
||||||
mFile = stdout;
|
|
||||||
} else if (strcmp(fname, "stderr") == 0) {
|
|
||||||
mFile = stderr;
|
|
||||||
} else {
|
|
||||||
FILE *fp = fopen(fname, "wb");
|
|
||||||
if (!fp) {
|
|
||||||
NS_WARNING("FunctionTimerLog: Failed to open file specified, logging disabled!");
|
|
||||||
}
|
|
||||||
mFile = fp;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
// Get 1ms resolution on Windows
|
|
||||||
timeBeginPeriod(1);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionTimerLog::~FunctionTimerLog()
|
|
||||||
{
|
|
||||||
if (mFile && mFile != stdout && mFile != stderr)
|
|
||||||
fclose((FILE*)mFile);
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
timeEndPeriod(1);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
FunctionTimerLog::LogString(const char *str)
|
|
||||||
{
|
|
||||||
if (mFile) {
|
|
||||||
mLatest = TimeStamp::Now();
|
|
||||||
TimeDuration elapsed = mLatest - sAppStart;
|
|
||||||
fprintf((FILE*)mFile, "[% 9.2f] %s\n", elapsed.ToSeconds() * 1000.0, str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeDuration
|
|
||||||
FunctionTimerLog::LatestSinceStartup() const
|
|
||||||
{
|
|
||||||
return mLatest - sAppStart;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
FunctionTimer::ft_vsnprintf(char *str, int maxlen, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
return vsnprintf(str, maxlen, fmt, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
FunctionTimer::ft_snprintf(char *str, int maxlen, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, fmt);
|
|
||||||
|
|
||||||
int rval = ft_vsnprintf(str, maxlen, fmt, ap);
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
@ -1,253 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
#ifndef mozilla_FunctionTimer_h
|
|
||||||
#define mozilla_FunctionTimer_h
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#include "mozilla/TimeStamp.h"
|
|
||||||
#include "nscore.h"
|
|
||||||
#include "nsAutoPtr.h"
|
|
||||||
|
|
||||||
#if defined(NS_FORCE_FUNCTION_TIMER) && !defined(NS_FUNCTION_TIMER)
|
|
||||||
#define NS_FUNCTION_TIMER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Shortcut macros
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define MOZ_FUNCTION_NAME __PRETTY_FUNCTION__
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
#define MOZ_FUNCTION_NAME __FUNCTION__
|
|
||||||
#else
|
|
||||||
#warning "Define a suitable MOZ_FUNCTION_NAME for this platform"
|
|
||||||
#define MOZ_FUNCTION_NAME ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Add a timer for this function, from this declaration until the
|
|
||||||
// function returns. The function name will be used as the
|
|
||||||
// log string, and both function entry and exit will be printed.
|
|
||||||
#define NS_TIME_FUNCTION \
|
|
||||||
mozilla::FunctionTimer ft__autogen("%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
|
|
||||||
|
|
||||||
// Add a timer for this block, but print only a) if the exit time is
|
|
||||||
// greater than the given number of milliseconds; or b) if the
|
|
||||||
// mark-to-mark time is greater than the given number of milliseconds.
|
|
||||||
// No function entry will be printed. If the value given is negative,
|
|
||||||
// no function entry or exit will ever be printed, but all marks will.
|
|
||||||
#define NS_TIME_FUNCTION_MIN(_ms) \
|
|
||||||
mozilla::FunctionTimer ft__autogen((_ms), "%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
|
|
||||||
|
|
||||||
// Add a timer for this block, but print only marks, not function
|
|
||||||
// entry and exit. The same as calling the above macro with a negative value.
|
|
||||||
#define NS_TIME_FUNCTION_MARK_ONLY \
|
|
||||||
mozilla::FunctionTimer ft__autogen((-1), "%s (line %d)", MOZ_FUNCTION_NAME, __LINE__)
|
|
||||||
|
|
||||||
// Add a timer for this block, using the printf-style format.
|
|
||||||
// Both function entry and exit will be printed.
|
|
||||||
#define NS_TIME_FUNCTION_FMT(...) \
|
|
||||||
mozilla::FunctionTimer ft__autogen(__VA_ARGS__)
|
|
||||||
|
|
||||||
// Add a timer for this block, using the given minimum number of
|
|
||||||
// milliseconds and the given printf-style format. No function entry
|
|
||||||
// will be printed.
|
|
||||||
#define NS_TIME_FUNCTION_MIN_FMT(_ms, ...) \
|
|
||||||
mozilla::FunctionTimer ft__autogen((_ms), __VA_ARGS__)
|
|
||||||
|
|
||||||
// Add a midway mark for the current timer; an existing timer must
|
|
||||||
// have already been created using one of the above macros. The
|
|
||||||
// string given by the printf-style format will be logged, as well as
|
|
||||||
// the total elapsed time since the creation of the timer, and the
|
|
||||||
// time since the last mark.
|
|
||||||
#define NS_TIME_FUNCTION_MARK(...) \
|
|
||||||
ft__autogen.Mark(__VA_ARGS__)
|
|
||||||
|
|
||||||
// A double value representing the time elapsed since NS_TIME_FUNCTION
|
|
||||||
// initialization, in ms.
|
|
||||||
#define NS_TIME_FUNCTION_ELAPSED \
|
|
||||||
ft__autogen.Elapsed()
|
|
||||||
|
|
||||||
// A double value representing the time elapsed since the last
|
|
||||||
// NS_TIME_FUNCTION_MARK, in ms.
|
|
||||||
#define NS_TIME_FUNCTION_ELAPSED_SINCE_MARK \
|
|
||||||
ft__autogen.ElapsedSinceMark
|
|
||||||
|
|
||||||
// A TimeDuration value representing the elapsed time between the
|
|
||||||
// last logged event of any sort and the app startup.
|
|
||||||
#define NS_TIME_FUNCTION_LATEST \
|
|
||||||
mozilla::FunctionTimer::LatestSinceStartup()
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define NS_TIME_FUNCTION do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_MIN(_ms) do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_MARK_ONLY do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_FMT(...) do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_MIN_FMT(_ms, ...) do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_MARK(...) do { } while (0)
|
|
||||||
#define NS_TIME_FUNCTION_ELAPSED (0)
|
|
||||||
#define NS_TIME_FUNCTION_ELAPSED_SINCE_MARK (0)
|
|
||||||
#define NS_TIME_FUNCTION_LATEST (mozilla::TimeDuration(0))
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
|
|
||||||
class FunctionTimerLog
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
FunctionTimerLog(const char *fname);
|
|
||||||
~FunctionTimerLog();
|
|
||||||
|
|
||||||
void LogString(const char *str);
|
|
||||||
|
|
||||||
TimeDuration LatestSinceStartup() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void *mFile;
|
|
||||||
TimeStamp mLatest;
|
|
||||||
};
|
|
||||||
|
|
||||||
class FunctionTimer
|
|
||||||
{
|
|
||||||
static nsAutoPtr<FunctionTimerLog> sLog;
|
|
||||||
static char *sBuf1;
|
|
||||||
static char *sBuf2;
|
|
||||||
static int sBufSize;
|
|
||||||
static unsigned sDepth;
|
|
||||||
|
|
||||||
enum { BUF_LOG_LENGTH = 1024 };
|
|
||||||
|
|
||||||
public:
|
|
||||||
static int InitTimers();
|
|
||||||
|
|
||||||
static int ft_vsnprintf(char *str, int maxlen, const char *fmt, va_list args);
|
|
||||||
static int ft_snprintf(char *str, int maxlen, const char *fmt, ...);
|
|
||||||
|
|
||||||
static void LogMessage(const char *s, ...) {
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, s);
|
|
||||||
|
|
||||||
if (sLog) {
|
|
||||||
ft_vsnprintf(sBuf1, sBufSize, s, ap);
|
|
||||||
sLog->LogString(sBuf1);
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Init(const char *s, va_list ap) {
|
|
||||||
if (mEnabled) {
|
|
||||||
TimeInit();
|
|
||||||
|
|
||||||
ft_vsnprintf(mString, BUF_LOG_LENGTH, s, ap);
|
|
||||||
|
|
||||||
ft_snprintf(sBuf1, sBufSize, "> (% 3d)%*s|%s%s", mDepth, mDepth, " ", mHasMinMs ? "?MINMS " : "", mString);
|
|
||||||
sLog->LogString(sBuf1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
inline void TimeInit() {
|
|
||||||
if (mEnabled) {
|
|
||||||
mStart = TimeStamp::Now();
|
|
||||||
mLastMark = mStart;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline double Elapsed() {
|
|
||||||
if (mEnabled)
|
|
||||||
return (TimeStamp::Now() - mStart).ToSeconds() * 1000.0;
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline double ElapsedSinceMark() {
|
|
||||||
if (mEnabled)
|
|
||||||
return (TimeStamp::Now() - mLastMark).ToSeconds() * 1000.0;
|
|
||||||
return 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline TimeDuration LatestSinceStartup() {
|
|
||||||
return sLog ? sLog->LatestSinceStartup() : TimeDuration(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionTimer(double minms, const char *s, ...)
|
|
||||||
: mMinMs(minms), mHasMinMs(true),
|
|
||||||
mEnabled(sLog && s && *s), mDepth(++sDepth)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, s);
|
|
||||||
|
|
||||||
Init(s, ap);
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
FunctionTimer(const char *s, ...)
|
|
||||||
: mMinMs(0.0), mHasMinMs(false),
|
|
||||||
mEnabled(sLog && s && *s), mDepth(++sDepth)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, s);
|
|
||||||
|
|
||||||
Init(s, ap);
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Mark(const char *s, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, s);
|
|
||||||
|
|
||||||
if (mEnabled) {
|
|
||||||
ft_vsnprintf(sBuf1, sBufSize, s, ap);
|
|
||||||
|
|
||||||
TimeStamp now(TimeStamp::Now());
|
|
||||||
double ms = (now - mStart).ToSeconds() * 1000.0;
|
|
||||||
double msl = (now - mLastMark).ToSeconds() * 1000.0;
|
|
||||||
mLastMark = now;
|
|
||||||
|
|
||||||
ft_snprintf(sBuf2, sBufSize, "* (% 3d)%*s|%s%9.2f ms (%9.2f ms total) - %s [%s]", mDepth, mDepth, " ",
|
|
||||||
(!mHasMinMs || mMinMs < 0.0 || msl > mMinMs) ? "<MINMS " : "", msl, ms, mString, sBuf1);
|
|
||||||
sLog->LogString(sBuf2);
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end(ap);
|
|
||||||
}
|
|
||||||
|
|
||||||
~FunctionTimer() {
|
|
||||||
if (mEnabled) {
|
|
||||||
TimeStamp now(TimeStamp::Now());
|
|
||||||
double ms = (now - mStart).ToSeconds() * 1000.0;
|
|
||||||
double msl = (now - mLastMark).ToSeconds() * 1000.0;
|
|
||||||
|
|
||||||
ft_snprintf(sBuf1, sBufSize, "< (% 3d)%*s|%s%9.2f ms (%9.2f ms total) - %s", mDepth, mDepth, " ",
|
|
||||||
(!mHasMinMs || (mMinMs >= 0.0 && msl > mMinMs)) ? "" : "<MINMS ", msl, ms, mString);
|
|
||||||
sLog->LogString(sBuf1);
|
|
||||||
}
|
|
||||||
|
|
||||||
--sDepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeStamp mStart, mLastMark;
|
|
||||||
const double mMinMs;
|
|
||||||
char mString[BUF_LOG_LENGTH+1];
|
|
||||||
const bool mHasMinMs;
|
|
||||||
const bool mEnabled;
|
|
||||||
const unsigned mDepth;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
#endif // mozilla_FunctionTimer_h
|
|
||||||
|
|
||||||
|
|
@ -37,7 +37,6 @@ CPPSRCS = \
|
|||||||
nsCycleCollector.cpp \
|
nsCycleCollector.cpp \
|
||||||
nsStackWalk.cpp \
|
nsStackWalk.cpp \
|
||||||
nsMemoryReporterManager.cpp \
|
nsMemoryReporterManager.cpp \
|
||||||
FunctionTimer.cpp \
|
|
||||||
ClearOnShutdown.cpp \
|
ClearOnShutdown.cpp \
|
||||||
VisualEventTracer.cpp \
|
VisualEventTracer.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
@ -69,7 +68,6 @@ EXPORTS = \
|
|||||||
EXPORTS_NAMESPACES = mozilla
|
EXPORTS_NAMESPACES = mozilla
|
||||||
|
|
||||||
EXPORTS_mozilla = \
|
EXPORTS_mozilla = \
|
||||||
FunctionTimer.h \
|
|
||||||
MapsMemoryReporter.h \
|
MapsMemoryReporter.h \
|
||||||
ClearOnShutdown.h \
|
ClearOnShutdown.h \
|
||||||
StaticPtr.h \
|
StaticPtr.h \
|
||||||
|
@ -182,7 +182,6 @@ StackWalkInitCriticalAddress()
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include "plstr.h"
|
#include "plstr.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
#include "nspr.h"
|
#include "nspr.h"
|
||||||
#include <imagehlp.h>
|
#include <imagehlp.h>
|
||||||
@ -684,8 +683,6 @@ EnsureSymInitialized()
|
|||||||
if (gInitialized)
|
if (gInitialized)
|
||||||
return gInitialized;
|
return gInitialized;
|
||||||
|
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
if (!EnsureImageHlpInitialized())
|
if (!EnsureImageHlpInitialized())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -99,7 +99,6 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
|
|||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "mozilla/Omnijar.h"
|
#include "mozilla/Omnijar.h"
|
||||||
#include "mozilla/HangMonitor.h"
|
#include "mozilla/HangMonitor.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
@ -313,25 +312,17 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
nsIFile* binDirectory,
|
nsIFile* binDirectory,
|
||||||
nsIDirectoryServiceProvider* appFileLocationProvider)
|
nsIDirectoryServiceProvider* appFileLocationProvider)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
// We are not shutting down
|
// We are not shutting down
|
||||||
gXPCOMShuttingDown = false;
|
gXPCOMShuttingDown = false;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: AvailableMemoryTracker Init()");
|
|
||||||
|
|
||||||
// Initialize the available memory tracker before other threads have had a
|
// Initialize the available memory tracker before other threads have had a
|
||||||
// chance to start up, because the initialization is not thread-safe.
|
// chance to start up, because the initialization is not thread-safe.
|
||||||
mozilla::AvailableMemoryTracker::Init();
|
mozilla::AvailableMemoryTracker::Init();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: log init");
|
|
||||||
|
|
||||||
NS_LogInit();
|
NS_LogInit();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: IPC init");
|
|
||||||
|
|
||||||
// Set up chromium libs
|
// Set up chromium libs
|
||||||
NS_ASSERTION(!sExitManager && !sMessageLoop, "Bad logic!");
|
NS_ASSERTION(!sExitManager && !sMessageLoop, "Bad logic!");
|
||||||
|
|
||||||
@ -358,21 +349,15 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
sIOThread = ioThread.release();
|
sIOThread = ioThread.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: thread manager init");
|
|
||||||
|
|
||||||
// Establish the main thread here.
|
// Establish the main thread here.
|
||||||
rv = nsThreadManager::get()->Init();
|
rv = nsThreadManager::get()->Init();
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: timer startup");
|
|
||||||
|
|
||||||
// Set up the timer globals/timer thread
|
// Set up the timer globals/timer thread
|
||||||
rv = nsTimerImpl::Startup();
|
rv = nsTimerImpl::Startup();
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
NS_TIME_FUNCTION_MARK("Next: setlocale");
|
|
||||||
|
|
||||||
// If the locale hasn't already been setup by our embedder,
|
// If the locale hasn't already been setup by our embedder,
|
||||||
// get us out of the "C" locale and into the system
|
// get us out of the "C" locale and into the system
|
||||||
if (strcmp(setlocale(LC_ALL, NULL), "C") == 0)
|
if (strcmp(setlocale(LC_ALL, NULL), "C") == 0)
|
||||||
@ -380,13 +365,9 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(XP_UNIX) || defined(XP_OS2)
|
#if defined(XP_UNIX) || defined(XP_OS2)
|
||||||
NS_TIME_FUNCTION_MARK("Next: startup native charset utils");
|
|
||||||
|
|
||||||
NS_StartupNativeCharsetUtils();
|
NS_StartupNativeCharsetUtils();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: startup local file");
|
|
||||||
|
|
||||||
NS_StartupLocalFile();
|
NS_StartupLocalFile();
|
||||||
|
|
||||||
StartupSpecialSystemDirectory();
|
StartupSpecialSystemDirectory();
|
||||||
@ -420,15 +401,11 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
|
nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: Omnijar init");
|
|
||||||
|
|
||||||
if (!mozilla::Omnijar::IsInitialized()) {
|
if (!mozilla::Omnijar::IsInitialized()) {
|
||||||
mozilla::Omnijar::Init();
|
mozilla::Omnijar::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
|
if ((sCommandLineWasInitialized = !CommandLine::IsInitialized())) {
|
||||||
NS_TIME_FUNCTION_MARK("Next: IPC command line init");
|
|
||||||
|
|
||||||
#ifdef OS_WIN
|
#ifdef OS_WIN
|
||||||
CommandLine::Init(0, nullptr);
|
CommandLine::Init(0, nullptr);
|
||||||
#else
|
#else
|
||||||
@ -452,8 +429,6 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
|
|
||||||
NS_ASSERTION(nsComponentManagerImpl::gComponentManager == NULL, "CompMgr not null at init");
|
NS_ASSERTION(nsComponentManagerImpl::gComponentManager == NULL, "CompMgr not null at init");
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: component manager init");
|
|
||||||
|
|
||||||
// Create the Component/Service Manager
|
// Create the Component/Service Manager
|
||||||
nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl();
|
nsComponentManagerImpl::gComponentManager = new nsComponentManagerImpl();
|
||||||
NS_ADDREF(nsComponentManagerImpl::gComponentManager);
|
NS_ADDREF(nsComponentManagerImpl::gComponentManager);
|
||||||
@ -472,16 +447,10 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
|
NS_ADDREF(*result = nsComponentManagerImpl::gComponentManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: cycle collector startup");
|
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: interface info manager init");
|
|
||||||
|
|
||||||
// The iimanager constructor searches and registers XPT files.
|
// The iimanager constructor searches and registers XPT files.
|
||||||
// (We trigger the singleton's lazy construction here to make that happen.)
|
// (We trigger the singleton's lazy construction here to make that happen.)
|
||||||
(void) xptiInterfaceInfoManager::GetSingleton();
|
(void) xptiInterfaceInfoManager::GetSingleton();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: register category providers");
|
|
||||||
|
|
||||||
// After autoreg, but before we actually instantiate any components,
|
// After autoreg, but before we actually instantiate any components,
|
||||||
// add any services listed in the "xpcom-directory-providers" category
|
// add any services listed in the "xpcom-directory-providers" category
|
||||||
// to the directory service.
|
// to the directory service.
|
||||||
@ -490,8 +459,6 @@ NS_InitXPCOM2(nsIServiceManager* *result,
|
|||||||
mozilla::scache::StartupCache::GetSingleton();
|
mozilla::scache::StartupCache::GetSingleton();
|
||||||
mozilla::AvailableMemoryTracker::Activate();
|
mozilla::AvailableMemoryTracker::Activate();
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: create services from category");
|
|
||||||
|
|
||||||
// Notify observers of xpcom autoregistration start
|
// Notify observers of xpcom autoregistration start
|
||||||
NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,
|
NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
|
|
||||||
#include "ManifestParser.h"
|
#include "ManifestParser.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
class nsIComponentLoaderManager;
|
class nsIComponentLoaderManager;
|
||||||
@ -732,9 +731,6 @@ NS_CreateServicesFromCategory(const char *category,
|
|||||||
nsISupports *origin,
|
nsISupports *origin,
|
||||||
const char *observerTopic)
|
const char *observerTopic)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION_FMT("NS_CreateServicesFromCategory: %s (%s)",
|
|
||||||
category, observerTopic ? observerTopic : "(no topic)");
|
|
||||||
|
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
|
||||||
nsCOMPtr<nsICategoryManager> categoryManager =
|
nsCOMPtr<nsICategoryManager> categoryManager =
|
||||||
@ -768,8 +764,6 @@ NS_CreateServicesFromCategory(const char *category,
|
|||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("getservice: %s", contractID.get());
|
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> instance = do_GetService(contractID);
|
nsCOMPtr<nsISupports> instance = do_GetService(contractID);
|
||||||
if (!instance) {
|
if (!instance) {
|
||||||
LogMessage("While creating services from category '%s', could not create service for entry '%s', contract ID '%s'",
|
LogMessage("While creating services from category '%s', could not create service for entry '%s', contract ID '%s'",
|
||||||
@ -778,8 +772,6 @@ NS_CreateServicesFromCategory(const char *category,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (observerTopic) {
|
if (observerTopic) {
|
||||||
NS_TIME_FUNCTION_MARK("observe: %s", contractID.get());
|
|
||||||
|
|
||||||
// try an observer, if it implements it.
|
// try an observer, if it implements it.
|
||||||
nsCOMPtr<nsIObserver> observer = do_QueryInterface(instance);
|
nsCOMPtr<nsIObserver> observer = do_QueryInterface(instance);
|
||||||
if (observer)
|
if (observer)
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
#include "private/pprthred.h"
|
#include "private/pprthred.h"
|
||||||
#include "nsTArray.h"
|
#include "nsTArray.h"
|
||||||
#include "prio.h"
|
#include "prio.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "ManifestParser.h"
|
#include "ManifestParser.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
|
|
||||||
@ -130,20 +129,6 @@ NS_DEFINE_CID(kCategoryManagerCID, NS_CATEGORYMANAGER_CID);
|
|||||||
|
|
||||||
#define UID_STRING_LENGTH 39
|
#define UID_STRING_LENGTH 39
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
#define COMPMGR_TIME_FUNCTION_CID(cid) \
|
|
||||||
char cid_buf__[NSID_LENGTH] = { '\0' }; \
|
|
||||||
cid.ToProvidedString(cid_buf__); \
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (cid: %s)", MOZ_FUNCTION_NAME, \
|
|
||||||
__LINE__, cid_buf__)
|
|
||||||
#define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) \
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(5, "%s (line %d) (contractid: %s)", MOZ_FUNCTION_NAME, \
|
|
||||||
__LINE__, (cid))
|
|
||||||
#else
|
|
||||||
#define COMPMGR_TIME_FUNCTION_CID(cid) do {} while (0)
|
|
||||||
#define COMPMGR_TIME_FUNCTION_CONTRACTID(cid) do {} while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const
|
nsGetServiceFromCategory::operator()(const nsIID& aIID, void** aInstancePtr) const
|
||||||
{
|
{
|
||||||
@ -294,8 +279,6 @@ nsComponentManagerImpl::InitializeModuleLocations()
|
|||||||
|
|
||||||
nsresult nsComponentManagerImpl::Init()
|
nsresult nsComponentManagerImpl::Init()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
PR_ASSERT(NOT_INITIALIZED == mStatus);
|
PR_ASSERT(NOT_INITIALIZED == mStatus);
|
||||||
|
|
||||||
if (nsComponentManagerLog == nullptr)
|
if (nsComponentManagerLog == nullptr)
|
||||||
@ -304,7 +287,6 @@ nsresult nsComponentManagerImpl::Init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize our arena
|
// Initialize our arena
|
||||||
NS_TIME_FUNCTION_MARK("Next: init component manager arena");
|
|
||||||
PL_INIT_ARENA_POOL(&mArena, "ComponentManagerArena", NS_CM_BLOCK_SIZE);
|
PL_INIT_ARENA_POOL(&mArena, "ComponentManagerArena", NS_CM_BLOCK_SIZE);
|
||||||
|
|
||||||
mFactories.Init(CONTRACTID_HASHTABLE_INITIAL_SIZE);
|
mFactories.Init(CONTRACTID_HASHTABLE_INITIAL_SIZE);
|
||||||
@ -337,7 +319,6 @@ nsresult nsComponentManagerImpl::Init()
|
|||||||
PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG,
|
PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG,
|
||||||
("nsComponentManager: Initialized."));
|
("nsComponentManager: Initialized."));
|
||||||
|
|
||||||
NS_TIME_FUNCTION_MARK("Next: init native module loader");
|
|
||||||
nsresult rv = mNativeModuleLoader.Init();
|
nsresult rv = mNativeModuleLoader.Init();
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
@ -720,8 +701,6 @@ nsComponentManagerImpl::KnownModule::Description() const
|
|||||||
|
|
||||||
nsresult nsComponentManagerImpl::Shutdown(void)
|
nsresult nsComponentManagerImpl::Shutdown(void)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
PR_ASSERT(NORMAL == mStatus);
|
PR_ASSERT(NORMAL == mStatus);
|
||||||
|
|
||||||
mStatus = SHUTDOWN_IN_PROGRESS;
|
mStatus = SHUTDOWN_IN_PROGRESS;
|
||||||
@ -898,8 +877,6 @@ nsComponentManagerImpl::CreateInstance(const nsCID &aClass,
|
|||||||
const nsIID &aIID,
|
const nsIID &aIID,
|
||||||
void **aResult)
|
void **aResult)
|
||||||
{
|
{
|
||||||
COMPMGR_TIME_FUNCTION_CID(aClass);
|
|
||||||
|
|
||||||
// test this first, since there's no point in creating a component during
|
// test this first, since there's no point in creating a component during
|
||||||
// shutdown -- whether it's available or not would depend on the order it
|
// shutdown -- whether it's available or not would depend on the order it
|
||||||
// occurs in the list
|
// occurs in the list
|
||||||
@ -982,8 +959,6 @@ nsComponentManagerImpl::CreateInstanceByContractID(const char *aContractID,
|
|||||||
const nsIID &aIID,
|
const nsIID &aIID,
|
||||||
void **aResult)
|
void **aResult)
|
||||||
{
|
{
|
||||||
COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
|
|
||||||
|
|
||||||
NS_ENSURE_ARG_POINTER(aContractID);
|
NS_ENSURE_ARG_POINTER(aContractID);
|
||||||
|
|
||||||
// test this first, since there's no point in creating a component during
|
// test this first, since there's no point in creating a component during
|
||||||
@ -1182,9 +1157,6 @@ nsComponentManagerImpl::GetService(const nsCID& aClass,
|
|||||||
return supports->QueryInterface(aIID, result);
|
return supports->QueryInterface(aIID, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only care about time when we create the service.
|
|
||||||
COMPMGR_TIME_FUNCTION_CID(aClass);
|
|
||||||
|
|
||||||
PRThread* currentPRThread = PR_GetCurrentThread();
|
PRThread* currentPRThread = PR_GetCurrentThread();
|
||||||
NS_ASSERTION(currentPRThread, "This should never be null!");
|
NS_ASSERTION(currentPRThread, "This should never be null!");
|
||||||
|
|
||||||
@ -1265,8 +1237,6 @@ nsComponentManagerImpl::IsServiceInstantiated(const nsCID & aClass,
|
|||||||
const nsIID& aIID,
|
const nsIID& aIID,
|
||||||
bool *result)
|
bool *result)
|
||||||
{
|
{
|
||||||
COMPMGR_TIME_FUNCTION_CID(aClass);
|
|
||||||
|
|
||||||
// Now we want to get the service if we already got it. If not, we don't want
|
// Now we want to get the service if we already got it. If not, we don't want
|
||||||
// to create an instance of it. mmh!
|
// to create an instance of it. mmh!
|
||||||
|
|
||||||
@ -1306,8 +1276,6 @@ NS_IMETHODIMP nsComponentManagerImpl::IsServiceInstantiatedByContractID(const ch
|
|||||||
const nsIID& aIID,
|
const nsIID& aIID,
|
||||||
bool *result)
|
bool *result)
|
||||||
{
|
{
|
||||||
COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
|
|
||||||
|
|
||||||
// Now we want to get the service if we already got it. If not, we don't want
|
// Now we want to get the service if we already got it. If not, we don't want
|
||||||
// to create an instance of it. mmh!
|
// to create an instance of it. mmh!
|
||||||
|
|
||||||
@ -1377,9 +1345,6 @@ nsComponentManagerImpl::GetServiceByContractID(const char* aContractID,
|
|||||||
return serviceObject->QueryInterface(aIID, result);
|
return serviceObject->QueryInterface(aIID, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We only care about time when we create the service.
|
|
||||||
COMPMGR_TIME_FUNCTION_CONTRACTID(aContractID);
|
|
||||||
|
|
||||||
PRThread* currentPRThread = PR_GetCurrentThread();
|
PRThread* currentPRThread = PR_GetCurrentThread();
|
||||||
NS_ASSERTION(currentPRThread, "This should never be null!");
|
NS_ASSERTION(currentPRThread, "This should never be null!");
|
||||||
|
|
||||||
@ -1600,8 +1565,6 @@ EnumerateCIDHelper(const nsID& id, nsFactoryEntry* entry, void* closure)
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsComponentManagerImpl::EnumerateCIDs(nsISimpleEnumerator **aEnumerator)
|
nsComponentManagerImpl::EnumerateCIDs(nsISimpleEnumerator **aEnumerator)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsCOMArray<nsISupports> array;
|
nsCOMArray<nsISupports> array;
|
||||||
mFactories.EnumerateRead(EnumerateCIDHelper, &array);
|
mFactories.EnumerateRead(EnumerateCIDHelper, &array);
|
||||||
|
|
||||||
@ -1619,8 +1582,6 @@ EnumerateContractsHelper(const nsACString& contract, nsFactoryEntry* entry, void
|
|||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsComponentManagerImpl::EnumerateContractIDs(nsISimpleEnumerator **aEnumerator)
|
nsComponentManagerImpl::EnumerateContractIDs(nsISimpleEnumerator **aEnumerator)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
nsTArray<nsCString>* array = new nsTArray<nsCString>;
|
nsTArray<nsCString>* array = new nsTArray<nsCString>;
|
||||||
mContractIDs.EnumerateRead(EnumerateContractsHelper, array);
|
mContractIDs.EnumerateRead(EnumerateContractsHelper, array);
|
||||||
|
|
||||||
|
@ -17,12 +17,10 @@
|
|||||||
#include "nscore.h"
|
#include "nscore.h"
|
||||||
#include "private/pprio.h"
|
#include "private/pprio.h"
|
||||||
#include "mozilla/FileUtils.h"
|
#include "mozilla/FileUtils.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
mozilla::fallocate(PRFileDesc *aFD, int64_t aLength)
|
mozilla::fallocate(PRFileDesc *aFD, int64_t aLength)
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
#if defined(HAVE_POSIX_FALLOCATE)
|
#if defined(HAVE_POSIX_FALLOCATE)
|
||||||
return posix_fallocate(PR_FileDesc2NativeHandle(aFD), 0, aLength) == 0;
|
return posix_fallocate(PR_FileDesc2NativeHandle(aFD), 0, aLength) == 0;
|
||||||
#elif defined(XP_WIN)
|
#elif defined(XP_WIN)
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsISupportsArray.h"
|
#include "nsISupportsArray.h"
|
||||||
#include "nsArrayEnumerator.h"
|
#include "nsArrayEnumerator.h"
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#include "nsDirectoryService.h"
|
#include "nsDirectoryService.h"
|
||||||
#include "mozilla/FileUtils.h"
|
#include "mozilla/FileUtils.h"
|
||||||
#include "nsIMemoryReporter.h"
|
#include "nsIMemoryReporter.h"
|
||||||
@ -66,8 +65,6 @@ xptiInterfaceInfoManager*
|
|||||||
xptiInterfaceInfoManager::GetSingleton()
|
xptiInterfaceInfoManager::GetSingleton()
|
||||||
{
|
{
|
||||||
if (!gInterfaceInfoManager) {
|
if (!gInterfaceInfoManager) {
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
gInterfaceInfoManager = new xptiInterfaceInfoManager();
|
gInterfaceInfoManager = new xptiInterfaceInfoManager();
|
||||||
NS_ADDREF(gInterfaceInfoManager);
|
NS_ADDREF(gInterfaceInfoManager);
|
||||||
}
|
}
|
||||||
@ -335,8 +332,6 @@ NS_IMETHODIMP xptiInterfaceInfoManager::EnumerateInterfacesWhoseNamesStartWith(c
|
|||||||
/* void autoRegisterInterfaces (); */
|
/* void autoRegisterInterfaces (); */
|
||||||
NS_IMETHODIMP xptiInterfaceInfoManager::AutoRegisterInterfaces()
|
NS_IMETHODIMP xptiInterfaceInfoManager::AutoRegisterInterfaces()
|
||||||
{
|
{
|
||||||
NS_TIME_FUNCTION;
|
|
||||||
|
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
# include "nsXULAppAPI.h"
|
# include "nsXULAppAPI.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mozilla/FunctionTimer.h"
|
|
||||||
#if defined(NS_FUNCTION_TIMER) && defined(_MSC_VER)
|
#if defined(NS_FUNCTION_TIMER) && defined(_MSC_VER)
|
||||||
#include "nsTimerImpl.h"
|
#include "nsTimerImpl.h"
|
||||||
#include "nsStackWalk.h"
|
#include "nsStackWalk.h"
|
||||||
@ -604,17 +603,6 @@ nsThread::ProcessNextEvent(bool mayWait, bool *result)
|
|||||||
nsCOMPtr<nsIRunnable> event;
|
nsCOMPtr<nsIRunnable> event;
|
||||||
mEvents.GetEvent(mayWait && !ShuttingDown(), getter_AddRefs(event));
|
mEvents.GetEvent(mayWait && !ShuttingDown(), getter_AddRefs(event));
|
||||||
|
|
||||||
#ifdef NS_FUNCTION_TIMER
|
|
||||||
char message[1024] = {'\0'};
|
|
||||||
if (MAIN_THREAD == mIsMainThread) {
|
|
||||||
mozilla::FunctionTimer::ft_snprintf(message, sizeof(message),
|
|
||||||
"@ Main Thread Event %p", (void*)event.get());
|
|
||||||
}
|
|
||||||
// If message is empty, it means that we're not on the main thread, and
|
|
||||||
// FunctionTimer won't time this function.
|
|
||||||
NS_TIME_FUNCTION_MIN_FMT(5.0, message);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
*result = (event.get() != nullptr);
|
*result = (event.get() != nullptr);
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user