diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 14d52ca4da0..2c705faf867 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -110,7 +110,6 @@ class nsFrameLoader; class nsIBoxObject; class imgIRequest; class nsISHEntry; -class nsDOMNavigationTiming; namespace mozilla { namespace css { @@ -125,8 +124,8 @@ class Element; #define NS_IDOCUMENT_IID \ -{ 0x2c6ad63f, 0xb7b9, 0x42f8, \ - { 0xbd, 0xde, 0x76, 0x0a, 0x83, 0xe3, 0xb0, 0x49 } } +{ 0x26ef6218, 0xcd5e, 0x4953, \ + { 0xbb, 0x57, 0xb8, 0x50, 0x29, 0xa1, 0xae, 0x40 } } // Flag for AddStyleSheet(). #define NS_STYLESHEET_FROM_CATALOG (1 << 0) @@ -1520,11 +1519,6 @@ public: virtual nsresult GetStateObject(nsIVariant** aResult) = 0; - virtual nsDOMNavigationTiming* GetNavigationTiming() const = 0; - - virtual nsresult SetNavigationTiming(nsDOMNavigationTiming* aTiming) = 0; - - protected: ~nsIDocument() { diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in index 7706503be2f..9671ef949ba 100644 --- a/content/base/src/Makefile.in +++ b/content/base/src/Makefile.in @@ -211,7 +211,6 @@ INCLUDES += \ -I$(topsrcdir)/js/src/xpconnect/src \ -I$(topsrcdir)/caps/include \ -I$(topsrcdir)/netwerk/base/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index cfaa834fe69..d11abcf47cc 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -183,7 +183,6 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID); #include "mozAutoDocUpdate.h" #include "nsGlobalWindow.h" #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" -#include "nsDOMNavigationTiming.h" #ifdef MOZ_SMIL #include "nsSMILAnimationController.h" @@ -4104,10 +4103,6 @@ nsDocument::DispatchContentLoadedEvents() // Unpin references to preloaded images mPreloadingImages.Clear(); - - if (mTiming) { - mTiming->NotifyDOMContentLoadedStart(nsIDocument::GetDocumentURI()); - } // Fire a DOM event notifying listeners that this document has been // loaded (excluding images and other loads initiated by this @@ -4116,10 +4111,6 @@ nsDocument::DispatchContentLoadedEvents() NS_LITERAL_STRING("DOMContentLoaded"), PR_TRUE, PR_TRUE); - if (mTiming) { - mTiming->NotifyDOMContentLoadedEnd(nsIDocument::GetDocumentURI()); - } - // If this document is a [i]frame, fire a DOMFrameContentLoaded // event on all parent documents notifying that the HTML (excluding // other external files such as images and stylesheets) in a frame @@ -7704,26 +7695,6 @@ void nsDocument::SetReadyStateInternal(ReadyState rs) { mReadyState = rs; - if (mTiming) { - switch (rs) { - case READYSTATE_LOADING: - mTiming->NotifyDOMLoading(nsIDocument::GetDocumentURI()); - break; - case READYSTATE_INTERACTIVE: - mTiming->NotifyDOMInteractive(nsIDocument::GetDocumentURI()); - break; - case READYSTATE_COMPLETE: - mTiming->NotifyDOMComplete(nsIDocument::GetDocumentURI()); - break; - default: - NS_WARNING("Unexpected ReadyState value"); - break; - } - } - // At the time of loading start, we don't have timing object, record time. - if (READYSTATE_LOADING == rs) { - mLoadingTimeStamp = mozilla::TimeStamp::Now(); - } nsRefPtr plevent = new nsPLDOMEvent(this, NS_LITERAL_STRING("readystatechange"), PR_FALSE, PR_FALSE); @@ -8192,22 +8163,6 @@ nsDocument::GetStateObject(nsIVariant** aState) return NS_OK; } -nsDOMNavigationTiming* -nsDocument::GetNavigationTiming() const -{ - return mTiming; -} - -nsresult -nsDocument::SetNavigationTiming(nsDOMNavigationTiming* aTiming) -{ - mTiming = aTiming; - if (!mLoadingTimeStamp.IsNull() && mTiming) { - mTiming->SetDOMLoadingTimeStamp(nsIDocument::GetDocumentURI(), mLoadingTimeStamp); - } - return NS_OK; -} - nsresult nsDocument::AddImage(imgIRequest* aImage) { @@ -8428,3 +8383,4 @@ nsDocument::CreateTouchList(nsIVariant* aPoints, *aRetVal = retval.forget().get(); return NS_OK; } + diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index bc64bb4f7b3..38cc19c4f13 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -106,8 +106,6 @@ #include "nsIDOMDOMImplementation.h" #include "nsIDOMTouchEvent.h" -#include "TimeStamp.h" - #define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0) #define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1) #define XML_DECLARATION_BITS_STANDALONE_EXISTS (1 << 2) @@ -129,7 +127,6 @@ class nsChildContentList; class nsXMLEventsManager; class nsHTMLStyleSheet; class nsHTMLCSSStyleSheet; -class nsDOMNavigationTiming; /** * Right now our identifier map entries contain information for 'name' @@ -964,10 +961,6 @@ public: virtual nsresult GetStateObject(nsIVariant** aResult); - virtual nsDOMNavigationTiming* GetNavigationTiming() const; - - virtual nsresult SetNavigationTiming(nsDOMNavigationTiming* aTiming); - protected: friend class nsNodeUtils; @@ -1102,9 +1095,6 @@ protected: nsClassHashtable mRadioGroups; - // Recorded time of change to 'loading' state. - mozilla::TimeStamp mLoadingTimeStamp; - // True if the document has been detached from its content viewer. PRPackedBool mIsGoingAway:1; // True if the document is being destroyed. @@ -1163,7 +1153,6 @@ protected: nsEventStates mDocumentState; nsEventStates mGotDocumentState; - nsRefPtr mTiming; private: friend class nsUnblockOnloadEvent; diff --git a/content/html/content/src/Makefile.in b/content/html/content/src/Makefile.in index 092cfe96548..7937c34f84f 100644 --- a/content/html/content/src/Makefile.in +++ b/content/html/content/src/Makefile.in @@ -145,7 +145,6 @@ INCLUDES += \ -I$(srcdir)/../../../../editor/libeditor/base \ -I$(srcdir)/../../../../editor/libeditor/text \ -I$(srcdir) \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/html/document/src/Makefile.in b/content/html/document/src/Makefile.in index 633534e5b61..29e75eb7735 100644 --- a/content/html/document/src/Makefile.in +++ b/content/html/document/src/Makefile.in @@ -77,7 +77,6 @@ INCLUDES += \ -I$(srcdir)/../../../../dom/base \ -I$(srcdir)/../../../../xpcom/io \ -I$(srcdir)/../../../../caps/include \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/svg/document/src/Makefile.in b/content/svg/document/src/Makefile.in index 63ddb96c0b4..b3a77697b1a 100644 --- a/content/svg/document/src/Makefile.in +++ b/content/svg/document/src/Makefile.in @@ -63,7 +63,6 @@ INCLUDES += \ -I$(srcdir)/../../../../layout/style \ -I$(srcdir)/../../../base/src \ -I$(srcdir)/../../../events/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/xbl/src/Makefile.in b/content/xbl/src/Makefile.in index eefba37a536..eddf0b482c9 100644 --- a/content/xbl/src/Makefile.in +++ b/content/xbl/src/Makefile.in @@ -88,7 +88,6 @@ LOCAL_INCLUDES = \ -I$(srcdir)/../../events/src \ -I$(srcdir)/../../../layout/style \ -I$(srcdir)/../../../dom/base \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/xml/document/src/Makefile.in b/content/xml/document/src/Makefile.in index ff0a40ef984..64ea73e2f6f 100644 --- a/content/xml/document/src/Makefile.in +++ b/content/xml/document/src/Makefile.in @@ -69,7 +69,6 @@ LOCAL_INCLUDES = \ -I$(srcdir)/../../../events/src \ -I$(srcdir)/../../../../dom/base \ -I$(srcdir)/../../../../caps/include \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/xul/content/src/Makefile.in b/content/xul/content/src/Makefile.in index f5df0223407..f8a3d95e926 100644 --- a/content/xul/content/src/Makefile.in +++ b/content/xul/content/src/Makefile.in @@ -73,7 +73,6 @@ LOCAL_INCLUDES = \ -I$(srcdir)/../../../html/content/src \ -I$(srcdir)/../../../events/src \ -I$(srcdir)/../../../xbl/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/content/xul/document/src/Makefile.in b/content/xul/document/src/Makefile.in index 81fc321b468..ccfb4117f2f 100644 --- a/content/xul/document/src/Makefile.in +++ b/content/xul/document/src/Makefile.in @@ -75,7 +75,6 @@ LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \ -I$(srcdir)/../../../xml/document/src \ -I$(srcdir)/../../../xbl/src \ -I$(srcdir)/../../../events/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) DEFINES += -D_IMPL_NS_LAYOUT diff --git a/docshell/base/Makefile.in b/docshell/base/Makefile.in index 7d3e14277d6..b83f3f220cc 100644 --- a/docshell/base/Makefile.in +++ b/docshell/base/Makefile.in @@ -118,8 +118,6 @@ include $(topsrcdir)/config/rules.mk LOCAL_INCLUDES += \ -I$(srcdir)/../shistory/src \ - -I$(topsrcdir)/dom/base \ -I$(topsrcdir)/layout/base \ -I$(topsrcdir)/js/src/xpconnect/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index b2a8b8c738b..cd04170ab37 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -235,8 +235,6 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID); #include "nsXULAppAPI.h" -#include "nsDOMNavigationTiming.h" - using namespace mozilla; // Number of documents currently loading @@ -676,45 +674,6 @@ DispatchPings(nsIContent *content, nsIURI *referrer) ForEachPing(content, SendPing, &info); } -static nsDOMPerformanceNavigationType -ConvertLoadTypeToNavigationType(PRUint32 aLoadType) -{ - nsDOMPerformanceNavigationType result = nsIDOMPerformanceNavigation::TYPE_RESERVED; - switch (aLoadType) { - case LOAD_NORMAL: - case LOAD_NORMAL_EXTERNAL: - case LOAD_NORMAL_BYPASS_CACHE: - case LOAD_NORMAL_BYPASS_PROXY: - case LOAD_NORMAL_BYPASS_PROXY_AND_CACHE: - case LOAD_LINK: - result = nsIDOMPerformanceNavigation::TYPE_NAVIGATE; - break; - case LOAD_HISTORY: - result = nsIDOMPerformanceNavigation::TYPE_BACK_FORWARD; - break; - case LOAD_RELOAD_NORMAL: - case LOAD_RELOAD_CHARSET_CHANGE: - case LOAD_RELOAD_BYPASS_CACHE: - case LOAD_RELOAD_BYPASS_PROXY: - case LOAD_RELOAD_BYPASS_PROXY_AND_CACHE: - result = nsIDOMPerformanceNavigation::TYPE_RELOAD; - break; - case LOAD_NORMAL_REPLACE: - case LOAD_STOP_CONTENT: - case LOAD_STOP_CONTENT_AND_REPLACE: - case LOAD_REFRESH: - case LOAD_BYPASS_HISTORY: - case LOAD_ERROR_PAGE: - case LOAD_PUSHSTATE: - result = nsIDOMPerformanceNavigation::TYPE_RESERVED; - break; - default: - NS_NOTREACHED("Unexpected load type value"); - } - - return result; -} - static nsISHEntry* GetRootSHEntry(nsISHEntry *entry); //***************************************************************************** @@ -1561,16 +1520,8 @@ nsDocShell::FirePageHideNotification(PRBool aIsUnload) nsCOMPtr kungFuDeathGrip(mContentViewer); mFiredUnloadEvent = PR_TRUE; - if (mTiming) { - mTiming->NotifyUnloadEventStart(); - } - mContentViewer->PageHide(aIsUnload); - if (mTiming) { - mTiming->NotifyUnloadEventEnd(); - } - nsAutoTArray, 8> kids; PRInt32 i, n = mChildList.Count(); kids.SetCapacity(n); @@ -1592,23 +1543,6 @@ nsDocShell::FirePageHideNotification(PRBool aIsUnload) return NS_OK; } -nsresult -nsDocShell::MaybeInitTiming() -{ - if (mTiming) { - return NS_OK; - } - - PRBool enabled; - nsresult rv = mPrefs->GetBoolPref("dom.enable_performance", &enabled); - if (NS_SUCCEEDED(rv) && enabled) { - mTiming = new nsDOMNavigationTiming(); - mTiming->NotifyNavigationStart(); - } - return NS_OK; -} - - // // Bug 13871: Prevent frameset spoofing // @@ -5890,22 +5824,15 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest, nsresult rv; if ((~aStateFlags & (STATE_START | STATE_IS_NETWORK)) == 0) { - // Save timing statistics. - nsCOMPtr channel(do_QueryInterface(aRequest)); - // Make sure timing is created - rv = MaybeInitTiming(); - nsCOMPtr uri; - channel->GetURI(getter_AddRefs(uri)); - if (mTiming) { - mTiming->NotifyFetchStart(uri, ConvertLoadTypeToNavigationType(mLoadType)); - } - nsCOMPtr wcwgChannel(do_QueryInterface(aRequest)); nsCOMPtr webProgress = do_QueryInterface(GetAsSupports(this)); // Was the wyciwyg document loaded on this docshell? if (wcwgChannel && !mLSHE && (mItemType == typeContent) && aProgress == webProgress.get()) { + nsCOMPtr uri; + wcwgChannel->GetURI(getter_AddRefs(uri)); + PRBool equalUri = PR_TRUE; // Store the wyciwyg url in session history, only if it is // being loaded fresh for the first time. We don't want @@ -6028,13 +5955,6 @@ nsDocShell::OnRedirectStateChange(nsIChannel* aOldChannel, if (!oldURI || !newURI) { return; } - // On session restore we get a redirect from page to itself. Don't count it. - PRBool equals = PR_FALSE; - if (mTiming && - !(mLoadType == LOAD_HISTORY && - NS_SUCCEEDED(newURI->Equals(oldURI, &equals)) && equals)) { - mTiming->NotifyRedirect(oldURI, newURI); - } // Below a URI visit is saved (see AddURIVisit method doc). // The visit chain looks something like: @@ -6118,10 +6038,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress, nsCOMPtr url; nsresult rv = aChannel->GetURI(getter_AddRefs(url)); if (NS_FAILED(rv)) return rv; - - // Timing is picked up by the window, we don't need it anymore - mTiming = nsnull; - + // clean up reload state for meta charset if (eCharsetReloadRequested == mCharsetReloadState) mCharsetReloadState = eCharsetReloadStopOrigional; @@ -6550,13 +6467,6 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal, // with about:blank. And also ensure we fire the unload events // in the current document. - // Make sure timing is created. Unload gets fired first for - // document loaded from the session history. - rv = MaybeInitTiming(); - if (mTiming) { - mTiming->NotifyBeforeUnload(); - } - PRBool okToUnload; rv = mContentViewer->PermitUnload(PR_FALSE, &okToUnload); @@ -6568,10 +6478,6 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal, mSavingOldViewer = aTryToSaveOldPresentation && CanSavePresentation(LOAD_NORMAL, nsnull, nsnull); - if (mTiming) { - mTiming->NotifyUnloadAccepted(mCurrentURI); - } - // Make sure to blow away our mLoadingURI just in case. No loads // from inside this pagehide. mLoadingURI = nsnull; @@ -7791,12 +7697,6 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer) nsIntRect bounds(x, y, cx, cy); - nsCOMPtr docviewer = - do_QueryInterface(mContentViewer); - if (docviewer) { - docviewer->SetNavigationTiming(mTiming); - } - if (NS_FAILED(mContentViewer->Init(widget, bounds))) { mContentViewer = nsnull; NS_ERROR("ContentViewer Initialization failed"); @@ -7829,6 +7729,9 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer) // Stuff the bgcolor from the old pres shell into the new // pres shell. This improves page load continuity. + nsCOMPtr docviewer = + do_QueryInterface(mContentViewer); + if (docviewer) { nsCOMPtr shell; docviewer->GetPresShell(getter_AddRefs(shell)); @@ -8555,10 +8458,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, // (bug#331040) nsCOMPtr kungFuDeathGrip(this); - rv = MaybeInitTiming(); - if (mTiming) { - mTiming->NotifyBeforeUnload(); - } // Check if the page doesn't want to be unloaded. The javascript: // protocol handler deals with this for javascript: URLs. if (!bIsJavascript && mContentViewer) { @@ -8572,10 +8471,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, } } - if (mTiming) { - mTiming->NotifyUnloadAccepted(mCurrentURI); - } - // Check for saving the presentation here, before calling Stop(). // This is necessary so that we can catch any pending requests. // Since the new request has not been created yet, we pass null for the @@ -11786,6 +11681,7 @@ nsDocShell::GetPrintPreview(nsIWebBrowserPrint** aPrintPreview) #endif } + #ifdef DEBUG unsigned long nsDocShell::gNumberOfDocShells = 0; #endif diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index 242c07e25c7..09555a93699 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -119,7 +119,6 @@ class nsDocShell; class nsIController; class OnLinkClickEvent; class nsIScrollableFrame; -class nsDOMNavigationTiming; /* load commands were moved to nsIDocShell.h */ /* load types were moved to nsDocShellLoadTypes.h */ @@ -685,8 +684,6 @@ protected: void ClearFrameHistory(nsISHEntry* aEntry); - nsresult MaybeInitTiming(); - // Event type dispatched by RestorePresentation class RestorePresentationEvent : public nsRunnable { public: @@ -840,8 +837,6 @@ protected: static nsIURIFixup *sURIFixup; - nsRefPtr mTiming; - #ifdef DEBUG private: // We're counting the number of |nsDocShells| to help find leaks diff --git a/docshell/test/Makefile.in b/docshell/test/Makefile.in index 88a84de7e6e..1a632d3b844 100644 --- a/docshell/test/Makefile.in +++ b/docshell/test/Makefile.in @@ -104,8 +104,6 @@ _TEST_FILES = \ test_framedhistoryframes.html \ test_windowedhistoryframes.html \ historyframes.html \ - test_bug570341.html \ - bug570341_recordevents.html \ $(NULL) ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) diff --git a/docshell/test/bug570341_recordevents.html b/docshell/test/bug570341_recordevents.html deleted file mode 100644 index b41d6d147c6..00000000000 --- a/docshell/test/bug570341_recordevents.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -This document collects time -for events related to the page load progress. - diff --git a/docshell/test/test_bug570341.html b/docshell/test/test_bug570341.html deleted file mode 100644 index e8b3ed22ebf..00000000000 --- a/docshell/test/test_bug570341.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Test for Bug 570341 - - - - - - -Mozilla Bug 570341 -
- -
- -

- -
-
-
- - diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in index cb98ccb277a..19089fce9f9 100644 --- a/dom/base/Makefile.in +++ b/dom/base/Makefile.in @@ -110,8 +110,6 @@ CPPSRCS = \ nsQueryContentEventResult.cpp \ nsContentPermissionHelper.cpp \ nsStructuredCloneContainer.cpp \ - nsDOMNavigationTiming.cpp \ - nsPerformance.cpp \ $(NULL) include $(topsrcdir)/dom/dom-config.mk @@ -128,7 +126,6 @@ include $(topsrcdir)/config/rules.mk LOCAL_INCLUDES += \ -I$(srcdir)/../../js/src/xpconnect/src \ -I$(srcdir)/../../js/src/xpconnect/wrappers \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) ifdef MOZ_X11 diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index ceb3ce22513..fa68d1feac2 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -121,9 +121,6 @@ #include "nsIDOMMediaList.h" #include "nsIDOMChromeWindow.h" #include "nsIDOMConstructor.h" -#include "nsIDOMPerformanceTiming.h" -#include "nsIDOMPerformanceNavigation.h" -#include "nsIDOMPerformance.h" #include "nsClientRect.h" // DOM core includes @@ -698,12 +695,6 @@ static nsDOMClassInfoData sClassInfoData[] = { NS_DEFINE_CLASSINFO_DATA(History, nsHistorySH, ARRAY_SCRIPTABLE_FLAGS | nsIXPCScriptable::WANT_PRECREATE) - NS_DEFINE_CLASSINFO_DATA(PerformanceTiming, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(PerformanceNavigation, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(Performance, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(Screen, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(DOMPrototype, nsDOMConstructorSH, @@ -2406,53 +2397,26 @@ nsDOMClassInfo::Init() NS_ENSURE_SUCCESS(rv, rv); if (nsGlobalWindow::HasIndexedDBSupport()) { - if (nsGlobalWindow::HasPerformanceSupport()) { - DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowPerformance) - DOM_CLASSINFO_MAP_END - } else { - DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) - DOM_CLASSINFO_MAP_END - } + DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) + DOM_CLASSINFO_MAP_END } else { - if (nsGlobalWindow::HasPerformanceSupport()) { - DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowPerformance) - DOM_CLASSINFO_MAP_END - } else { - DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) - DOM_CLASSINFO_MAP_END - } + DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) + DOM_CLASSINFO_MAP_END } DOM_CLASSINFO_MAP_BEGIN(WindowUtils, nsIDOMWindowUtils) @@ -2502,21 +2466,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMHistory) DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN_MAYBE_DISABLE(PerformanceTiming, nsIDOMPerformanceTiming, - !nsGlobalWindow::HasPerformanceSupport()) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMPerformanceTiming) - DOM_CLASSINFO_MAP_END - - DOM_CLASSINFO_MAP_BEGIN_MAYBE_DISABLE(PerformanceNavigation, nsIDOMPerformanceNavigation, - !nsGlobalWindow::HasPerformanceSupport()) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMPerformanceNavigation) - DOM_CLASSINFO_MAP_END - - DOM_CLASSINFO_MAP_BEGIN_MAYBE_DISABLE(Performance, nsIDOMPerformance, - !nsGlobalWindow::HasPerformanceSupport()) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMPerformance) - DOM_CLASSINFO_MAP_END - DOM_CLASSINFO_MAP_BEGIN(Screen, nsIDOMScreen) DOM_CLASSINFO_MAP_ENTRY(nsIDOMScreen) DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index 27ad290163e..62030ec8576 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -45,9 +45,6 @@ DOMCI_CLASS(MimeType) DOMCI_CLASS(MimeTypeArray) DOMCI_CLASS(BarProp) DOMCI_CLASS(History) -DOMCI_CLASS(PerformanceTiming) -DOMCI_CLASS(PerformanceNavigation) -DOMCI_CLASS(Performance) DOMCI_CLASS(Screen) DOMCI_CLASS(DOMPrototype) DOMCI_CLASS(DOMConstructor) diff --git a/dom/base/nsDOMNavigationTiming.cpp b/dom/base/nsDOMNavigationTiming.cpp deleted file mode 100644 index 840c64053f7..00000000000 --- a/dom/base/nsDOMNavigationTiming.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (lots of improvements) - * - * 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 "nsDOMNavigationTiming.h" -#include "nsCOMPtr.h" -#include "nscore.h" -#include "TimeStamp.h" -#include "nsContentUtils.h" - -#include "nsIDOMEventTarget.h" -#include "nsIDocument.h" -#include "nsIScriptSecurityManager.h" - -nsDOMNavigationTiming::nsDOMNavigationTiming() -{ - Clear(); -} - -nsDOMNavigationTiming::~nsDOMNavigationTiming() -{ -} - -void -nsDOMNavigationTiming::Clear() -{ - mNavigationType = nsIDOMPerformanceNavigation::TYPE_RESERVED; - mNavigationStart = 0; - mFetchStart = 0; - mRedirectStart = 0; - mRedirectEnd = 0; - mBeforeUnloadStart = 0; - mUnloadStart = 0; - mUnloadEnd = 0; - mLoadEventStart = 0; - mLoadEventEnd = 0; - mDOMLoading = 0; - mDOMInteractive = 0; - mDOMContentLoadedEventStart = 0; - mDOMContentLoadedEventEnd = 0; - mDOMComplete = 0; - mRedirectCheck = NOT_CHECKED; -} - -DOMTimeMilliSec nsDOMNavigationTiming::DurationFromStart(){ - mozilla::TimeDuration duration = mozilla::TimeStamp::Now() - mNavigationStartTimeStamp; - return mNavigationStart + (int)(duration.ToMilliseconds() + 0.5); -} - -void -nsDOMNavigationTiming::NotifyNavigationStart() -{ - mNavigationStart = PR_Now() / PR_USEC_PER_MSEC; - mNavigationStartTimeStamp = mozilla::TimeStamp::Now(); -} - -void -nsDOMNavigationTiming::NotifyFetchStart(nsIURI* aURI, nsDOMPerformanceNavigationType aNavigationType) -{ - mFetchStart = DurationFromStart(); - mNavigationType = aNavigationType; - // At the unload event time we don't really know the loading uri. - // Need it for later check for unload timing access. - mLoadedURI = aURI; -} - -void -nsDOMNavigationTiming::NotifyRedirect(nsIURI* aOldURI, nsIURI* aNewURI) -{ - if (mRedirects.Count() == 0) { - mRedirectStart = mFetchStart; - } - mFetchStart = DurationFromStart(); - mRedirectEnd = mFetchStart; - - // At the unload event time we don't really know the loading uri. - // Need it for later check for unload timing access. - mLoadedURI = aNewURI; - - mRedirects.AppendObject(aOldURI); -} - -void -nsDOMNavigationTiming::NotifyBeforeUnload() -{ - mBeforeUnloadStart = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyUnloadAccepted(nsIURI* aOldURI) -{ - mUnloadStart = mBeforeUnloadStart; - mUnloadedURI = aOldURI; -} - -void -nsDOMNavigationTiming::NotifyUnloadEventStart() -{ - mUnloadStart = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyUnloadEventEnd() -{ - mUnloadEnd = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyLoadEventStart() -{ - mLoadEventStart = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyLoadEventEnd() -{ - mLoadEventEnd = DurationFromStart(); -} - -PRBool -nsDOMNavigationTiming::ReportRedirects() -{ - if (mRedirectCheck == NOT_CHECKED) { - if (mRedirects.Count() == 0) { - mRedirectCheck = NO_REDIRECTS; - } else { - mRedirectCheck = CHECK_PASSED; - nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); - for (int i = mRedirects.Count() - 1; i >= 0; --i) { - nsIURI * curr = mRedirects[i]; - nsresult rv = ssm->CheckSameOriginURI(curr, mLoadedURI, PR_FALSE); - if (!NS_SUCCEEDED(rv)) { - mRedirectCheck = CHECK_FAILED; - break; - } - } - // All we need to know is in mRedirectCheck now. Clear history. - mRedirects.Clear(); - } - } - return mRedirectCheck == CHECK_PASSED; -} - -void -nsDOMNavigationTiming::SetDOMLoadingTimeStamp(nsIURI* aURI, mozilla::TimeStamp aValue) -{ - mLoadedURI = aURI; - mozilla::TimeDuration duration = aValue - mNavigationStartTimeStamp; - mDOMLoading = mNavigationStart + (int)(duration.ToMilliseconds() + 0.5); -} - -void -nsDOMNavigationTiming::NotifyDOMLoading(nsIURI* aURI) -{ - mLoadedURI = aURI; - mDOMLoading = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyDOMInteractive(nsIURI* aURI) -{ - mLoadedURI = aURI; - mDOMInteractive = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyDOMComplete(nsIURI* aURI) -{ - mLoadedURI = aURI; - mDOMComplete = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyDOMContentLoadedStart(nsIURI* aURI) -{ - mLoadedURI = aURI; - mDOMContentLoadedEventStart = DurationFromStart(); -} - -void -nsDOMNavigationTiming::NotifyDOMContentLoadedEnd(nsIURI* aURI) -{ - mLoadedURI = aURI; - mDOMContentLoadedEventEnd = DurationFromStart(); -} - - -NS_IMPL_ADDREF(nsDOMNavigationTiming) -NS_IMPL_RELEASE(nsDOMNavigationTiming) - -// QueryInterface implementation for nsDOMNavigationTiming -NS_INTERFACE_MAP_BEGIN(nsDOMNavigationTiming) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMPerformanceTiming) - NS_INTERFACE_MAP_ENTRY(nsIDOMPerformanceTiming) - NS_INTERFACE_MAP_ENTRY(nsIDOMPerformanceNavigation) -NS_INTERFACE_MAP_END - -NS_IMETHODIMP -nsDOMNavigationTiming::GetType( - nsDOMPerformanceNavigationType* aNavigationType) -{ - *aNavigationType = mNavigationType; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetRedirectCount(PRUint16* aRedirectCount) -{ - *aRedirectCount = 0; - if (ReportRedirects()) { - *aRedirectCount = mRedirects.Count(); - } - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetRedirectStart(DOMTimeMilliSec* aRedirectStart) -{ - *aRedirectStart = 0; - if (ReportRedirects()) { - *aRedirectStart = mRedirectStart; - } - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetRedirectEnd(DOMTimeMilliSec* aEnd) -{ - *aEnd = 0; - if (ReportRedirects()) { - *aEnd = mRedirectEnd; - } - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetNavigationStart(DOMTimeMilliSec* aNavigationStart) -{ - *aNavigationStart = mNavigationStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetUnloadEventStart(DOMTimeMilliSec* aStart) -{ - *aStart = 0; - nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); - nsresult rv = ssm->CheckSameOriginURI(mLoadedURI, mUnloadedURI, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - *aStart = mUnloadStart; - } - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetUnloadEventEnd(DOMTimeMilliSec* aEnd) -{ - *aEnd = 0; - nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); - nsresult rv = ssm->CheckSameOriginURI(mLoadedURI, mUnloadedURI, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - *aEnd = mUnloadEnd; - } - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetFetchStart(DOMTimeMilliSec* aStart) -{ - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomainLookupStart(DOMTimeMilliSec* aStart) -{ - // TODO: Implement me! (bug 659126) - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomainLookupEnd(DOMTimeMilliSec* aEnd) -{ - // TODO: Implement me! (bug 659126) - *aEnd = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetConnectStart(DOMTimeMilliSec* aStart) -{ - // TODO: Implement me! (bug 659126) - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetConnectEnd(DOMTimeMilliSec* aEnd) -{ - // TODO: Implement me! (bug 659126) - *aEnd = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetHandshakeStart(DOMTimeMilliSec* aStart) -{ - // TODO: Implement me! (bug 659126) - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetRequestStart(DOMTimeMilliSec* aStart) -{ - // TODO: Implement me! (bug 659126) - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetResponseStart(DOMTimeMilliSec* aStart) -{ - // TODO: Implement me! (bug 659126) - *aStart = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetResponseEnd(DOMTimeMilliSec* aEnd) -{ - // TODO: Implement me! (bug 659126) - *aEnd = mFetchStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomLoading(DOMTimeMilliSec* aTime) -{ - *aTime = mDOMLoading; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomInteractive(DOMTimeMilliSec* aTime) -{ - *aTime = mDOMInteractive; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomContentLoadedEventStart(DOMTimeMilliSec* aStart) -{ - *aStart = mDOMContentLoadedEventStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomContentLoadedEventEnd(DOMTimeMilliSec* aEnd) -{ - *aEnd = mDOMContentLoadedEventEnd; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetDomComplete(DOMTimeMilliSec* aTime) -{ - *aTime = mDOMComplete; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetLoadEventStart(DOMTimeMilliSec* aStart) -{ - *aStart = mLoadEventStart; - return NS_OK; -} - -NS_IMETHODIMP -nsDOMNavigationTiming::GetLoadEventEnd(DOMTimeMilliSec* aEnd) -{ - *aEnd = mLoadEventEnd; - return NS_OK; -} diff --git a/dom/base/nsDOMNavigationTiming.h b/dom/base/nsDOMNavigationTiming.h deleted file mode 100644 index 4fd3679c3ea..00000000000 --- a/dom/base/nsDOMNavigationTiming.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (lots of improvements) - * - * 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 ***** */ - -#ifndef nsDOMNavigationTiming_h___ -#define nsDOMNavigationTiming_h___ - -#include "nsIDOMPerformanceTiming.h" -#include "nsIDOMPerformanceNavigation.h" -#include "nscore.h" -#include "nsCOMPtr.h" -#include "nsCOMArray.h" -#include "TimeStamp.h" - -class nsDOMNavigationTimingClock; -class nsIURI; -class nsIDocument; - -class nsDOMNavigationTiming : public nsIDOMPerformanceTiming, - public nsIDOMPerformanceNavigation -{ -public: - nsDOMNavigationTiming(); - - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMPERFORMANCETIMING - NS_DECL_NSIDOMPERFORMANCENAVIGATION - - void NotifyNavigationStart(); - void NotifyFetchStart(nsIURI* aURI, nsDOMPerformanceNavigationType aNavigationType); - void NotifyRedirect(nsIURI* aOldURI, nsIURI* aNewURI); - void NotifyBeforeUnload(); - void NotifyUnloadAccepted(nsIURI* aOldURI); - void NotifyUnloadEventStart(); - void NotifyUnloadEventEnd(); - void NotifyLoadEventStart(); - void NotifyLoadEventEnd(); - - // Document changes state to 'loading' before connecting to timing - void SetDOMLoadingTimeStamp(nsIURI* aURI, mozilla::TimeStamp aValue); - void NotifyDOMLoading(nsIURI* aURI); - void NotifyDOMInteractive(nsIURI* aURI); - void NotifyDOMComplete(nsIURI* aURI); - void NotifyDOMContentLoadedStart(nsIURI* aURI); - void NotifyDOMContentLoadedEnd(nsIURI* aURI); - -private: - nsDOMNavigationTiming(const nsDOMNavigationTiming &){}; - ~nsDOMNavigationTiming(); - - void Clear(); - PRBool ReportRedirects(); - - nsCOMPtr mUnloadedURI; - nsCOMPtr mLoadedURI; - nsCOMArray mRedirects; - - typedef enum { NOT_CHECKED, - CHECK_PASSED, - NO_REDIRECTS, - CHECK_FAILED} RedirectCheckState; - RedirectCheckState mRedirectCheck; - - nsDOMPerformanceNavigationType mNavigationType; - DOMTimeMilliSec mNavigationStart; - mozilla::TimeStamp mNavigationStartTimeStamp; - DOMTimeMilliSec DurationFromStart(); - - DOMTimeMilliSec mFetchStart; - DOMTimeMilliSec mRedirectStart; - DOMTimeMilliSec mRedirectEnd; - DOMTimeMilliSec mBeforeUnloadStart; - DOMTimeMilliSec mUnloadStart; - DOMTimeMilliSec mUnloadEnd; - DOMTimeMilliSec mNavigationEnd; - DOMTimeMilliSec mLoadEventStart; - DOMTimeMilliSec mLoadEventEnd; - - DOMTimeMilliSec mDOMLoading; - DOMTimeMilliSec mDOMInteractive; - DOMTimeMilliSec mDOMContentLoadedEventStart; - DOMTimeMilliSec mDOMContentLoadedEventEnd; - DOMTimeMilliSec mDOMComplete; -}; - -#endif /* nsDOMNavigationTiming_h___ */ diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 488ed70bdb4..0723fab9dc8 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -52,8 +52,6 @@ #include "nsGlobalWindow.h" #include "nsScreen.h" #include "nsHistory.h" -#include "nsPerformance.h" -#include "nsDOMNavigationTiming.h" #include "nsBarProps.h" #include "nsDOMStorage.h" #include "nsDOMOfflineResourceList.h" @@ -1119,7 +1117,6 @@ nsGlobalWindow::CleanUp(PRBool aIgnoreModalDialog) mIndexedDB = nsnull; mPendingStorageEventsObsolete = nsnull; - mPerformance = nsnull; ClearControllers(); @@ -1344,7 +1341,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor) NS_INTERFACE_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) - NS_INTERFACE_MAP_ENTRY(nsIDOMWindowPerformance) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Window) OUTER_WINDOW_ONLY NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY @@ -2724,6 +2720,7 @@ nsGlobalWindow::PostHandleEvent(nsEventChainPostVisitor& aVisitor) // be a pres context available). Since we're not firing a GUI // event we don't need a pres context anyway so we just pass // null as the pres context all the time here. + nsEventDispatcher::Dispatch(content, nsnull, &event, nsnull, &status); } } @@ -2953,25 +2950,6 @@ nsGlobalWindow::GetHistory(nsIDOMHistory** aHistory) return NS_OK; } -NS_IMETHODIMP -nsGlobalWindow::GetPerformance(nsIDOMPerformance** aPerformance) -{ - FORWARD_TO_INNER(GetPerformance, (aPerformance), NS_ERROR_NOT_INITIALIZED); - - *aPerformance = nsnull; - - if (nsGlobalWindow::HasPerformanceSupport()) { - if (!mPerformance) { - nsRefPtr timing = mDoc->GetNavigationTiming(); - if (timing) { - mPerformance = new nsPerformance(timing); - } - } - NS_IF_ADDREF(*aPerformance = mPerformance); - } - return NS_OK; -} - NS_IMETHODIMP nsGlobalWindow::GetParent(nsIDOMWindow** aParent) { diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 1063944e45c..360d0c445d3 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -138,7 +138,6 @@ class nsLocation; class nsNavigator; class nsScreen; class nsHistory; -class nsPerformance; class nsIDocShellLoadInfo; class WindowStateHolder; class nsGlobalWindowObserver; @@ -286,8 +285,7 @@ class nsGlobalWindow : public nsPIDOMWindow, public nsIInterfaceRequestor, public nsIDOMWindow_2_0_BRANCH, public nsWrapperCache, - public PRCListStr, - public nsIDOMWindowPerformance + public PRCListStr { public: friend class nsDOMMozURLProperty; @@ -335,9 +333,6 @@ public: // nsIDOMWindowInternal NS_DECL_NSIDOMWINDOWINTERNAL - // nsIDOMWindowPerformance - NS_DECL_NSIDOMWINDOWPERFORMANCE - // nsIDOMJSWindow NS_DECL_NSIDOMJSWINDOW @@ -577,14 +572,6 @@ public: return nsContentUtils::GetBoolPref("indexedDB.feature.enabled", PR_TRUE); } - static bool HasPerformanceSupport() { -#ifdef DEBUG - return nsContentUtils::GetBoolPref("dom.enable_performance", PR_TRUE); -#else - return nsContentUtils::GetBoolPref("dom.enable_performance", PR_FALSE); -#endif - } - private: // Enable updates for the accelerometer. void EnableAccelerationUpdates(); @@ -919,7 +906,6 @@ protected: nsCOMPtr mArgumentsOrigin; nsRefPtr mNavigator; nsRefPtr mScreen; - nsRefPtr mPerformance; nsRefPtr mFrames; nsRefPtr mMenubar; nsRefPtr mToolbar; diff --git a/dom/base/nsPerformance.cpp b/dom/base/nsPerformance.cpp deleted file mode 100644 index b6b4f7469d7..00000000000 --- a/dom/base/nsPerformance.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (update to match bearly-final spec) - * - * 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 "nsPerformance.h" -#include "nsCOMPtr.h" -#include "nscore.h" -#include "nsIDocShell.h" -#include "nsDOMClassInfo.h" -#include "nsDOMNavigationTiming.h" - -DOMCI_DATA(PerformanceTiming, nsPerformanceTiming) - -NS_IMPL_ADDREF(nsPerformanceTiming) -NS_IMPL_RELEASE(nsPerformanceTiming) - -// QueryInterface implementation for nsPerformanceTiming -NS_INTERFACE_MAP_BEGIN(nsPerformanceTiming) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMPerformanceTiming) - NS_INTERFACE_MAP_ENTRY(nsIDOMPerformanceTiming) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(PerformanceTiming) -NS_INTERFACE_MAP_END - -nsPerformanceTiming::nsPerformanceTiming(nsDOMNavigationTiming* aData) -{ - NS_ASSERTION(aData, "Timing data should be provided"); - mData = aData; -} - -nsPerformanceTiming::~nsPerformanceTiming() -{ -} - -NS_IMETHODIMP -nsPerformanceTiming::GetNavigationStart(DOMTimeMilliSec* aTime) -{ - return mData->GetNavigationStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetUnloadEventStart(DOMTimeMilliSec* aTime) -{ - return mData->GetUnloadEventStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetUnloadEventEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetUnloadEventEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetRedirectStart(DOMTimeMilliSec* aTime) -{ - return mData->GetRedirectStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetRedirectEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetRedirectEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetFetchStart(DOMTimeMilliSec* aTime) -{ - return mData->GetFetchStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomainLookupStart(DOMTimeMilliSec* aTime) -{ - return mData->GetDomainLookupStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomainLookupEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetDomainLookupEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetConnectStart(DOMTimeMilliSec* aTime) -{ - return mData->GetConnectStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetConnectEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetConnectEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetHandshakeStart(DOMTimeMilliSec* aTime) -{ - return mData->GetHandshakeStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetRequestStart(DOMTimeMilliSec* aTime) -{ - return mData->GetRequestStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetResponseStart(DOMTimeMilliSec* aTime) -{ - return mData->GetResponseStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetResponseEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetResponseEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomLoading(DOMTimeMilliSec* aTime) -{ - return mData->GetDomLoading(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomInteractive(DOMTimeMilliSec* aTime) -{ - return mData->GetDomInteractive(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomContentLoadedEventStart(DOMTimeMilliSec* aTime) -{ - return mData->GetDomContentLoadedEventStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomContentLoadedEventEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetDomContentLoadedEventEnd(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetDomComplete(DOMTimeMilliSec* aTime) -{ - return mData->GetDomComplete(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetLoadEventStart(DOMTimeMilliSec* aTime) -{ - return mData->GetLoadEventStart(aTime); -} - -NS_IMETHODIMP -nsPerformanceTiming::GetLoadEventEnd(DOMTimeMilliSec* aTime) -{ - return mData->GetLoadEventEnd(aTime); -} - - - -DOMCI_DATA(PerformanceNavigation, nsPerformanceNavigation) - -NS_IMPL_ADDREF(nsPerformanceNavigation) -NS_IMPL_RELEASE(nsPerformanceNavigation) - -// QueryInterface implementation for nsPerformanceNavigation -NS_INTERFACE_MAP_BEGIN(nsPerformanceNavigation) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMPerformanceNavigation) - NS_INTERFACE_MAP_ENTRY(nsIDOMPerformanceNavigation) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(PerformanceNavigation) -NS_INTERFACE_MAP_END - -nsPerformanceNavigation::nsPerformanceNavigation(nsDOMNavigationTiming* aData) -{ - NS_ASSERTION(aData, "Timing data should be provided"); - mData = aData; -} - -nsPerformanceNavigation::~nsPerformanceNavigation() -{ -} - -NS_IMETHODIMP -nsPerformanceNavigation::GetType( - nsDOMPerformanceNavigationType* aNavigationType) -{ - return mData->GetType(aNavigationType); -} - -NS_IMETHODIMP -nsPerformanceNavigation::GetRedirectCount(PRUint16* aRedirectCount) -{ - return mData->GetRedirectCount(aRedirectCount); -} - - -DOMCI_DATA(Performance, nsPerformance) - -NS_IMPL_ADDREF(nsPerformance) -NS_IMPL_RELEASE(nsPerformance) - -nsPerformance::nsPerformance(nsDOMNavigationTiming* aTiming) -{ - NS_ASSERTION(aTiming, "Timing data should be provided"); - mData = aTiming; -} - -nsPerformance::~nsPerformance() -{ -} - -// QueryInterface implementation for nsPerformance -NS_INTERFACE_MAP_BEGIN(nsPerformance) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMPerformance) - NS_INTERFACE_MAP_ENTRY(nsIDOMPerformance) - NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Performance) -NS_INTERFACE_MAP_END - -// -// nsIDOMPerformance methods -// -NS_IMETHODIMP -nsPerformance::GetTiming(nsIDOMPerformanceTiming** aTiming) -{ - if (!mTiming) { - mTiming = new nsPerformanceTiming(mData); - } - NS_IF_ADDREF(*aTiming = mTiming); - return NS_OK; -} - -NS_IMETHODIMP -nsPerformance::GetNavigation(nsIDOMPerformanceNavigation** aNavigation) -{ - if (!mNavigation) { - mNavigation = new nsPerformanceNavigation(mData); - } - NS_IF_ADDREF(*aNavigation = mNavigation); - return NS_OK; -} diff --git a/dom/base/nsPerformance.h b/dom/base/nsPerformance.h deleted file mode 100644 index be05f1a3830..00000000000 --- a/dom/base/nsPerformance.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (update to match bearly-final spec) - * - * 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 ***** */ -#ifndef nsPerformance_h___ -#define nsPerformance_h___ - -#include "nsIDOMPerformance.h" -#include "nsIDOMPerformanceTiming.h" -#include "nsIDOMPerformanceNavigation.h" -#include "nscore.h" -#include "nsCOMPtr.h" -#include "nsAutoPtr.h" - -class nsIDocument; -class nsIURI; -class nsDOMNavigationTiming; - -// Script "performance.timing" object -class nsPerformanceTiming : public nsIDOMPerformanceTiming -{ -public: - nsPerformanceTiming(nsDOMNavigationTiming* data); - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMPERFORMANCETIMING -private: - ~nsPerformanceTiming(); - nsRefPtr mData; -}; - -// Script "performance.navigation" object -class nsPerformanceNavigation : public nsIDOMPerformanceNavigation -{ -public: - nsPerformanceNavigation(nsDOMNavigationTiming* data); - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMPERFORMANCENAVIGATION -private: - ~nsPerformanceNavigation(); - nsRefPtr mData; -}; - -// Script "performance" object -class nsPerformance : public nsIDOMPerformance -{ -public: - nsPerformance(nsDOMNavigationTiming* timing); - - NS_DECL_ISUPPORTS - NS_DECL_NSIDOMPERFORMANCE - -private: - ~nsPerformance(); - - nsRefPtr mData; - nsCOMPtr mTiming; - nsCOMPtr mNavigation; -}; - -#endif /* nsPerformance_h___ */ - diff --git a/dom/interfaces/base/Makefile.in b/dom/interfaces/base/Makefile.in index 4a2206f4b4b..07de2a633b6 100644 --- a/dom/interfaces/base/Makefile.in +++ b/dom/interfaces/base/Makefile.in @@ -88,9 +88,6 @@ XPIDLSRCS = \ nsITabParent.idl \ nsIDOMGlobalPropertyInitializer.idl \ nsIStructuredCloneContainer.idl \ - nsIDOMPerformance.idl \ - nsIDOMPerformanceTiming.idl \ - nsIDOMPerformanceNavigation.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/dom/interfaces/base/domstubs.idl b/dom/interfaces/base/domstubs.idl index 388f91a9301..1a4496dddad 100644 --- a/dom/interfaces/base/domstubs.idl +++ b/dom/interfaces/base/domstubs.idl @@ -40,7 +40,6 @@ #include "nsISupports.idl" typedef unsigned long long DOMTimeStamp; -typedef unsigned long long DOMTimeMilliSec; // Core interface nsIDOMAttr; diff --git a/dom/interfaces/base/nsIDOMPerformance.idl b/dom/interfaces/base/nsIDOMPerformance.idl deleted file mode 100644 index 242f26fd394..00000000000 --- a/dom/interfaces/base/nsIDOMPerformance.idl +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (update to match nearly-final spec) - * - * 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" -interface nsIDOMPerformanceTiming; -interface nsIDOMPerformanceNavigation; - -[scriptable, uuid(446faf26-000b-4e66-a5fd-ae37c5ed6beb)] -interface nsIDOMPerformance : nsISupports -{ - readonly attribute nsIDOMPerformanceTiming timing; - readonly attribute nsIDOMPerformanceNavigation navigation; -}; - diff --git a/dom/interfaces/base/nsIDOMPerformanceNavigation.idl b/dom/interfaces/base/nsIDOMPerformanceNavigation.idl deleted file mode 100644 index 7cb62ff9410..00000000000 --- a/dom/interfaces/base/nsIDOMPerformanceNavigation.idl +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (update to match nearly-final spec) - * - * 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 "domstubs.idl" - -typedef unsigned short nsDOMPerformanceNavigationType; - -[scriptable, uuid(a2132ad8-a841-4285-a140-338e8de6c2e0)] -interface nsIDOMPerformanceNavigation : nsISupports -{ - const nsDOMPerformanceNavigationType TYPE_NAVIGATE = 0; - const nsDOMPerformanceNavigationType TYPE_RELOAD = 1; - const nsDOMPerformanceNavigationType TYPE_BACK_FORWARD = 2; - const nsDOMPerformanceNavigationType TYPE_RESERVED = 255; - - readonly attribute nsDOMPerformanceNavigationType type; - readonly attribute unsigned short redirectCount; -}; - diff --git a/dom/interfaces/base/nsIDOMPerformanceTiming.idl b/dom/interfaces/base/nsIDOMPerformanceTiming.idl deleted file mode 100644 index d037797ed59..00000000000 --- a/dom/interfaces/base/nsIDOMPerformanceTiming.idl +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** 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 implementation of Web Timing draft specification - * http://dev.w3.org/2006/webapi/WebTiming/ - * - * The Initial Developer of the Original Code is Google Inc. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Sergey Novikov (original author) - * Igor Bazarny (update to match nearly-final spec) - * - * 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 "domstubs.idl" - -[scriptable, uuid(2a630b50-61b6-41b3-996d-70be67fbbcb0)] -interface nsIDOMPerformanceTiming : nsISupports -{ - readonly attribute DOMTimeMilliSec navigationStart; - readonly attribute DOMTimeMilliSec unloadEventStart; - readonly attribute DOMTimeMilliSec unloadEventEnd; - readonly attribute DOMTimeMilliSec redirectStart; - readonly attribute DOMTimeMilliSec redirectEnd; - readonly attribute DOMTimeMilliSec fetchStart; - readonly attribute DOMTimeMilliSec domainLookupStart; - readonly attribute DOMTimeMilliSec domainLookupEnd; - readonly attribute DOMTimeMilliSec connectStart; - readonly attribute DOMTimeMilliSec connectEnd; - readonly attribute DOMTimeMilliSec handshakeStart; - readonly attribute DOMTimeMilliSec requestStart; - readonly attribute DOMTimeMilliSec responseStart; - readonly attribute DOMTimeMilliSec responseEnd; - readonly attribute DOMTimeMilliSec domLoading; - readonly attribute DOMTimeMilliSec domInteractive; - readonly attribute DOMTimeMilliSec domContentLoadedEventStart; - readonly attribute DOMTimeMilliSec domContentLoadedEventEnd; - readonly attribute DOMTimeMilliSec domComplete; - readonly attribute DOMTimeMilliSec loadEventStart; - readonly attribute DOMTimeMilliSec loadEventEnd; -}; - diff --git a/dom/interfaces/base/nsIDOMWindowInternal.idl b/dom/interfaces/base/nsIDOMWindowInternal.idl index a0d7d79491e..4fff38d2457 100644 --- a/dom/interfaces/base/nsIDOMWindowInternal.idl +++ b/dom/interfaces/base/nsIDOMWindowInternal.idl @@ -46,12 +46,11 @@ interface nsIPrompt; interface nsIControllers; interface nsIDOMLocation; -interface nsIDOMPerformance; interface nsIVariant; interface nsIAnimationFrameListener; interface nsIDOMMediaQueryList; -[scriptable, uuid(5930f197-259e-4f6b-aeca-c96a74518cc6)] +[scriptable, uuid(3a7b0839-b9d6-42ff-8ba6-910aba60a966)] interface nsIDOMWindowInternal : nsIDOMWindow2 { readonly attribute nsIDOMWindowInternal window; @@ -257,13 +256,3 @@ interface nsIDOMWindow_2_0_BRANCH : nsISupports { readonly attribute nsIDOMMozURLProperty URL; }; - -[scriptable, uuid(2146c906-57f7-486c-a1b4-8cdb57ef577f)] -interface nsIDOMWindowPerformance : nsISupports -{ - /** - * A namespace to hold performance related data and statistics. - */ - readonly attribute nsIDOMPerformance performance; -}; - diff --git a/js/src/xpconnect/src/Makefile.in b/js/src/xpconnect/src/Makefile.in index d8db8b84769..373e52e91ca 100644 --- a/js/src/xpconnect/src/Makefile.in +++ b/js/src/xpconnect/src/Makefile.in @@ -121,7 +121,6 @@ LOCAL_INCLUDES = \ -I$(topsrcdir)/layout/style \ -I$(topsrcdir)/layout/base \ -I$(topsrcdir)/dom/base \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) EXTRA_DSO_LDOPTS += \ diff --git a/layout/base/Makefile.in b/layout/base/Makefile.in index 5f57e644510..475adfd83fe 100644 --- a/layout/base/Makefile.in +++ b/layout/base/Makefile.in @@ -165,7 +165,6 @@ LOCAL_INCLUDES += \ -I$(srcdir)/../../dom/base \ -I$(srcdir)/../../content/html/content/src \ -I$(srcdir)/../../content/svg/content/src \ - -I$(topsrcdir)/xpcom/ds \ $(NULL) ifdef MOZ_MATHML diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index b0bf3568c1a..98187a4629f 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -115,7 +115,6 @@ #include "nsIClipboardHelper.h" #include "nsPIDOMWindow.h" -#include "nsDOMNavigationTiming.h" #include "nsPIWindowRoot.h" #include "nsJSEnvironment.h" #include "nsFocusManager.h" @@ -325,11 +324,6 @@ public: */ virtual nsIView* FindContainerView(); - /** - * Set collector for navigation timing data (load, unload events). - */ - virtual void SetNavigationTiming(nsDOMNavigationTiming* timing); - // nsIContentViewerEdit NS_DECL_NSICONTENTVIEWEREDIT @@ -998,14 +992,6 @@ DocumentViewerImpl::InitInternal(nsIWidget* aParentWidget, return rv; } -void DocumentViewerImpl::SetNavigationTiming(nsDOMNavigationTiming* timing) -{ - NS_ASSERTION(mDocument, "Must have a document to set navigation timing."); - if (mDocument) { - mDocument->SetNavigationTiming(timing); - } -} - // // LoadComplete(aStatus) // @@ -1067,15 +1053,8 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus) docShell->GetRestoringDocument(&restoring); if (!restoring) { - nsRefPtr timing(mDocument->GetNavigationTiming()); - 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. diff --git a/layout/base/nsIDocumentViewer.h b/layout/base/nsIDocumentViewer.h index bce52189523..4ad5c4a6e8c 100644 --- a/layout/base/nsIDocumentViewer.h +++ b/layout/base/nsIDocumentViewer.h @@ -48,8 +48,6 @@ class nsIPresShell; class nsIStyleSheet; class nsIView; -class nsDOMNavigationTiming; - #define NS_IDOCUMENT_VIEWER_IID \ { 0x5a5c9a1d, 0x49c4, 0x4f3f, \ { 0x80, 0xcd, 0x12, 0x09, 0x5b, 0x1e, 0x1f, 0x61 } } @@ -71,8 +69,6 @@ public: PRBool aForceReuseInnerWindow) = 0; virtual nsIView* FindContainerView() = 0; - - virtual void SetNavigationTiming(nsDOMNavigationTiming* timing) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewer, NS_IDOCUMENT_VIEWER_IID)