--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -204,17 +204,16 @@ MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS =
MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS = @MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS@
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
XPCOM_LIBS=@XPCOM_LIBS@
LIBXUL_LIBS=@LIBXUL_LIBS@
-MOZ_TIMELINE=@MOZ_TIMELINE@
ENABLE_STRIP = @ENABLE_STRIP@
PKG_SKIP_STRIP = @PKG_SKIP_STRIP@
ClientWallet=1
CookieManagement=1
SingleSignon=1
--- a/configure.in
+++ b/configure.in
@@ -4812,17 +4812,16 @@ MOZ_PSM=1
MOZ_RDF=1
MOZ_REFLOW_PERF=
MOZ_SAFE_BROWSING=
MOZ_HELP_VIEWER=
MOZ_SPELLCHECK=1
MOZ_SPLASHSCREEN=
MOZ_STORAGE=1
MOZ_SVG_DLISTS=
-MOZ_TIMELINE=
MOZ_TOOLKIT_SEARCH=1
MOZ_UI_LOCALE=en-US
MOZ_UNIVERSALCHARDET=1
MOZ_URL_CLASSIFIER=
MOZ_XSLT_STANDALONE=
MOZ_XTF=1
MOZ_XUL=1
MOZ_ZIPWRITER=1
@@ -7744,29 +7743,16 @@ fi
dnl ========================================================
dnl =
dnl = Profiling and Instrumenting
dnl =
dnl ========================================================
MOZ_ARG_HEADER(Profiling and Instrumenting)
dnl ========================================================
-dnl = Enable timeline service, which provides lightweight
-dnl = instrumentation of mozilla for performance measurement.
-dnl = Timeline is off by default.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(timeline,
-[ --enable-timeline Enable timeline services ],
- MOZ_TIMELINE=1,
- MOZ_TIMELINE= )
-if test -n "$MOZ_TIMELINE"; then
- AC_DEFINE(MOZ_TIMELINE)
-fi
-
-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= )
@@ -8974,17 +8960,16 @@ AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
AC_SUBST(USE_DEPENDENT_LIBS)
AC_SUBST(MOZ_BUILD_ROOT)
AC_SUBST(MOZ_OS2_TOOLS)
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
-AC_SUBST(MOZ_TIMELINE)
# The following variables are available to branding and application
# configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
# - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
# impacts profile location and user-visible fields.
# - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
# versions of a given application (e.g. Aurora and Firefox both use
# "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -133,17 +133,16 @@
#include "prlog.h"
#include "rdf.h"
#include "nsIControllers.h"
// The XUL doc interface
#include "nsIDOMXULDocument.h"
#include "nsReadableUtils.h"
-#include "nsITimelineService.h"
#include "nsIFrame.h"
#include "nsNodeInfoManager.h"
#include "nsXBLBinding.h"
#include "nsEventDispatcher.h"
#include "mozAutoDocUpdate.h"
#include "nsIDOMXULCommandEvent.h"
#include "nsIDOMNSEvent.h"
#include "nsCCUncollectableMarker.h"
@@ -2997,17 +2996,16 @@ nsXULPrototypeScript::SerializeOutOfLine
nsresult
nsXULPrototypeScript::Deserialize(nsIObjectInputStream* aStream,
nsIScriptGlobalObject* aGlobal,
nsIURI* aDocumentURI,
const nsCOMArray<nsINodeInfo> *aNodeInfos)
{
- NS_TIMELINE_MARK_FUNCTION("chrome script deserialize");
nsresult rv;
NS_ASSERTION(!mSrcLoading || mSrcLoadWaiters != nsnull ||
!mScriptObject.mObject,
"prototype script not well-initialized when deserializing?!");
// Read basic prototype data
aStream->Read32(&mLineNo);
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -88,17 +88,16 @@
#include "xpcpublic.h"
#include "jsdbgapi.h" // for JS_ClearWatchPointsForObject
#include "jswrapper.h"
#include "jsxdrapi.h"
#include "nsIArray.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
-#include "nsITimelineService.h"
#include "nsDOMScriptObjectHolder.h"
#include "prmem.h"
#include "WrapperFactory.h"
#include "nsGlobalWindow.h"
#ifdef XP_MACOSX
// AssertMacros.h defines 'check' and conflicts with AccessCheck.h
#undef check
@@ -2095,18 +2094,16 @@ nsresult
nsJSContext::Deserialize(nsIObjectInputStream* aStream,
nsScriptObjectHolder &aResult)
{
JSObject *result = nsnull;
nsresult rv;
NS_TIME_FUNCTION_MIN(1.0);
- NS_TIMELINE_MARK_FUNCTION("js script deserialize");
-
PRUint32 size;
rv = aStream->Read32(&size);
if (NS_FAILED(rv)) return rv;
char* data;
rv = aStream->ReadBytes(size, &data);
if (NS_FAILED(rv)) return rv;
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -2268,28 +2268,22 @@ nsresult nsPluginHost::LoadPlugins()
mozilla::services::GetObserverService();
if (obsService)
obsService->NotifyObservers(nsnull, "plugins-list-updated", nsnull);
}
return NS_OK;
}
-#include "nsITimelineService.h"
-
// if aCreatePluginList is false we will just scan for plugins
// and see if any changes have been made to the plugins.
// This is needed in ReloadPlugins to prevent possible recursive reloads
nsresult nsPluginHost::FindPlugins(PRBool aCreatePluginList, PRBool * aPluginsChanged)
{
Telemetry::AutoTimer<Telemetry::FIND_PLUGINS> telemetry;
- // let's start timing if we are only really creating the plugin list
- if (aCreatePluginList) {
- NS_TIMELINE_START_TIMER("LoadPlugins");
- }
#ifdef CALL_SAFETY_ON
// check preferences on whether or not we want to try safe calls to plugins
NS_INIT_PLUGIN_SAFE_CALLS;
#endif
NS_ENSURE_ARG_POINTER(aPluginsChanged);
@@ -2454,19 +2448,16 @@ nsresult nsPluginHost::FindPlugins(PRBoo
// update the plugins info cache if changes are detected
if (*aPluginsChanged)
WritePluginInfo();
// No more need for cached plugins. Clear it up.
NS_ITERATIVE_UNREF_LIST(nsRefPtr<nsPluginTag>, mCachedPlugins, mNext);
NS_ITERATIVE_UNREF_LIST(nsRefPtr<nsInvalidPluginTag>, mInvalidPlugins, mNext);
- NS_TIMELINE_STOP_TIMER("LoadPlugins");
- NS_TIMELINE_MARK_TIMER("LoadPlugins");
-
return NS_OK;
}
nsresult
nsPluginHost::UpdatePluginInfo(nsPluginTag* aPluginTag)
{
ReadPluginInfo();
WritePluginInfo();
--- a/embedding/components/find/src/nsWebBrowserFind.cpp
+++ b/embedding/components/find/src/nsWebBrowserFind.cpp
@@ -65,17 +65,16 @@
#include "nsReadableUtils.h"
#include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIContent.h"
#include "nsContentCID.h"
#include "nsIServiceManager.h"
#include "nsIObserverService.h"
#include "nsISupportsPrimitives.h"
-#include "nsITimelineService.h"
#include "nsFind.h"
#include "nsDOMError.h"
#include "nsFocusManager.h"
#include "mozilla/Services.h"
#if DEBUG
#include "nsIWebNavigation.h"
#include "nsXPIDLString.h"
--- a/intl/locale/src/nsCharsetAliasImp.cpp
+++ b/intl/locale/src/nsCharsetAliasImp.cpp
@@ -40,17 +40,16 @@
#include "pratom.h"
// for NS_IMPL_IDS only
#include "nsIPlatformCharset.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsUConvPropertySearch.h"
-#include "nsITimelineService.h"
#include "nsCharsetAlias.h"
//--------------------------------------------------------------
NS_IMPL_THREADSAFE_ISUPPORTS1(nsCharsetAlias2, nsICharsetAlias)
//--------------------------------------------------------------
nsCharsetAlias2::nsCharsetAlias2()
{
@@ -66,26 +65,22 @@ static const char* kAliases[][3] = {
};
//--------------------------------------------------------------
NS_IMETHODIMP nsCharsetAlias2::GetPreferred(const nsACString& aAlias,
nsACString& oResult)
{
if (aAlias.IsEmpty()) return NS_ERROR_NULL_POINTER;
- NS_TIMELINE_START_TIMER("nsCharsetAlias2:GetPreferred");
-
nsCAutoString key(aAlias);
ToLowerCase(key);
nsresult rv = nsUConvPropertySearch::SearchPropertyValue(kAliases,
NS_ARRAY_LENGTH(kAliases), key, oResult);
- NS_TIMELINE_STOP_TIMER("nsCharsetAlias2:GetPreferred");
- NS_TIMELINE_MARK_TIMER("nsCharsetAlias2:GetPreferred");
return rv;
}
//--------------------------------------------------------------
NS_IMETHODIMP
nsCharsetAlias2::Equals(const nsACString& aCharset1,
const nsACString& aCharset2, PRBool* oResult)
{
--- a/intl/locale/src/os2/nsOS2Charset.cpp
+++ b/intl/locale/src/os2/nsOS2Charset.cpp
@@ -43,38 +43,33 @@
#include "pratom.h"
#define INCL_WIN
#include <os2.h>
#include "nsIOS2Locale.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsLocaleCID.h"
#include "nsIServiceManager.h"
-#include "nsITimelineService.h"
#include "nsPlatformCharset.h"
static const char* kOS2Charsets[][3] = {
#include "os2charset.properties.h"
};
NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset)
nsPlatformCharset::nsPlatformCharset()
{
- NS_TIMELINE_START_TIMER("nsPlatformCharset()");
-
UINT acp = ::WinQueryCp(HMQ_CURRENT);
PRInt32 acpint = (PRInt32)(acp & 0x00FFFF);
nsAutoString acpKey(NS_LITERAL_STRING("os2."));
acpKey.AppendInt(acpint, 10);
nsresult res = MapToCharset(acpKey, mCharset);
+}
- NS_TIMELINE_STOP_TIMER("nsPlatformCharset()");
- NS_TIMELINE_MARK_TIMER("nsPlatformCharset()");
- }
nsPlatformCharset::~nsPlatformCharset()
{
}
nsresult
nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset)
{
nsCAutoString key;
--- a/intl/locale/src/windows/nsWinCharset.cpp
+++ b/intl/locale/src/windows/nsWinCharset.cpp
@@ -39,36 +39,30 @@
#include "nsUConvPropertySearch.h"
#include "pratom.h"
#include <windows.h>
#include "nsWin32Locale.h"
#include "nsCOMPtr.h"
#include "nsReadableUtils.h"
#include "nsLocaleCID.h"
#include "nsServiceManagerUtils.h"
-#include "nsITimelineService.h"
#include "nsPlatformCharset.h"
#include "nsEncoderDecoderUtils.h"
static const char* kWinCharsets[][3] = {
#include "wincharset.properties.h"
};
NS_IMPL_ISUPPORTS1(nsPlatformCharset, nsIPlatformCharset)
nsPlatformCharset::nsPlatformCharset()
{
- NS_TIMELINE_START_TIMER("nsPlatformCharset()");
-
nsAutoString acpKey(NS_LITERAL_STRING("acp."));
acpKey.AppendInt(PRInt32(::GetACP() & 0x00FFFF), 10);
MapToCharset(acpKey, mCharset);
-
- NS_TIMELINE_STOP_TIMER("nsPlatformCharset()");
- NS_TIMELINE_MARK_TIMER("nsPlatformCharset()");
}
nsPlatformCharset::~nsPlatformCharset()
{
}
nsresult
nsPlatformCharset::MapToCharset(nsAString& inANSICodePage, nsACString& outCharset)
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -56,17 +56,16 @@
#include "nsIComponentManager.h"
#include "nsIMemory.h"
#include "nsIObserverService.h"
#include "pratom.h"
#include "prmem.h"
#include "nsCOMArray.h"
#include "nsTextFormatter.h"
#include "nsIErrorService.h"
-#include "nsITimelineService.h"
#include "nsICategoryManager.h"
#include "nsPrintfCString.h"
// for async loading
#ifdef ASYNC_LOADING
#include "nsIBinaryInputStream.h"
#include "nsIStringStream.h"
#endif
@@ -123,18 +122,16 @@ nsStringBundle::LoadProperties()
// It's a string bundle. We expect a text/plain type, so set that as hint
channel->SetContentType(NS_LITERAL_CSTRING("text/plain"));
nsCOMPtr<nsIInputStream> in;
rv = channel->Open(getter_AddRefs(in));
if (NS_FAILED(rv)) return rv;
- NS_TIMELINE_MARK_FUNCTION("loading properties");
-
NS_ASSERTION(NS_SUCCEEDED(rv) && in, "Error in OpenBlockingStream");
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && in, NS_ERROR_FAILURE);
mProps = do_CreateInstance(kPersistentPropertiesCID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
mAttemptedLoad = mLoaded = PR_TRUE;
rv = mProps->Load(in);
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -110,17 +110,16 @@ MOZ_UI_LOCALE = @MOZ_UI_LOCALE@
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
XPCOM_LIBS=@XPCOM_LIBS@
-MOZ_TIMELINE=@MOZ_TIMELINE@
ENABLE_STRIP = @ENABLE_STRIP@
PKG_SKIP_STRIP = @PKG_SKIP_STRIP@
MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@
MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@
MOZ_BUILD_ROOT = @MOZ_BUILD_ROOT@
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -5124,29 +5124,16 @@ MOZ_ARG_ENABLE_BOOL(install-strip,
dnl ========================================================
dnl =
dnl = Profiling and Instrumenting
dnl =
dnl ========================================================
MOZ_ARG_HEADER(Profiling and Instrumenting)
dnl ========================================================
-dnl = Enable timeline service, which provides lightweight
-dnl = instrumentation of mozilla for performance measurement.
-dnl = Timeline is off by default.
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(timeline,
-[ --enable-timeline Enable timeline services ],
- MOZ_TIMELINE=1,
- MOZ_TIMELINE= )
-if test -n "$MOZ_TIMELINE"; then
- AC_DEFINE(MOZ_TIMELINE)
-fi
-
-dnl ========================================================
dnl = Support for Quantify (Windows)
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(quantify,
[ --enable-quantify Enable Quantify support (Windows only) ],
MOZ_QUANTIFY=1,
MOZ_QUANTIFY= )
dnl ========================================================
@@ -5672,17 +5659,16 @@ AC_SUBST(MOZ_FIX_LINK_PATHS)
AC_SUBST(USE_DEPENDENT_LIBS)
AC_SUBST(MOZ_BUILD_ROOT)
AC_SUBST(MOZ_OS2_TOOLS)
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
-AC_SUBST(MOZ_TIMELINE)
AC_SUBST(MOZ_APP_NAME)
AC_SUBST(MOZ_APP_DISPLAYNAME)
AC_SUBST(MOZ_APP_UA_NAME)
AC_SUBST(MOZ_APP_VERSION)
AC_SUBST(FIREFOX_VERSION)
AC_SUBST(MOZ_PKG_SPECIAL)
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -117,17 +117,16 @@
#include "nsPIDOMWindow.h"
#include "nsDOMNavigationTiming.h"
#include "nsPIWindowRoot.h"
#include "nsJSEnvironment.h"
#include "nsFocusManager.h"
#include "nsIScrollableFrame.h"
#include "nsIHTMLDocument.h"
-#include "nsITimelineService.h"
#include "nsGfxCIID.h"
#include "nsStyleSheetService.h"
#include "nsURILoader.h"
#include "nsRenderingContext.h"
#include "nsIPrompt.h"
#include "imgIContainer.h" // image animation mode constants
@@ -1063,32 +1062,16 @@ DocumentViewerImpl::LoadComplete(nsresul
if (timing) {
timing->NotifyLoadEventStart();
}
nsEventDispatcher::Dispatch(window, mPresContext, &event, nsnull,
&status);
if (timing) {
timing->NotifyLoadEventEnd();
}
-#ifdef MOZ_TIMELINE
- // if navigator.xul's load is complete, the main nav window is visible
- // mark that point.
-
- nsIURI *uri = mDocument ? mDocument->GetDocumentURI() : nsnull;
-
- if (uri) {
- //printf("DEBUG: getting spec for uri (%p)\n", uri.get());
- nsCAutoString spec;
- uri->GetSpec(spec);
- if (spec.EqualsLiteral("chrome://navigator/content/navigator.xul") ||
- spec.EqualsLiteral("chrome://browser/content/browser.xul")) {
- NS_TIMELINE_MARK("Navigator Window visible now");
- }
- }
-#endif /* MOZ_TIMELINE */
}
} else {
// XXX: Should fire error event to the document...
}
// Notify the document that it has been shown (regardless of whether
// it was just loaded). Note: mDocument may be null now if the above
// firing of onload caused the document to unload.
--- a/layout/printing/nsPagePrintTimer.h
+++ b/layout/printing/nsPagePrintTimer.h
@@ -34,17 +34,16 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsPagePrintTimer_h___
#define nsPagePrintTimer_h___
// Timer Includes
#include "nsITimer.h"
-#include "nsITimelineService.h"
#include "nsIDocumentViewerPrint.h"
#include "nsPrintObject.h"
class nsPrintEngine;
//---------------------------------------------------
//-- Page Timer Class
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -64,17 +64,16 @@
#include "nsHashtable.h"
#include "nsIURI.h"
#include "nsIServiceManager.h"
#include "nsNetUtil.h"
#include "nsContentUtils.h"
#include "nsCRT.h"
#include "nsIScriptSecurityManager.h"
#include "nsContentPolicyUtils.h"
-#include "nsITimelineService.h"
#include "nsIHttpChannel.h"
#include "nsIScriptError.h"
#include "nsMimeTypes.h"
#include "nsIAtom.h"
#include "nsCSSStyleSheet.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsICSSLoaderObserver.h"
#include "nsCSSParser.h"
@@ -811,21 +810,16 @@ SheetLoadData::OnStreamComplete(nsIUnich
if (NS_FAILED(result)) {
LOG_WARN((" Couldn't get principal"));
mLoader->SheetComplete(this, result);
return NS_OK;
}
mSheet->SetPrincipal(principal);
-#ifdef MOZ_TIMELINE
- NS_TIMELINE_OUTDENT();
- NS_TIMELINE_MARK_CHANNEL("SheetLoadData::OnStreamComplete(%s)", channel);
-#endif // MOZ_TIMELINE
-
// If it's an HTTP channel, we want to make sure this is not an
// error document we got.
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
PRBool requestSucceeded;
result = httpChannel->GetRequestSucceeded(&requestSucceeded);
if (NS_SUCCEEDED(result) && !requestSucceeded) {
LOG((" Load returned an error page"));
@@ -1436,21 +1430,16 @@ Loader::LoadSheet(SheetLoadData* aLoadDa
NS_ENSURE_SUCCESS(rv, rv);
if (csp) {
channelPolicy = do_CreateInstance("@mozilla.org/nschannelpolicy;1");
channelPolicy->SetContentSecurityPolicy(csp);
channelPolicy->SetLoadType(nsIContentPolicy::TYPE_STYLESHEET);
}
}
-#ifdef MOZ_TIMELINE
- NS_TIMELINE_MARK_URI("Loading style sheet: %s", aLoadData->mURI);
- NS_TIMELINE_INDENT();
-#endif
-
nsCOMPtr<nsIChannel> channel;
rv = NS_NewChannel(getter_AddRefs(channel),
aLoadData->mURI, nsnull, loadGroup, nsnull,
nsIChannel::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI,
channelPolicy);
if (NS_FAILED(rv)) {
#ifdef DEBUG
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -85,17 +85,16 @@
#include "nsIURL.h"
#include "nsNetUtil.h"
#include "nsBoxLayoutState.h"
#include "nsIDragService.h"
#include "nsTreeContentView.h"
#include "nsTreeUtils.h"
#include "nsChildIterator.h"
#include "nsITheme.h"
-#include "nsITimelineService.h"
#include "imgIRequest.h"
#include "imgIContainer.h"
#include "imgIContainerObserver.h"
#include "imgILoader.h"
#include "nsINodeInfo.h"
#include "nsContentUtils.h"
#include "nsLayoutUtils.h"
#include "nsIScrollableFrame.h"
@@ -3611,39 +3610,32 @@ nsTreeBodyFrame::PaintText(PRInt32
aRenderingContext.FillRect(textRect.x, textRect.y, textRect.width, size);
if (decorations & NS_FONT_DECORATION_UNDERLINE)
aRenderingContext.FillRect(textRect.x, textRect.y + baseline - offset, textRect.width, size);
}
if (decorations & NS_FONT_DECORATION_LINE_THROUGH) {
fontMet->GetStrikeout(offset, size);
aRenderingContext.FillRect(textRect.x, textRect.y + baseline - offset, textRect.width, size);
}
-#ifdef MOZ_TIMELINE
- NS_TIMELINE_START_TIMER("Render Outline Text");
-#endif
PRUint8 direction = aTextRTL ? NS_STYLE_DIRECTION_RTL :
NS_STYLE_DIRECTION_LTR;
gfxContext* ctx = aRenderingContext.ThebesContext();
if (opacity != 1.0f) {
ctx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
}
nsLayoutUtils::DrawString(this, &aRenderingContext, text.get(), text.Length(),
textRect.TopLeft() + nsPoint(0, baseline), direction);
if (opacity != 1.0f) {
ctx->PopGroupToSource();
ctx->Paint(opacity);
}
-#ifdef MOZ_TIMELINE
- NS_TIMELINE_STOP_TIMER("Render Outline Text");
- NS_TIMELINE_MARK_TIMER("Render Outline Text");
-#endif
}
void
nsTreeBodyFrame::PaintCheckbox(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsPresContext* aPresContext,
nsRenderingContext& aRenderingContext,
--- a/modules/libpref/src/Preferences.cpp
+++ b/modules/libpref/src/Preferences.cpp
@@ -63,18 +63,16 @@
#include "prmem.h"
#include "pldhash.h"
#include "prefapi.h"
#include "prefread.h"
#include "prefapi_private_data.h"
#include "PrefTuple.h"
-#include "nsITimelineService.h"
-
#include "mozilla/Omnijar.h"
#include "nsZipArchive.h"
#include "nsTArray.h"
#include "nsRefPtrHashtable.h"
namespace mozilla {
@@ -806,24 +804,16 @@ Preferences::WritePrefFile(nsIFile* aFil
gDirty = PR_FALSE;
return NS_OK;
}
static nsresult openPrefFile(nsIFile* aFile)
{
nsCOMPtr<nsIInputStream> inStr;
-#if MOZ_TIMELINE
- {
- nsCAutoString str;
- aFile->GetNativePath(str);
- NS_TIMELINE_MARK_FUNCTION1("load pref file", str.get());
- }
-#endif
-
nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), aFile);
if (NS_FAILED(rv))
return rv;
PRUint32 fileSize;
rv = inStr->Available(&fileSize);
if (NS_FAILED(rv))
return rv;
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -56,17 +56,16 @@
#include "nsIPrefService.h"
#include "nsIPrefBranch2.h"
#include "nsIPrefLocalizedString.h"
#include "nsICategoryManager.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIProxiedProtocolHandler.h"
#include "nsIProxyInfo.h"
-#include "nsITimelineService.h"
#include "nsEscape.h"
#include "nsNetCID.h"
#include "nsIRecyclingAllocator.h"
#include "nsISocketTransport.h"
#include "nsCRT.h"
#include "nsSimpleNestedURI.h"
#include "nsNetUtil.h"
#include "nsThreadUtils.h"
@@ -600,17 +599,16 @@ nsIOService::NewChannelFromURI(nsIURI *a
NS_IMETHODIMP
nsIOService::NewChannelFromURIWithProxyFlags(nsIURI *aURI,
nsIURI *aProxyURI,
PRUint32 proxyFlags,
nsIChannel **result)
{
nsresult rv;
NS_ENSURE_ARG_POINTER(aURI);
- NS_TIMELINE_MARK_URI("nsIOService::NewChannelFromURI(%s)", aURI);
nsCAutoString scheme;
rv = aURI->GetScheme(scheme);
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIProtocolHandler> handler;
rv = GetProtocolHandler(scheme.get(), getter_AddRefs(handler));
--- a/rdf/base/src/nsRDFXMLDataSource.cpp
+++ b/rdf/base/src/nsRDFXMLDataSource.cpp
@@ -888,18 +888,16 @@ NS_IMETHODIMP
RDFXMLDataSourceImpl::SetReadOnly(PRBool aIsReadOnly)
{
if (mIsWritable && aIsReadOnly)
mIsWritable = PR_FALSE;
return NS_OK;
}
-#include "nsITimelineService.h"
-
// nsIChannelEventSink
// This code is copied from nsSameOriginChecker::OnChannelRedirect. See
// bug 475940 on providing this code in a shared location.
NS_IMETHODIMP
RDFXMLDataSourceImpl::AsyncOnChannelRedirect(nsIChannel *aOldChannel,
nsIChannel *aNewChannel,
PRUint32 aFlags,
@@ -966,20 +964,17 @@ RDFXMLDataSourceImpl::Refresh(PRBool aBl
nsCOMPtr<nsIRDFXMLParser> parser = do_CreateInstance("@mozilla.org/rdf/xml-parser;1");
if (! parser)
return NS_ERROR_FAILURE;
nsresult rv = parser->ParseAsync(this, mURL, getter_AddRefs(mListener));
if (NS_FAILED(rv)) return rv;
if (aBlocking) {
- NS_TIMELINE_START_TIMER("rdf blocking parse");
rv = BlockingParse(mURL, this);
- NS_TIMELINE_STOP_TIMER("rdf blocking parse");
- NS_TIMELINE_MARK_TIMER("rdf blocking parse");
mListener = nsnull; // release the parser
if (NS_FAILED(rv)) return rv;
}
else {
// Null LoadGroup ?
rv = NS_OpenURI(this, nsnull, mURL, nsnull, nsnull, this);
--- a/rdf/base/src/nsRDFXMLSerializer.cpp
+++ b/rdf/base/src/nsRDFXMLSerializer.cpp
@@ -49,18 +49,16 @@
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsTArray.h"
#include "rdf.h"
#include "rdfutil.h"
#include "rdfIDataSource.h"
-#include "nsITimelineService.h"
-
PRInt32 nsRDFXMLSerializer::gRefCnt = 0;
nsIRDFContainerUtils* nsRDFXMLSerializer::gRDFC;
nsIRDFResource* nsRDFXMLSerializer::kRDF_instanceOf;
nsIRDFResource* nsRDFXMLSerializer::kRDF_type;
nsIRDFResource* nsRDFXMLSerializer::kRDF_nextVal;
nsIRDFResource* nsRDFXMLSerializer::kRDF_Bag;
nsIRDFResource* nsRDFXMLSerializer::kRDF_Seq;
nsIRDFResource* nsRDFXMLSerializer::kRDF_Alt;
@@ -1099,17 +1097,16 @@ nsRDFXMLSerializer::CollectNamespaces()
}
//----------------------------------------------------------------------
NS_IMETHODIMP
nsRDFXMLSerializer::Serialize(nsIOutputStream* aStream)
{
nsresult rv;
- NS_TIMELINE_START_TIMER("rdf/xml-ser");
rv = CollectNamespaces();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISimpleEnumerator> resources;
rv = mDataSource->GetAllResources(getter_AddRefs(resources));
if (NS_FAILED(rv)) return rv;
@@ -1139,18 +1136,16 @@ nsRDFXMLSerializer::Serialize(nsIOutputS
rv = SerializeDescription(aStream, resource);
}
if (NS_FAILED(rv))
break;
}
rv = SerializeEpilogue(aStream);
- NS_TIMELINE_STOP_TIMER("rdf/xml-ser");
- NS_TIMELINE_MARK("rdf/xml-ser");
return rv;
}
PRBool
nsRDFXMLSerializer::IsA(nsIRDFDataSource* aDataSource, nsIRDFResource* aResource, nsIRDFResource* aType)
{
--- a/toolkit/components/intl/nsCharsetMenu.cpp
+++ b/toolkit/components/intl/nsCharsetMenu.cpp
@@ -56,17 +56,16 @@
#include "nsIPrefLocalizedString.h"
#include "nsICurrentCharsetListener.h"
#include "nsQuickSort.h"
#include "nsIObserver.h"
#include "nsStringEnumerator.h"
#include "nsTArray.h"
#include "nsIObserverService.h"
#include "nsIRequestObserver.h"
-#include "nsITimelineService.h"
#include "nsCRT.h"
#include "prmem.h"
#include "mozilla/ModuleUtils.h"
#include "nsCycleCollectionParticipant.h"
//----------------------------------------------------------------------------
// Global functions and data [declaration]
@@ -414,17 +413,16 @@ public:
private:
nsCharsetMenu* mCharsetMenu;
};
NS_IMPL_ISUPPORTS1(nsCharsetMenuObserver, nsIObserver)
NS_IMETHODIMP nsCharsetMenuObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu:Observe");
nsresult rv = NS_OK;
//XUL event handler
if (!nsCRT::strcmp(aTopic, "charsetmenu-selected")) {
nsDependentString nodeName(someData);
rv = mCharsetMenu->Init();
if (nodeName.EqualsLiteral("browser")) {
rv = mCharsetMenu->InitBrowserMenu();
@@ -461,18 +459,16 @@ NS_IMETHODIMP nsCharsetMenuObserver::Obs
NS_ENSURE_SUCCESS(rv, rv);
rv = mCharsetMenu->RefreshComposerMenu();
}
else if (prefName.EqualsLiteral(kMaileditPrefKey)) {
rv = mCharsetMenu->RefreshMaileditMenu();
}
}
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu:Observe");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu:Observe");
return rv;
}
//----------------------------------------------------------------------------
// Class nsCharsetMenu [implementation]
NS_IMPL_CYCLE_COLLECTION_CLASS(nsCharsetMenu)
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsCharsetMenu)
@@ -514,17 +510,16 @@ nsCharsetMenu::nsCharsetMenu()
mBrowserMenuInitialized(PR_FALSE),
mMailviewMenuInitialized(PR_FALSE),
mComposerMenuInitialized(PR_FALSE),
mMaileditMenuInitialized(PR_FALSE),
mSecondaryTiersInitialized(PR_FALSE),
mAutoDetectInitialized(PR_FALSE),
mOthersInitialized(PR_FALSE)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::nsCharsetMenu");
nsresult res = NS_OK;
//get charset manager
mCCManager = do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &res);
//initialize skeleton RDF source
mRDFService = do_GetService(kRDFServiceCID, &res);
@@ -551,18 +546,16 @@ nsCharsetMenu::nsCharsetMenu()
if (NS_SUCCEEDED(res))
res = observerService->AddObserver(mCharsetMenuObserver,
"charsetmenu-selected",
PR_FALSE);
}
NS_ASSERTION(NS_SUCCEEDED(res), "Failed to initialize nsCharsetMenu");
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::nsCharsetMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::nsCharsetMenu");
}
nsCharsetMenu::~nsCharsetMenu()
{
Done();
FreeMenuItemArray(&mBrowserMenu);
FreeMenuItemArray(&mMailviewMenu);
@@ -880,18 +873,16 @@ nsresult nsCharsetMenu::FreeResources()
mCCManager = NULL;
mPrefs = NULL;
return res;
}
nsresult nsCharsetMenu::InitBrowserMenu()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitBrowserMenu");
-
nsresult res = NS_OK;
if (!mBrowserMenuInitialized) {
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, kNC_BrowserCharsetMenuRoot, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
@@ -924,26 +915,21 @@ nsresult nsCharsetMenu::InitBrowserMenu(
// register prefs callback
nsCOMPtr<nsIPrefBranch2> pbi = do_QueryInterface(mPrefs);
if (pbi)
res = pbi->AddObserver(kBrowserStaticPrefKey, mCharsetMenuObserver, PR_FALSE);
}
mBrowserMenuInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitBrowserMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitBrowserMenu");
-
return res;
}
nsresult nsCharsetMenu::InitMaileditMenu()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMaileditMenu");
-
nsresult res = NS_OK;
if (!mMaileditMenuInitialized) {
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, kNC_MaileditCharsetMenuRoot, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
//enumerate encoders
@@ -964,26 +950,21 @@ nsresult nsCharsetMenu::InitMaileditMenu
// register prefs callback
nsCOMPtr<nsIPrefBranch2> pbi = do_QueryInterface(mPrefs);
if (pbi)
res = pbi->AddObserver(kMaileditPrefKey, mCharsetMenuObserver, PR_FALSE);
}
mMaileditMenuInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMaileditMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMaileditMenu");
-
return res;
}
nsresult nsCharsetMenu::InitMailviewMenu()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMailviewMenu");
-
nsresult res = NS_OK;
if (!mMailviewMenuInitialized) {
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, kNC_MailviewCharsetMenuRoot, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
nsTArray<nsCString> mailviewDecoderList = mDecoderList;
@@ -1005,26 +986,21 @@ nsresult nsCharsetMenu::InitMailviewMenu
res = InitCacheMenu(mailviewDecoderList, kNC_MailviewCharsetMenuRoot,
kMailviewCachePrefKey, &mMailviewMenu);
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing mailview cache charset menu");
}
mMailviewMenuInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMailviewMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMailviewMenu");
-
return res;
}
nsresult nsCharsetMenu::InitComposerMenu()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitComposerMenu");
-
nsresult res = NS_OK;
if (!mComposerMenuInitialized) {
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, kNC_ComposerCharsetMenuRoot, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
nsTArray<nsCString> composerDecoderList = mDecoderList;
@@ -1047,26 +1023,21 @@ nsresult nsCharsetMenu::InitComposerMenu
res = InitCacheMenu(composerDecoderList, kNC_ComposerCharsetMenuRoot,
kComposerCachePrefKey, &mComposerMenu);
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing composer cache charset menu");
}
mComposerMenuInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitComposerMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitComposerMenu");
-
return res;
}
nsresult nsCharsetMenu::InitOthers()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitOthers");
-
nsresult res = NS_OK;
if (!mOthersInitialized) {
nsTArray<nsCString> othersDecoderList = mDecoderList;
res = InitMoreMenu(othersDecoderList, kNC_DecodersRoot, ".notForBrowser");
if (NS_FAILED(res)) return res;
@@ -1076,104 +1047,84 @@ nsresult nsCharsetMenu::InitOthers()
nsTArray<nsCString> othersEncoderList = mDecoderList;
res = InitMoreMenu(othersEncoderList, kNC_EncodersRoot, ".notForOutgoing");
if (NS_FAILED(res)) return res;
}
mOthersInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitOthers");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitOthers");
-
return res;
}
/**
* Inits the secondary tiers of the charset menu. Because currently all the CS
* menus are sharing the secondary tiers, one should call this method only
* once for all of them.
*/
nsresult nsCharsetMenu::InitSecondaryTiers()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitSecondaryTiers");
-
nsresult res = NS_OK;
if (!mSecondaryTiersInitialized) {
nsTArray<nsCString> secondaryTiersDecoderList = mDecoderList;
res = InitMoreSubmenus(secondaryTiersDecoderList);
NS_ASSERTION(NS_SUCCEEDED(res), "err init browser charset more submenus");
res = InitMoreMenu(secondaryTiersDecoderList, kNC_BrowserMoreCharsetMenuRoot, ".notForBrowser");
NS_ASSERTION(NS_SUCCEEDED(res), "err init browser charset more menu");
}
mSecondaryTiersInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitSecondaryTiers");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitSecondaryTiers");
-
return res;
}
nsresult nsCharsetMenu::InitStaticMenu(nsTArray<nsCString>& aDecs,
nsIRDFResource * aResource,
const char * aKey,
nsTArray<nsMenuEntry*> * aArray)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitStaticMenu");
-
nsresult res = NS_OK;
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, aResource, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
// XXX work around bug that causes the submenus to be first instead of last
res = AddSeparatorToContainer(container);
NS_ASSERTION(NS_SUCCEEDED(res), "error adding separator to container");
res = AddFromPrefsToMenu(aArray, container, aKey, aDecs, "charset.");
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing static charset menu from prefs");
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitStaticMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitStaticMenu");
-
return res;
}
nsresult nsCharsetMenu::InitCacheMenu(
nsTArray<nsCString>& aDecs,
nsIRDFResource * aResource,
const char * aKey,
nsTArray<nsMenuEntry*> * aArray)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitCacheMenu");
-
nsresult res = NS_OK;
nsCOMPtr<nsIRDFContainer> container;
res = NewRDFContainer(mInner, aResource, getter_AddRefs(container));
if (NS_FAILED(res)) return res;
res = AddFromNolocPrefsToMenu(aArray, container, aKey, aDecs, "charset.");
NS_ASSERTION(NS_SUCCEEDED(res), "error initializing cache charset menu from prefs");
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitCacheMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitCacheMenu");
-
return res;
}
nsresult nsCharsetMenu::InitAutodetMenu()
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitAutodetMenu");
-
nsresult res = NS_OK;
if (!mAutoDetectInitialized) {
nsTArray<nsMenuEntry*> chardetArray;
nsCOMPtr<nsIRDFContainer> container;
nsTArray<nsCString> detectorArray;
res = NewRDFContainer(mInner, kNC_BrowserAutodetMenuRoot, getter_AddRefs(container));
@@ -1199,28 +1150,23 @@ nsresult nsCharsetMenu::InitAutodetMenu(
done:
// free the elements in the nsTArray<nsMenuEntry*>
FreeMenuItemArray(&chardetArray);
}
mAutoDetectInitialized = NS_SUCCEEDED(res);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitAutodetMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitAutodetMenu");
-
return res;
}
nsresult nsCharsetMenu::InitMoreMenu(nsTArray<nsCString>& aDecs,
nsIRDFResource * aResource,
const char * aFlag)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMoreMenu");
-
nsresult res = NS_OK;
nsCOMPtr<nsIRDFContainer> container;
nsTArray<nsMenuEntry*> moreMenu;
res = NewRDFContainer(mInner, aResource, getter_AddRefs(container));
if (NS_FAILED(res)) goto done;
// remove charsets "not for browser"
@@ -1236,27 +1182,22 @@ nsresult nsCharsetMenu::InitMoreMenu(nsT
res = AddMenuItemArrayToContainer(container, &moreMenu, NULL);
if (NS_FAILED(res)) goto done;
done:
// free the elements in the VoidArray
FreeMenuItemArray(&moreMenu);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMoreMenu");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMoreMenu");
-
return res;
}
// XXX please make this method more general; the cut&pasted code is laughable
nsresult nsCharsetMenu::InitMoreSubmenus(nsTArray<nsCString>& aDecs)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu::InitMoreSubmenus");
-
nsresult res = NS_OK;
nsCOMPtr<nsIRDFContainer> container1;
nsCOMPtr<nsIRDFContainer> container2;
nsCOMPtr<nsIRDFContainer> container3;
nsCOMPtr<nsIRDFContainer> container4;
nsCOMPtr<nsIRDFContainer> container5;
nsCOMPtr<nsIRDFContainer> containerU;
@@ -1292,19 +1233,16 @@ nsresult nsCharsetMenu::InitMoreSubmenus
if (NS_FAILED(res)) return res;
AddFromNolocPrefsToMenu(NULL, container5, key5, aDecs, NULL);
res = NewRDFContainer(mInner, kNC_BrowserUnicodeCharsetMenuRoot,
getter_AddRefs(containerU));
if (NS_FAILED(res)) return res;
AddFromNolocPrefsToMenu(NULL, containerU, keyU, aDecs, NULL);
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu::InitMoreSubmenus");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu::InitMoreSubmenus");
-
return res;
}
nsresult nsCharsetMenu::AddCharsetToItemArray(nsTArray<nsMenuEntry*> *aArray,
const nsAFlatCString& aCharset,
nsMenuEntry ** aResult,
PRInt32 aPlace)
{
@@ -1833,91 +1771,81 @@ nsresult nsCharsetMenu::GetCollation(nsI
return res;
}
//----------------------------------------------------------------------------
// Interface nsICurrentCharsetListener [implementation]
NS_IMETHODIMP nsCharsetMenu::SetCurrentCharset(const PRUnichar * aCharset)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentCharset");
nsresult res = NS_OK;
if (mBrowserMenuInitialized) {
// Don't add item to the cache if it's marked "notForBrowser"
nsAutoString str;
res = mCCManager->GetCharsetData(NS_LossyConvertUTF16toASCII(aCharset).get(),
NS_LITERAL_STRING(".notForBrowser").get(), str);
if (NS_SUCCEEDED(res)) // succeeded means attribute exists
return res; // don't throw
res = AddCharsetToCache(NS_LossyConvertUTF16toASCII(aCharset),
&mBrowserMenu, kNC_BrowserCharsetMenuRoot,
mBrowserCacheStart, mBrowserCacheSize,
mBrowserMenuRDFPosition);
if (NS_FAILED(res)) {
- NS_TIMELINE_LEAVE("nsCharsetMenu:SetCurrentCharset");
return res;
}
res = WriteCacheToPrefs(&mBrowserMenu, mBrowserCacheStart,
kBrowserCachePrefKey);
} else {
res = UpdateCachePrefs(kBrowserCachePrefKey, kBrowserCacheSizePrefKey,
kBrowserStaticPrefKey, aCharset);
}
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentCharset");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentCharset");
return res;
}
NS_IMETHODIMP nsCharsetMenu::SetCurrentMailCharset(const PRUnichar * aCharset)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentMailCharset");
nsresult res = NS_OK;
if (mMailviewMenuInitialized) {
res = AddCharsetToCache(NS_LossyConvertUTF16toASCII(aCharset),
&mMailviewMenu, kNC_MailviewCharsetMenuRoot,
mMailviewCacheStart, mMailviewCacheSize,
mMailviewMenuRDFPosition);
if (NS_FAILED(res)) return res;
res = WriteCacheToPrefs(&mMailviewMenu, mMailviewCacheStart,
kMailviewCachePrefKey);
} else {
res = UpdateCachePrefs(kMailviewCachePrefKey, kMailviewCacheSizePrefKey,
kMailviewStaticPrefKey, aCharset);
}
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentMailCharset");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentMailCharset");
return res;
}
NS_IMETHODIMP nsCharsetMenu::SetCurrentComposerCharset(const PRUnichar * aCharset)
{
- NS_TIMELINE_START_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
nsresult res = NS_OK;
if (mComposerMenuInitialized) {
res = AddCharsetToCache(NS_LossyConvertUTF16toASCII(aCharset),
&mComposerMenu, kNC_ComposerCharsetMenuRoot,
mComposerCacheStart, mComposerCacheSize,
mComposerMenuRDFPosition);
if (NS_FAILED(res)) return res;
res = WriteCacheToPrefs(&mComposerMenu, mComposerCacheStart,
kComposerCachePrefKey);
} else {
res = UpdateCachePrefs(kComposerCachePrefKey, kComposerCacheSizePrefKey,
kComposerStaticPrefKey, aCharset);
}
- NS_TIMELINE_STOP_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
- NS_TIMELINE_MARK_TIMER("nsCharsetMenu:SetCurrentComposerCharset");
return res;
}
//----------------------------------------------------------------------------
// Interface nsIRDFDataSource [implementation]
NS_IMETHODIMP nsCharsetMenu::GetURI(char ** uri)
{
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -50,17 +50,16 @@
#include "nsILocalFile.h"
#include "nsIObserverService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsIProfileChangeStatus.h"
#include "nsIPromptService.h"
#include "nsIStringBundle.h"
#include "nsISupportsPrimitives.h"
-#include "nsITimelineService.h"
#include "nsIWebBrowserChrome.h"
#include "nsIWindowMediator.h"
#include "nsIWindowWatcher.h"
#include "nsIXULWindow.h"
#include "nsNativeCharsetUtils.h"
#include "nsThreadUtils.h"
#include "nsAutoPtr.h"
#include "nsStringGlue.h"
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -100,17 +100,16 @@
#include "nsIObserverService.h"
#include "nsINativeAppSupport.h"
#include "nsIProcess.h"
#include "nsIProfileUnlocker.h"
#include "nsIPromptService.h"
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "nsISupportsPrimitives.h"
-#include "nsITimelineService.h"
#include "nsIToolkitChromeRegistry.h"
#include "nsIToolkitProfile.h"
#include "nsIToolkitProfileService.h"
#include "nsIURI.h"
#include "nsIWindowCreator.h"
#include "nsIWindowMediator.h"
#include "nsIWindowWatcher.h"
#include "nsIXULAppInfo.h"
@@ -2617,17 +2616,16 @@ XRE_main(int argc, char* argv[], const n
gXRE_mainTimestamp = PR_Now();
#ifdef MOZ_SPLASHSCREEN
nsSplashScreen *splashScreen = nsnull;
#endif
nsresult rv;
ArgResult ar;
- NS_TIMELINE_MARK("enter main");
#ifdef DEBUG
if (PR_GetEnv("XRE_MAIN_BREAK"))
NS_BREAK();
#endif
// see bug 639842
// it's very important to fire this process BEFORE we set up error handling.
@@ -3389,23 +3387,21 @@ XRE_main(int argc, char* argv[], const n
if (startOffline) {
nsCOMPtr<nsIIOService2> io (do_GetService("@mozilla.org/network/io-service;1"));
NS_ENSURE_TRUE(io, 1);
io->SetManageOfflineStatus(PR_FALSE);
io->SetOffline(PR_TRUE);
}
{
- NS_TIMELINE_ENTER("startupNotifier");
nsCOMPtr<nsIObserver> startupNotifier
(do_CreateInstance(NS_APPSTARTUPNOTIFIER_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, 1);
startupNotifier->Observe(nsnull, APPSTARTUP_TOPIC, nsnull);
- NS_TIMELINE_LEAVE("startupNotifier");
}
NS_TIME_FUNCTION_MARK("Finished startupNotifier");
nsCOMPtr<nsIAppStartup> appStartup
(do_GetService(NS_APPSTARTUP_CONTRACTID));
NS_ENSURE_TRUE(appStartup, 1);
@@ -3487,19 +3483,17 @@ XRE_main(int argc, char* argv[], const n
SaveToEnv("XUL_APP_FILE=");
SaveToEnv("XRE_BINARY_PATH=");
NS_TIME_FUNCTION_MARK("env munging");
if (!shuttingDown) {
NS_TIME_FUNCTION_MARK("Next: CreateHiddenWindow");
- NS_TIMELINE_ENTER("appStartup->CreateHiddenWindow");
rv = appStartup->CreateHiddenWindow();
- NS_TIMELINE_LEAVE("appStartup->CreateHiddenWindow");
NS_ENSURE_SUCCESS(rv, 1);
MOZ_SPLASHSCREEN_UPDATE(50);
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK2)
nsRefPtr<nsGTKToolkit> toolkit = GetGTKToolkit();
if (toolkit && !desktopStartupID.IsEmpty()) {
toolkit->SetDesktopStartupID(desktopStartupID);
@@ -3569,19 +3563,17 @@ XRE_main(int argc, char* argv[], const n
#endif /* MOZ_INSTRUMENT_EVENT_LOOP */
NS_TIME_FUNCTION_MARK("Next: Run");
NS_TIME_FUNCTION_MARK("appStartup->Run");
MOZ_SPLASHSCREEN_UPDATE(90);
{
- NS_TIMELINE_ENTER("appStartup->Run");
rv = appStartup->Run();
- NS_TIMELINE_LEAVE("appStartup->Run");
if (NS_FAILED(rv)) {
NS_ERROR("failed to run appstartup");
gLogConsoleErrors = PR_TRUE;
}
}
NS_TIME_FUNCTION_MARK("Next: Finish");
@@ -3600,21 +3592,16 @@ XRE_main(int argc, char* argv[], const n
if (!shuttingDown) {
#ifdef MOZ_ENABLE_XREMOTE
// shut down the x remote proxy window
if (remoteService)
remoteService->Shutdown();
#endif /* MOZ_ENABLE_XREMOTE */
}
-#ifdef MOZ_TIMELINE
- // Make sure we print this out even if timeline is runtime disabled
- if (NS_FAILED(NS_TIMELINE_LEAVE("main1")))
- NS_TimelineForceMark("...main1");
-#endif
}
}
// unlock the profile after ScopedXPCOMStartup object (xpcom)
// has gone out of scope. see bug #386739 for more details
profileLock->Unlock();
// Restart the app after XPCOM has been shut down cleanly.
deleted file mode 100644
--- a/tools/performance/startup/analyze-timeline-log.pl
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-# perl file to get a list of files that we load from a timeline log
-#
-# Usage: perl getlines.pl < timline.log > file.log
-
-# Configuration options
-#
-# Set this option to take all timings only upto the main window being visible
-# All activity beyond main window being visible is ignored.
-# default is 0. We take timings upto main1 finish
-$stopWithVisibleWindow = 0;
-
-# dlls loaded
-my @dlls = ();
-# Files of a particular extensions
-my %ext = ();
-# Number of files in a paticular extension. Used to sort them output by order of extension
-my %extnum = ();
-# List of all urls that either exist or are jar. Non dups.
-my @allurls = ();
-# List of nonexistent file urls
-my @nonexistentfiles = ();
-# Number of file urls
-my $nfileurl = 0;
-# Number of jar urls
-my $njarurl = 0;
-# Urls hash to figure out dups
-my %seen = ();
-# Number of dups per extension
-my %extnumdups = ();
-# interesting total times
-my %breakdown = ();
-# main1 cost
-my $main1 = 0;
-# when main window was visible
-my $window = 0;
-# pref files loaded
-my @prefurl = ();
-while (<>)
-{
- chomp;
-
- # Computer breakdown of startup cost
- if (/total:/) {
- # This is a cumulative timer. Keep track of it.
- /^[0-9\.: ]*(.*) total: ([0-9\.]*)/;
- $breakdown{$1} = $2;
- }
- if (/InitXPCom\.\.\./) {
- $breakdown{"Before InitXPCom"} = getTimelineStamp($_);
- next;
- }
- if (/InitXPCOM done/) {
- $breakdown{"InitXPCom"} = getTimelineStamp($_) - $breakdown{"Before InitXPCom"};
- next;
- }
-
- # Find main1's cost to compute percentages
- if (/\.\.\.main1/) {
- $main1 = getTimelineStamp($_);
- }
- # find when we showed the window
- if (/Navigator Window visible now/) {
- $window = getTimelineStamp($_);
- if ($stopWithVisibleWindow) {
- $main1 = $window;
- last;
- }
- }
-
- # Find all files loaded
- if (/PR_LoadLibrary/) {
- my $dll = getdll($_);
- push @dlls, $dll;
- next;
- }
- if (/file:/) {
- $url = getfileurl($_);
- $e = getext($url);
- if (!-f $url) {
- push @nonexistentfiles, $url;
- } else {
- $seen{$url}++;
- if ($seen{$url} > 1) {
- $extnumdups{$e}++;
- next;
- }
- push @allurls, $url;
- if (exists $ext{$e}) {
- $ext{$e} .= "---";
- }
- $ext{$e} .= $url;
- $extnum{$e}++;
- $nfileurl++;
- }
- next;
- }
- if (/jar:/) {
- $url = getjarurl($_);
- $e = getext($url);
- $seen{$url}++;
- if ($seen{$url} > 1) {
- $extnumdups{$e}++;
- next;
- }
- push @allurls, $url;
- if (exists $ext{$e}) {
- $ext{$e} .= "---";
- }
- $ext{$e} .= "$url";
- $extnum{$e}++;
- $njarurl++;
- next;
- }
- if (/load pref file/) {
- $url = getfile($_);
- push @prefurl, $url;
- }
-}
-
-# print results
-print "SUMMARY\n";
-print "----------------------------------------------------------------------\n";
-print "Total startup time : $main1 sec\n";
-printf "Main window visible: $window sec (%5.2f%%)\n", main1Percent($window);
-print "dlls loaded : ", $#dlls+1, "\n";
-print "Total unique: ", $#allurls+1, " [jar $njarurl, file $nfileurl]\n";
-# print the # of files by extensions sorted
-my @extsorted = sort { $extnum{$b} <=> $extnum{$a} } keys %extnum;
-my $sep = " ";
-foreach $i (@extsorted)
-{
- print "$sep.$i $extnum{$i}";
- $sep = ", ";
-}
-print "\n";
-# print number of dups per extension
-my $sep = " dups: ";
-foreach $i (@extsorted)
-{
- next unless exists($extnumdups{$i});
- print "$sep.$i $extnumdups{$i}";
- $sep = ", ";
-}
-print "\n";
-print "Total non existent files : ", $#nonexistentfiles+1, "\n";
-
-print "\n";
-print "Cost Breakdown\n";
-print "----------------------------------------------------------------------\n";
-# sort by descending order of breakdown cost
-my @breakdownsorted = sort { $breakdown{$b} <=> $breakdown{$a} } keys %breakdown;
-my $totalAccounted = 0;
-foreach $e (@breakdownsorted)
-{
- # ignore these breakdowns as they are already counted otherwise
- next if ($e =~ /nsNativeComponentLoader::GetFactory/);
- my $p = main1Percent($breakdown{$e});
- #next if ($p == 0);
- printf "%6.2f%% %s\n", $p, $e;
- $totalAccounted += $p;
-}
-print "----------------------\n";
-printf "%6.2f%% Total Accounted\n", $totalAccounted;
-
-print "\n";
-printf "[%d] List of dlls loaded:\n", $#dlls+1;
-print "----------------------------------------------------------------------\n";
-my $n = 1;
-foreach $e (@dlls)
-{
- printf "%2d. %s\n", $n++, $e;
-}
-
-print "\n";
-printf "[%d] List of existing unique files and jar urls by extension:\n", $#allurls+1;
-print "----------------------------------------------------------------------\n";
-foreach $e (@extsorted)
-{
- $n = 1;
- print "[$extnum{$e}] .$e\n";
- foreach $i (split("---", $ext{$e})) {
- printf "%2d. %s", $n++, $i;
- if ($seen{$i} > 1) {
- printf " [%d]", $seen{$i}-1;
- }
- printf "\n";
- }
- print "\n";
-}
-#foreach $i (@allurls)
-#{
-# printf "%2d. %s\n", $n++, $i;
-#}
-
-print "\n";
-printf "[%d] List of non existent file urls:\n", $#nonexistentfiles+1;
-print "----------------------------------------------------------------------\n";
-my $n = 1;
-foreach $i (@nonexistentfiles)
-{
- printf "%2d. %s\n", $n++, $i;
-}
-
-# print prefs loaded
-print "\n";
-printf "[%d] List of pref files loaded:\n", $#prefurl+1;
-print "----------------------------------------------------------------------\n";
-$n = 1;
-foreach $i (@prefurl)
-{
- printf "%2d. %s\n", $n++, $i;
-}
-
-# Subrouties
-sub getTimelineStamp() {
- my $line = shift;
- $line =~ /^([0-9\.]*)/;
- return $1+0;
-}
-
-sub getfileurl() {
- my $f = shift;
- $f =~ s/^.*file:\/*(.*)\).*$/\1/;
- # unescape the url
- $f =~ s/\|/:/;
- $f =~ s/\%20/ /g;
- return $f;
-}
-
-sub getjarurl() {
- my $f = shift;
- $f =~ s/^.*(jar:.*)\).*$/\1/;
- return $f;
-}
-
-sub getdll() {
- my $f = shift;
- $f =~ s/^.*\((.*)\).*$/\1/;
- return $f;
-}
-
-sub getext() {
- my $f = shift;
- $f =~ s/^.*\.([^\.]*)$/\1/;
- return $f;
-}
-
-sub getfile() {
- my $f = shift;
- $f =~ s/^.*\((.*)\)$/\1/;
- return $f;
-}
-
-# what % is this of startup
-sub main1Percent() {
- my $i = shift;
- return $i/$main1 * 100;
-}
deleted file mode 100644
--- a/tools/performance/startup/measure-simple.pl
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/perl
-
-#
-# Script to time mozilla startup
-#
-# Requirements:
-# - a Profile with name "Default User"
-# - a MOZ_TIMELINE build
-#
-# This starts mozilla with the profile "Default User" and makes it quit immediately.
-# Measurement is of main1 from MOZ_TIMELINE output
-#
-# This does multiple runs [default 3] and averages all but the first run.
-#
-# startup-quick.pl <exe> [n times]
-# n - default 3
-#
-
-require 5.003;
-
-use strict;
-use Cwd;
-
-sub PrintUsage {
- die <<END_USAGE
- usage: measure-simple.pl [n]
- n defaults to 3
- e.g
- measure-simple.pl ../../../dist/bin/mozilla
- measure-simple.pl ../../../dist/bin/mozilla 10
-END_USAGE
-}
-
-{
- PrintUsage() unless $#ARGV >= 0;
- my $exe = shift @ARGV;
- my $ntimes = shift @ARGV || 3;
- my $timelinelog = "timeline.log";
- # Do one more than what was requested as we ignore the first run timing
- $ntimes++;
-
- # Build up command string.
- my $cwd = Cwd::getcwd();
-
- # take care of cygwin adding /cygdrive/<driveletter>
- $cwd =~ s/\/cygdrive\/(.)/$1:/;
-
- my $cmd = "$exe -P \"Default User\" file:///$cwd/quit.html";
- print "cmd = $cmd\n";
- print "$ntimes times\n";
-
- # Setup run environment
- $ENV{"NS_TIMELINE_ENABLE"} = 1;
- $ENV{"NS_TIMELINE_LOG_FILE"} = $timelinelog;
- $ENV{"XPCOM_DEBUG_BREAK"} = "warn";
- unlink $timelinelog;
-
- my $i;
- my @runtimes = ();
- for($i = 0; $i < $ntimes; $i++) {
- # Run the command.
- system($cmd);
-
- # find the time taken from the TIMELINE LOG
- my $F;
- open(F, "< $timelinelog") || die "no timeline log ($timelinelog) found";
- while(<F>) {
- if (/^(.*): \.\.\.main1$/) {
- my $t = $1 + 0;
- push @runtimes, $t;
- print "[$i] startup time : $t sec\n";
- last;
- }
- }
- close(F);
- # Cleanup
- unlink $timelinelog;
- }
-
- # Compute final number. Skip first run and average the rest.
- my $sum = 0;
- shift @runtimes;
- foreach $i (@runtimes) {
- $sum += $i;
- }
- printf "Average startup time : %8.4f secs (%d trials - %s)\n", $sum/($ntimes-1), $ntimes-1, join(" ", @runtimes);
-}
-
deleted file mode 100644
--- a/tools/performance/startup/printlog.pl
+++ /dev/null
@@ -1,57 +0,0 @@
-# Post processor for timeline output
-# Does a diff betn consecutive timeline outputs looking for
-# big % differences
-
-my $percent = 1; # anything over 1% of total is of interest to us
-my $ignoreDllLoads = 0; # by default don't ignore dll timings
-
-# Read in log to memory
-my @lines = <>;
-
-my $total = 0;
-# Look for main1's timing
-foreach (@lines) {
- if (/^([0-9\.]*): \.\.\.main1/) {
- $total = $1 + 0;
- print "Found main1 time: $total\n";
- last;
- }
-}
-
-
-my $prev = 0;
-my $t = $total * $percent / 100;
-foreach (@lines) {
- /^([0-9\.]*):/;
- $cur = $1;
- printdiff($cur, $prev, $_);
- if (/total: ([0-9\.]*)/) {
- # print how much % this was
- printf "%4.2f%%", $1/$total*100;
- }
- print "\t$_";
- $prev = $cur;
-}
-
-
-sub printdiff() {
- my $cur = shift;
- my $prev = shift;
- my $line = shift;
- my $diff = $cur - $prev;
-
- # Make sure we have a considerable difference
- if ($diff < $t) {
- return 0;
- }
-
- # If we are ignoring dlls and this is a dll line, return
- if ($ignoreDllLoads && $line =~ /PR_LoadLibrary/) {
- return 0;
- }
-
- # if significant time elapsed print it
- printf "%4.2f%% %5.3f\n", $diff/$total*100, $diff;
-
- return 1;
-}
--- a/xpcom/build/XPCOM.h
+++ b/xpcom/build/XPCOM.h
@@ -101,17 +101,16 @@
#include "nsIStreamBufferAccess.h"
#include "nsIStringEnumerator.h"
#include "nsIStorageStream.h"
#include "nsISupportsArray.h"
#include "nsISupportsIterators.h"
#include "nsISupportsPrimitives.h"
#include "nsISupportsPriority.h"
#include "nsIThreadManager.h"
-#include "nsITimelineService.h"
#include "nsITimer.h"
#include "nsITraceRefcnt.h"
#include "nsIUUIDGenerator.h"
#include "nsIUnicharInputStream.h"
#include "nsIUnicharOutputStream.h"
#include "nsIUnicharLineInputStream.h"
#include "nsIVariant.h"
#include "nsIVersionComparator.h"
--- a/xpcom/build/XPCOMModule.inc
+++ b/xpcom/build/XPCOMModule.inc
@@ -17,19 +17,16 @@
COMPONENT(PERSISTENTPROPERTIES, nsPersistentProperties::Create)
COMPONENT(SUPPORTSARRAY, nsSupportsArray::Create)
COMPONENT(ARRAY, nsArrayConstructor)
COMPONENT(CONSOLESERVICE, nsConsoleServiceConstructor)
COMPONENT(EXCEPTIONSERVICE, nsExceptionServiceConstructor)
COMPONENT(ATOMSERVICE, nsAtomServiceConstructor)
-#ifdef MOZ_TIMELINE
- COMPONENT(TIMELINESERVICE, nsTimelineServiceConstructor)
-#endif
COMPONENT(OBSERVERSERVICE, nsObserverService::Create)
COMPONENT(XPCOMPROXY, nsProxyObjectManager::Create)
COMPONENT(TIMER, nsTimerImplConstructor)
#define COMPONENT_SUPPORTS(TYPE, Type) \
COMPONENT(SUPPORTS_##TYPE, nsSupports##Type##ImplConstructor)
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -105,17 +105,16 @@
#include "nsMultiplexInputStream.h"
#include "nsStringStream.h"
extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **);
#include "nsAtomService.h"
#include "nsAtomTable.h"
#include "nsTraceRefcnt.h"
-#include "nsTimelineService.h"
#include "nsHashPropertyBag.h"
#include "nsUnicharInputStream.h"
#include "nsVariant.h"
#include "nsUUIDGenerator.h"
@@ -205,20 +204,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinaryI
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStorageStream)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsVersionComparatorImpl)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableBase64Encoder)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsVariant)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRecyclingAllocatorImpl)
-#ifdef MOZ_TIMELINE
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimelineService)
-#endif
-
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHashPropertyBag, Init)
NS_GENERIC_AGGREGATED_CONSTRUCTOR_INIT(nsProperties, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUUIDGenerator, Init)
#ifdef XP_MACOSX
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacUtilsImpl)
--- a/xpcom/ds/Makefile.in
+++ b/xpcom/ds/Makefile.in
@@ -66,17 +66,16 @@ CPPSRCS = \
nsProperties.cpp \
nsPersistentProperties.cpp \
nsRecyclingAllocator.cpp \
nsStaticNameTable.cpp \
nsStringEnumerator.cpp \
nsSupportsArray.cpp \
nsSupportsArrayEnumerator.cpp \
nsSupportsPrimitives.cpp \
- nsTimelineService.cpp \
nsUnicharBuffer.cpp \
nsVariant.cpp \
$(NULL)
ifdef HAVE_CLOCK_MONOTONIC
CPPSRCS += TimeStamp_posix.cpp
else
CPPSRCS += TimeStamp.cpp
@@ -129,17 +128,16 @@ XPIDLSRCS = \
nsIWritablePropertyBag.idl \
nsIWritablePropertyBag2.idl \
nsIRecyclingAllocator.idl \
nsIVariant.idl \
nsISerializable.idl \
nsIStringEnumerator.idl \
nsISupportsArray.idl \
nsISupportsIterators.idl \
- nsITimelineService.idl \
$(NULL)
SDK_XPIDLSRCS = \
nsIArray.idl \
nsIHashable.idl \
nsIMutableArray.idl \
nsIObserverService.idl \
nsIObserver.idl \
deleted file mode 100644
--- a/xpcom/ds/nsITimelineService.idl
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsISupports.idl"
-
-%{C++
-#ifdef MOZ_TIMELINE
-%}
-
-/**
- * nsITimelineService is used to construct a timeline of program
- * execution. The timeline is output to a file, either stderr or the
- * value of the environment variable NS_TIMELINE_LOG_FILE. On the
- * Mac, the timeline is output to the file named "timeline.txt". The
- * reason it's different on the Mac is that the Mac environment
- * initialization code happens after timeline initialization code.
- *
- * If NS_TIMELINE_INIT_TIME is set in the environment, that will be
- * used as the time of startup; otherwise the current time when mark()
- * is first called will be used.
- *
- * mark() is used to put marks on the timeline.
- *
- * indent() and outdent() are used to format the timeline a bit to
- * show nesting. This doesn't produce perfect results in the face of
- * asychrony and multiple threads.
- *
- * enter() and leave() are convenience functions that add marks to the
- * timeline and do indentation.
- *
- * startTimer() and stopTimer() control named stop watches. If
- * startTimer() is called more than once, an equal number of
- * stopTimer() calls are needed to actually stop the timer. This
- * makes these timers slightly useful in a threaded environment.
- *
- * markTimer() puts a mark on the timeline containing the total for
- * the named timer.
- *
- * Don't use nsITimelineService in C++ code; use the NS_TIMELINE
- * macros instead. nsITimelineService exists so that JavaScript code
- * can mark the timeline.
- */
-[scriptable, uuid(93276790-3daf-11d5-b67d-000064657374)]
-interface nsITimelineService : nsISupports
-{
- /**
- * mark()
- * Print "<elapsed time>: <text>\n" in the timeline log file.
- */
- void mark(in string text);
-
- /**
- * causes subsequent marks to be indented for a more readable
- * report.
- */
- void indent();
-
- /**
- * Causes subsequent marks to be outdented.
- */
- void outdent();
-
- /**
- * enter/leave bracket code with "<text>..." and "...<text>" as
- * well as indentation.
- */
- void enter(in string text);
- void leave(in string text);
-
- void startTimer(in string timerName);
-
- void stopTimer(in string timerName);
-
- void markTimer(in string timerName);
-
- void resetTimer(in string timerName);
-
- // Mark a timer, plus an additional comment
- void markTimerWithComment(in string timerName, in string comment);
-};
-
-%{C++
-#endif /* MOZ_TIMELINE */
-%}
-
-
-%{C++
-
-#ifdef MOZ_TIMELINE
-
-/*
- * These are equivalent to the corresponding nsITimelineService
- * methods, and can be called before XPCOM is initialized.
- */
-extern "C" NS_COM nsresult NS_TimelineMark(const char *text, ...);
-extern "C" NS_COM nsresult NS_TimelineForceMark(const char *text, ...);
-extern "C" NS_COM nsresult NS_TimelineStartTimer(const char *timerName);
-extern "C" NS_COM nsresult NS_TimelineStopTimer(const char *timerName);
-extern "C" NS_COM nsresult NS_TimelineResetTimer(const char *timerName);
-extern "C" NS_COM nsresult NS_TimelineMarkTimer(const char *timerName, const char *str=nsnull);
-extern "C" NS_COM nsresult NS_TimelineIndent();
-extern "C" NS_COM nsresult NS_TimelineOutdent();
-extern "C" NS_COM nsresult NS_TimelineEnter(const char *text);
-extern "C" NS_COM nsresult NS_TimelineLeave(const char *text);
-
-/*
- * Use these macros for the above calls so we can easily compile them
- * out.
- */
-#define NS_TIMELINE_MARK(text) NS_TimelineMark(text)
-#define NS_TIMELINE_MARKV(args) NS_TimelineMark args
-#define NS_TIMELINE_INDENT() NS_TimelineIndent()
-#define NS_TIMELINE_OUTDENT() NS_TimelineOutdent()
-#define NS_TIMELINE_ENTER(text) NS_TimelineEnter(text)
-#define NS_TIMELINE_LEAVE(text) NS_TimelineLeave(text)
-#define NS_TIMELINE_START_TIMER(timerName) NS_TimelineStartTimer(timerName)
-#define NS_TIMELINE_STOP_TIMER(timerName) NS_TimelineStopTimer(timerName)
-#define NS_TIMELINE_MARK_TIMER(timerName) NS_TimelineMarkTimer(timerName)
-#define NS_TIMELINE_RESET_TIMER(timerName) NS_TimelineResetTimer(timerName)
-#define NS_TIMELINE_MARK_TIMER1(timerName, str) NS_TimelineMarkTimer(timerName, str)
-
-/*
- * Helper class to time functions. Use only static strings.
- */
-class nsFunctionTimer {
-public:
- const char *mTimer;
- PRBool mMark;
- const char *mMarkStr;
- nsFunctionTimer(const char *timer, PRBool mark = PR_TRUE, const char *markStr = nsnull)
- : mTimer(timer), mMark(mark), mMarkStr(markStr)
- {
- NS_TIMELINE_START_TIMER(mTimer);
- }
-
- ~nsFunctionTimer()
- {
- NS_TIMELINE_STOP_TIMER(mTimer);
- if (mMark)
- if (mMarkStr)
- NS_TIMELINE_MARK_TIMER1(mTimer, mMarkStr);
- else
- NS_TIMELINE_MARK_TIMER(mTimer);
- }
-};
-
-/*
- * NS_TIMELINE_MARK_ macros for various data types. Each of these
- * macros replaces "%s" in its "text" argument with a string
- * representation of its last argument.
- *
- * Please feel free to add more NS_TIMELINE_MARK_ macros for
- * various data types so that code using NS_TIMELINE is uncluttered.
- * Don't forget the empty versions in the #else section below for
- * non-timeline builds.
- */
-#define NS_TIMELINE_MARK_URI(text, uri) \
- { \
- nsCAutoString spec; \
- if (uri) { \
- uri->GetSpec(spec); \
- } \
- if (!spec.IsEmpty()) { \
- NS_TimelineMark(text, spec.get()); \
- } else { \
- NS_TimelineMark(text, "??"); \
- } \
- }
-
-#define NS_TIMELINE_MARK_CHANNEL(text, channel) \
- { \
- nsCOMPtr<nsIURI> uri; \
- if (channel) { \
- channel->GetURI(getter_AddRefs(uri)); \
- } \
- NS_TIMELINE_MARK_URI(text, uri); \
- }
-
-#define NS_TIMELINE_MARK_LOADER(text, loader) \
- { \
- nsCOMPtr<nsIRequest> request; \
- loader->GetRequest(getter_AddRefs(request)); \
- nsCOMPtr<nsIChannel> channel(do_QueryInterface(request)); \
- NS_TIMELINE_MARK_CHANNEL(text, channel); \
- }
-#define NS_TIMELINE_MARK_FUNCTION(timer) nsFunctionTimer functionTimer(timer)
-#define NS_TIMELINE_MARK_FUNCTION1(timer, str) nsFunctionTimer functionTimer(timer, PR_TRUE, str)
-#define NS_TIMELINE_TIME_FUNCTION(timer) nsFunctionTimer functionTimer(timer, PR_FALSE) /* no mark, only time */
-
-#else /* !defined(MOZ_TIMELINE) */
-#define NS_TIMELINE_MARK(text)
-#define NS_TIMELINE_MARKV(args)
-#define NS_TIMELINE_INDENT()
-#define NS_TIMELINE_OUTDENT()
-#define NS_TIMELINE_START_TIMER(timerName)
-#define NS_TIMELINE_STOP_TIMER(timerName)
-#define NS_TIMELINE_MARK_TIMER(timerName)
-#define NS_TIMELINE_RESET_TIMER(timerName)
-#define NS_TIMELINE_MARK_TIMER1(timerName, str)
-#define NS_TIMELINE_ENTER(text)
-#define NS_TIMELINE_LEAVE(text)
-#define NS_TIMELINE_MARK_URI(text, uri)
-#define NS_TIMELINE_MARK_FUNCTION(timer)
-#define NS_TIMELINE_TIME_FUNCTION(timer)
-#define NS_TIMELINE_MARK_CHANNEL(text, channel)
-#define NS_TIMELINE_MARK_LOADER(text, loader);
-#endif /* defined(MOZ_TIMELINE) */
-%}
deleted file mode 100644
--- a/xpcom/ds/nsTimelineService.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsTimelineService.h"
-#include "prlong.h"
-#include "prprf.h"
-#include "prenv.h"
-#include "plhash.h"
-#include "prlock.h"
-#include "prinit.h"
-#include "prinrval.h"
-#include "prthread.h"
-
-#ifdef MOZ_TIMELINE
-
-#define MAXINDENT 20
-
-static PRFileDesc *timelineFD = PR_STDERR;
-static PRBool gTimelineDisabled = PR_TRUE;
-
-// Notes about threading:
-// We avoid locks as we always use thread-local-storage.
-// This means every other thread has its own private copy of
-// data, and this thread can't re-enter (as our implemenation
-// doesn't call back out anywhere). Thus, we can avoid locks!
-// TLS index
-static const PRUintn BAD_TLS_INDEX = (PRUintn) -1;
-static PRUintn gTLSIndex = BAD_TLS_INDEX;
-
-class TimelineThreadData {
-public:
- TimelineThreadData() : initTime(0), indent(0),
- disabled(PR_TRUE), timers(nsnull) {}
- ~TimelineThreadData() {if (timers) PL_HashTableDestroy(timers);}
- PRTime initTime;
- PRHashTable *timers;
- int indent;
- PRBool disabled;
-};
-
-/* Implementation file */
-NS_IMPL_THREADSAFE_ISUPPORTS1(nsTimelineService, nsITimelineService)
-
-/*
- * Timer structure stored in a hash table to keep track of named
- * timers.
- */
-class nsTimelineServiceTimer {
- public:
- nsTimelineServiceTimer();
- ~nsTimelineServiceTimer();
- void start();
-
- /*
- * Caller passes in "now" rather than having us calculate it so
- * that we can avoid including timer overhead in the time being
- * measured.
- */
- void stop(PRTime now);
- void reset();
- PRTime getAccum();
- PRTime getAccum(PRTime now);
-
- private:
- PRTime mAccum;
- PRTime mStart;
- PRInt32 mRunning;
- PRThread *mOwnerThread; // only used for asserts - could be #if MOZ_DEBUG
-};
-
-#define TIMER_CHECK_OWNER() \
- NS_ABORT_IF_FALSE(PR_GetCurrentThread() == mOwnerThread, \
- "Timer used by non-owning thread")
-
-
-nsTimelineServiceTimer::nsTimelineServiceTimer()
-: mAccum(LL_ZERO), mStart(LL_ZERO), mRunning(0),
- mOwnerThread(PR_GetCurrentThread())
-{
-}
-
-nsTimelineServiceTimer::~nsTimelineServiceTimer()
-{
-}
-
-void nsTimelineServiceTimer::start()
-{
- TIMER_CHECK_OWNER();
- if (!mRunning) {
- mStart = PR_Now();
- }
- mRunning++;
-}
-
-void nsTimelineServiceTimer::stop(PRTime now)
-{
- TIMER_CHECK_OWNER();
- mRunning--;
- if (mRunning == 0) {
- PRTime delta, accum;
- LL_SUB(delta, now, mStart);
- LL_ADD(accum, mAccum, delta);
- mAccum = accum;
- }
-}
-
-void nsTimelineServiceTimer::reset()
-{
- TIMER_CHECK_OWNER();
- mStart = 0;
- mAccum = 0;
-}
-
-PRTime nsTimelineServiceTimer::getAccum()
-{
- TIMER_CHECK_OWNER();
- PRTime accum;
-
- if (!mRunning) {
- accum = mAccum;
- } else {
- PRTime delta;
- LL_SUB(delta, PR_Now(), mStart);
- LL_ADD(accum, mAccum, delta);
- }
- return accum;
-}
-
-PRTime nsTimelineServiceTimer::getAccum(PRTime now)
-{
- TIMER_CHECK_OWNER();
- PRTime accum;
-
- if (!mRunning) {
- accum = mAccum;
- } else {
- PRTime delta;
- LL_SUB(delta, now, mStart);
- LL_ADD(accum, mAccum, delta);
- }
- return accum;
-}
-
-static TimelineThreadData *GetThisThreadData()
-{
- NS_ABORT_IF_FALSE(gTLSIndex!=BAD_TLS_INDEX, "Our TLS not initialized");
- TimelineThreadData *new_data = nsnull;
- TimelineThreadData *data = (TimelineThreadData *)PR_GetThreadPrivate(gTLSIndex);
- if (data == nsnull) {
- // First request for this thread - allocate it.
- new_data = new TimelineThreadData();
- if (!new_data)
- goto done;
-
- // Fill it
- new_data->timers = PL_NewHashTable(100, PL_HashString, PL_CompareStrings,
- PL_CompareValues, NULL, NULL);
- if (new_data->timers==NULL)
- goto done;
- new_data->initTime = PR_Now();
- NS_ASSERTION(!gTimelineDisabled,
- "Why are we creating new state when disabled?");
- new_data->disabled = PR_FALSE;
- data = new_data;
- new_data = nsnull;
- PR_SetThreadPrivate(gTLSIndex, data);
- }
-done:
- if (new_data) // eeek - error during creation!
- delete new_data;
- NS_ASSERTION(data, "TimelineService could not get thread-local data");
- return data;
-}
-
-extern "C" {
- static void ThreadDestruct (void *data);
- static PRStatus TimelineInit(void);
-}
-
-void ThreadDestruct( void *data )
-{
- if (data)
- delete (TimelineThreadData *)data;
-}
-
-/*
-* PRCallOnceFN that initializes stuff for the timing service.
-*/
-static PRCallOnceType initonce;
-
-PRStatus TimelineInit(void)
-{
- char *timeStr;
- char *fileName;
- const char *timelineEnable;
- PRInt32 secs, msecs;
- PRFileDesc *fd;
- PRInt64 tmp1, tmp2;
-
- PRStatus status = PR_NewThreadPrivateIndex( &gTLSIndex, ThreadDestruct );
- NS_ASSERTION(status==0, "TimelineService could not allocate TLS storage.");
-
- timeStr = PR_GetEnv("NS_TIMELINE_INIT_TIME");
- // NS_TIMELINE_INIT_TIME only makes sense for the main thread, so if it
- // exists, set it there. If not, let normal thread management code take
- // care of setting the init time.
- if (timeStr && *timeStr && (2 == PR_sscanf(timeStr, "%d.%d", &secs, &msecs))) {
- PRTime &initTime = GetThisThreadData()->initTime;
- LL_MUL(tmp1, (PRInt64)secs, 1000000);
- LL_MUL(tmp2, (PRInt64)msecs, 1000);
- LL_ADD(initTime, tmp1, tmp2);
- }
-
- // Get the log file.
- fileName = PR_GetEnv("NS_TIMELINE_LOG_FILE");
- if (fileName && *fileName
- && (fd = PR_Open(fileName, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
- 0666)) != NULL) {
- timelineFD = fd;
- PR_fprintf(fd,
- "NOTE: due to asynchrony, the indentation that you see does"
- " not necessarily correspond to nesting in the code.\n\n");
- }
-
- // Runtime disable of timeline
- timelineEnable = PR_GetEnv("NS_TIMELINE_ENABLE");
- if (timelineEnable && *timelineEnable)
- gTimelineDisabled = PR_FALSE;
- return PR_SUCCESS;
-}
-
-static void ParseTime(PRTime tm, PRInt32& secs, PRInt32& msecs)
-{
- PRTime llsecs, llmsecs, tmp;
-
- LL_DIV(llsecs, tm, 1000000);
- LL_MOD(tmp, tm, 1000000);
- LL_DIV(llmsecs, tmp, 1000);
-
- LL_L2I(secs, llsecs);
- LL_L2I(msecs, llmsecs);
-}
-
-static char *Indent(char *buf)
-{
- int &indent = GetThisThreadData()->indent;
- int amount = indent;
- if (amount > MAXINDENT) {
- amount = MAXINDENT;
- }
- if (amount < 0) {
- amount = 0;
- indent = 0;
- PR_Write(timelineFD, "indent underflow!\n", 18);
- }
- while (amount--) {
- *buf++ = ' ';
- }
- return buf;
-}
-
-static void PrintTime(PRTime tm, const char *text, va_list args)
-{
- PRInt32 secs, msecs;
- char pbuf[550], *pc, tbuf[550];
-
- ParseTime(tm, secs, msecs);
-
- // snprintf/write rather than fprintf because we don't want
- // messages from multiple threads to garble one another.
- pc = Indent(pbuf);
- PR_vsnprintf(pc, sizeof pbuf - (pc - pbuf), text, args);
- PR_snprintf(tbuf, sizeof tbuf, "%05d.%03d (%08p): %s\n",
- secs, msecs, PR_GetCurrentThread(), pbuf);
- PR_Write(timelineFD, tbuf, strlen(tbuf));
-}
-
-/*
- * Make this public if we need it.
- */
-static nsresult NS_TimelineMarkV(const char *text, va_list args)
-{
- PRTime elapsed,tmp;
-
- PR_CallOnce(&initonce, TimelineInit);
-
- TimelineThreadData *thread = GetThisThreadData();
-
- tmp = PR_Now();
- LL_SUB(elapsed, tmp, thread->initTime);
-
- PrintTime(elapsed, text, args);
-
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineForceMark(const char *text, ...)
-{
- va_list args;
- va_start(args, text);
- NS_TimelineMarkV(text, args);
-
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineMark(const char *text, ...)
-{
- va_list args;
- va_start(args, text);
-
- PR_CallOnce(&initonce, TimelineInit);
-
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
-
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- NS_TimelineMarkV(text, args);
-
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineStartTimer(const char *timerName)
-{
- PR_CallOnce(&initonce, TimelineInit);
-
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
-
- if (thread->timers == NULL)
- return NS_ERROR_FAILURE;
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- nsTimelineServiceTimer *timer
- = (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
- if (timer == NULL) {
- timer = new nsTimelineServiceTimer;
- if (!timer)
- return NS_ERROR_OUT_OF_MEMORY;
-
- PL_HashTableAdd(thread->timers, timerName, timer);
- }
- timer->start();
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineStopTimer(const char *timerName)
-{
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
- /*
- * Strange-looking now/timer->stop() interaction is to avoid
- * including time spent in TLS and PL_HashTableLookup in the
- * timer.
- */
- PRTime now = PR_Now();
-
- TimelineThreadData *thread = GetThisThreadData();
- if (thread->timers == NULL)
- return NS_ERROR_FAILURE;
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
- nsTimelineServiceTimer *timer
- = (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
- if (timer == NULL) {
- return NS_ERROR_FAILURE;
- }
-
- timer->stop(now);
-
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineMarkTimer(const char *timerName, const char *str)
-{
- PR_CallOnce(&initonce, TimelineInit);
-
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
- if (thread->timers == NULL)
- return NS_ERROR_FAILURE;
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
- nsTimelineServiceTimer *timer
- = (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
- if (timer == NULL) {
- return NS_ERROR_FAILURE;
- }
- PRTime accum = timer->getAccum();
-
- char buf[500];
- PRInt32 sec, msec;
- ParseTime(accum, sec, msec);
- if (!str)
- PR_snprintf(buf, sizeof buf, "%s total: %d.%03d",
- timerName, sec, msec);
- else
- PR_snprintf(buf, sizeof buf, "%s total: %d.%03d (%s)",
- timerName, sec, msec, str);
- NS_TimelineMark(buf);
-
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineResetTimer(const char *timerName)
-{
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
- if (thread->timers == NULL)
- return NS_ERROR_FAILURE;
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
- nsTimelineServiceTimer *timer
- = (nsTimelineServiceTimer *)PL_HashTableLookup(thread->timers, timerName);
- if (timer == NULL) {
- return NS_ERROR_FAILURE;
- }
-
- timer->reset();
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineIndent()
-{
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
- thread->indent++;
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineOutdent()
-{
- if (gTimelineDisabled)
- return NS_ERROR_NOT_AVAILABLE;
-
- TimelineThreadData *thread = GetThisThreadData();
- if (thread->disabled)
- return NS_ERROR_NOT_AVAILABLE;
- thread->indent--;
- return NS_OK;
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineEnter(const char *text)
-{
- nsresult rv = NS_TimelineMark("%s...", text);
- if (NS_FAILED(rv)) {
- return rv;
- }
- return NS_TimelineIndent();
-}
-
-PR_IMPLEMENT(nsresult) NS_TimelineLeave(const char *text)
-{
- nsresult rv = NS_TimelineOutdent();
- if (NS_FAILED(rv)) {
- return rv;
- }
- return NS_TimelineMark("...%s", text);
-}
-
-nsTimelineService::nsTimelineService()
-{
- /* member initializers and constructor code */
-}
-
-/* void mark (in string text); */
-NS_IMETHODIMP nsTimelineService::Mark(const char *text)
-{
- return NS_TimelineMark(text);
-}
-
-/* void startTimer (in string timerName); */
-NS_IMETHODIMP nsTimelineService::StartTimer(const char *timerName)
-{
- return NS_TimelineStartTimer(timerName);
-}
-
-/* void stopTimer (in string timerName); */
-NS_IMETHODIMP nsTimelineService::StopTimer(const char *timerName)
-{
- return NS_TimelineStopTimer(timerName);
-}
-
-/* void markTimer (in string timerName); */
-NS_IMETHODIMP nsTimelineService::MarkTimer(const char *timerName)
-{
- return NS_TimelineMarkTimer(timerName);
-}
-
-/* void markTimerWithComment(in string timerName, in string comment); */
-NS_IMETHODIMP nsTimelineService::MarkTimerWithComment(const char *timerName, const char *comment)
-{
- return NS_TimelineMarkTimer(timerName, comment);
-}
-
-/* void resetTimer (in string timerName); */
-NS_IMETHODIMP nsTimelineService::ResetTimer(const char *timerName)
-{
- return NS_TimelineResetTimer(timerName);
-}
-
-/* void indent (); */
-NS_IMETHODIMP nsTimelineService::Indent()
-{
- return NS_TimelineIndent();
-}
-
-/* void outdent (); */
-NS_IMETHODIMP nsTimelineService::Outdent()
-{
- return NS_TimelineOutdent();
-}
-
-/* void enter (in string text); */
-NS_IMETHODIMP nsTimelineService::Enter(const char *text)
-{
- return NS_TimelineEnter(text);
-}
-
-/* void leave (in string text); */
-NS_IMETHODIMP nsTimelineService::Leave(const char *text)
-{
- return NS_TimelineLeave(text);
-}
-
-#endif /* MOZ_TIMELINE */
deleted file mode 100644
--- a/xpcom/ds/nsTimelineService.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsITimelineService.h"
-
-#ifdef MOZ_TIMELINE
-
-#define NS_TIMELINESERVICE_CID \
-{ /* a335edf0-3daf-11d5-b67d-000064657374 */ \
- 0xa335edf0, \
- 0x3daf, \
- 0x11d5, \
- {0xb6, 0x7d, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
-
-#define NS_TIMELINESERVICE_CONTRACTID "@mozilla.org;timeline-service;1"
-#define NS_TIMELINESERVICE_CLASSNAME "Timeline Service"
-
-class nsTimelineService : public nsITimelineService
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSITIMELINESERVICE
-
- nsTimelineService();
-
-private:
- ~nsTimelineService() {}
-};
-
-#endif
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -83,17 +83,16 @@
#include "nsString.h"
#include "nsReadableUtils.h"
#include "nsLocalFile.h"
#include "nsIComponentManager.h"
#include "nsXPIDLString.h"
#include "prproces.h"
#include "nsIDirectoryEnumerator.h"
#include "nsISimpleEnumerator.h"
-#include "nsITimelineService.h"
#ifdef MOZ_WIDGET_GTK2
#include "nsIGIOService.h"
#include "nsIGnomeVFSService.h"
#endif
#ifdef XP_MACOSX
#include <Carbon/Carbon.h>
@@ -1684,31 +1683,26 @@ nsLocalFile::GetDirectoryEntries(nsISimp
}
NS_IMETHODIMP
nsLocalFile::Load(PRLibrary **_retval)
{
CHECK_mPath();
NS_ENSURE_ARG_POINTER(_retval);
- NS_TIMELINE_START_TIMER("PR_LoadLibrary");
-
#ifdef NS_BUILD_REFCNT_LOGGING
nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE);
#endif
*_retval = PR_LoadLibrary(mPath.get());
#ifdef NS_BUILD_REFCNT_LOGGING
nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE);
#endif
- NS_TIMELINE_STOP_TIMER("PR_LoadLibrary");
- NS_TIMELINE_MARK_TIMER1("PR_LoadLibrary", mPath.get());
-
if (!*_retval)
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP
nsLocalFile::GetPersistentDescriptor(nsACString &aPersistentDescriptor)
{
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -70,17 +70,16 @@
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <mbstring.h>
#include "nsXPIDLString.h"
#include "prproces.h"
-#include "nsITimelineService.h"
#include "mozilla/Mutex.h"
#include "SpecialSystemDirectory.h"
#include "nsTraceRefcntImpl.h"
using namespace mozilla;
@@ -1732,35 +1731,29 @@ nsLocalFile::Load(PRLibrary * *_retval)
nsresult rv = IsFile(&isFile);
if (NS_FAILED(rv))
return rv;
if (! isFile)
return NS_ERROR_FILE_IS_DIRECTORY;
- NS_TIMELINE_START_TIMER("PR_LoadLibraryWithFlags");
-
#ifdef NS_BUILD_REFCNT_LOGGING
nsTraceRefcntImpl::SetActivityIsLegal(PR_FALSE);
#endif
PRLibSpec libSpec;
libSpec.value.pathname_u = mResolvedPath.get();
libSpec.type = PR_LibSpec_PathnameU;
*_retval = PR_LoadLibraryWithFlags(libSpec, 0);
#ifdef NS_BUILD_REFCNT_LOGGING
nsTraceRefcntImpl::SetActivityIsLegal(PR_TRUE);
#endif
- NS_TIMELINE_STOP_TIMER("PR_LoadLibraryWithFlags");
- NS_TIMELINE_MARK_TIMER1("PR_LoadLibraryWithFlags",
- NS_ConvertUTF16toUTF8(mResolvedPath).get());
-
if (*_retval)
return NS_OK;
return NS_ERROR_NULL_POINTER;
}
NS_IMETHODIMP
nsLocalFile::Remove(PRBool recursive)
{
--- a/xpfe/appshell/src/nsAppShellService.cpp
+++ b/xpfe/appshell/src/nsAppShellService.cpp
@@ -52,17 +52,16 @@
#include "nsIWindowMediator.h"
#include "nsIWindowWatcher.h"
#include "nsPIWindowWatcher.h"
#include "nsIDOMWindow.h"
#include "nsWebShellWindow.h"
#include "nsIEnumerator.h"
#include "nsCRT.h"
-#include "nsITimelineService.h"
#include "prprf.h"
#include "nsWidgetsCID.h"
#include "nsIRequestObserver.h"
/* For implementing GetHiddenWindowAndJSContext */
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
--- a/xpfe/appshell/src/nsXULWindow.cpp
+++ b/xpfe/appshell/src/nsXULWindow.cpp
@@ -76,17 +76,16 @@
#include "nsIWindowMediator.h"
#include "nsIScreenManager.h"
#include "nsIScreen.h"
#include "nsIScrollable.h"
#include "nsIScriptSecurityManager.h"
#include "nsIWindowWatcher.h"
#include "nsIURI.h"
#include "nsIDOMCSSStyleDeclaration.h"
-#include "nsITimelineService.h"
#include "nsAppShellCID.h"
#include "nsReadableUtils.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsWebShellWindow.h" // get rid of this one, too...
#include "prenv.h"
@@ -787,25 +786,22 @@ NS_IMETHODIMP nsXULWindow::GetVisibility
*aVisibility = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP nsXULWindow::SetVisibility(PRBool aVisibility)
{
- NS_TIMELINE_ENTER("nsXULWindow::SetVisibility.");
if (!mChromeLoaded) {
mShowAfterLoad = aVisibility;
- NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
return NS_OK;
}
if (mDebuting) {
- NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
return NS_OK;
}
mDebuting = PR_TRUE; // (Show / Focus is recursive)
//XXXTAB Do we really need to show docshell and the window? Isn't
// the window good enough?
nsCOMPtr<nsIBaseWindow> shellAsWin(do_QueryInterface(mDocShell));
shellAsWin->SetVisibility(aVisibility);
@@ -824,17 +820,16 @@ NS_IMETHODIMP nsXULWindow::SetVisibility
nsCOMPtr<nsIObserverService> obssvc
(do_GetService("@mozilla.org/observer-service;1"));
NS_ASSERTION(obssvc, "Couldn't get observer service.");
if (obssvc) {
obssvc->NotifyObservers(nsnull, "xul-window-visible", nsnull);
}
mDebuting = PR_FALSE;
- NS_TIMELINE_LEAVE("nsXULWindow::SetVisibility");
return NS_OK;
}
NS_IMETHODIMP nsXULWindow::GetEnabled(PRBool *aEnabled)
{
NS_ENSURE_ARG_POINTER(aEnabled);
if (mWindow)
return mWindow->IsEnabled(aEnabled);
@@ -1743,42 +1738,38 @@ NS_IMETHODIMP nsXULWindow::CreateNewWind
if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
return CreateNewChromeWindow(aChromeFlags, aAppShell, _retval);
return CreateNewContentWindow(aChromeFlags, aAppShell, _retval);
}
NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval)
{
- NS_TIMELINE_ENTER("nsXULWindow::CreateNewChromeWindow");
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
// Just do a normal create of a window and return.
nsCOMPtr<nsIXULWindow> newWindow;
appShell->CreateTopLevelWindow(this, nsnull, aChromeFlags,
nsIAppShellService::SIZE_TO_CONTENT,
nsIAppShellService::SIZE_TO_CONTENT,
aAppShell, getter_AddRefs(newWindow));
NS_ENSURE_TRUE(newWindow, NS_ERROR_FAILURE);
*_retval = newWindow;
NS_ADDREF(*_retval);
- NS_TIMELINE_LEAVE("nsXULWindow::CreateNewChromeWindow done");
return NS_OK;
}
NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(PRInt32 aChromeFlags,
nsIAppShell* aAppShell, nsIXULWindow **_retval)
{
- NS_TIMELINE_ENTER("nsXULWindow::CreateNewContentWindow");
-
nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
// We need to create a new top level window and then enter a nested
// loop. Eventually the new window will be told that it has loaded,
// at which time we know it is safe to spin out of the nested loop
// and allow the opening code to proceed.
@@ -1822,17 +1813,16 @@ NS_IMETHODIMP nsXULWindow::CreateNewCont
NS_ASSERTION(cx == nsnull, "JSContextStack mismatch");
}
NS_ENSURE_STATE(xulWin->mPrimaryContentShell);
*_retval = newWindow;
NS_ADDREF(*_retval);
- NS_TIMELINE_LEAVE("nsXULWindow::CreateNewContentWindow");
return NS_OK;
}
void nsXULWindow::EnableParent(PRBool aEnable)
{
nsCOMPtr<nsIBaseWindow> parentWindow;
nsCOMPtr<nsIWidget> parentWidget;