From 1bb443447d6b6fcb9056bf4f85e0bcfa0ee3b54f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 28 Sep 2016 15:46:46 -0400 Subject: [PATCH] Bug 1305580 part 2. Change nsXMLDocument::Load telemetry to separately count chrome and content callers. r=smaug --- dom/base/nsDeprecatedOperationList.h | 1 + dom/xml/XMLDocument.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dom/base/nsDeprecatedOperationList.h b/dom/base/nsDeprecatedOperationList.h index fdc31d31bcb1..ae25ae375720 100644 --- a/dom/base/nsDeprecatedOperationList.h +++ b/dom/base/nsDeprecatedOperationList.h @@ -33,6 +33,7 @@ DEPRECATED_OPERATION(MozGetAsFile) DEPRECATED_OPERATION(UseOfCaptureEvents) DEPRECATED_OPERATION(UseOfReleaseEvents) DEPRECATED_OPERATION(UseOfDOM3LoadMethod) +DEPRECATED_OPERATION(ChromeUseOfDOM3LoadMethod) DEPRECATED_OPERATION(ShowModalDialog) DEPRECATED_OPERATION(Window_Content) DEPRECATED_OPERATION(SyncXMLHttpRequest) diff --git a/dom/xml/XMLDocument.cpp b/dom/xml/XMLDocument.cpp index 3c16b81e8a96..75c89568b460 100644 --- a/dom/xml/XMLDocument.cpp +++ b/dom/xml/XMLDocument.cpp @@ -277,8 +277,6 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv) return false; } - WarnOnceAbout(nsIDocument::eUseOfDOM3LoadMethod); - nsCOMPtr callingDoc = GetEntryDocument(); nsCOMPtr principal = NodePrincipal(); @@ -293,6 +291,12 @@ XMLDocument::Load(const nsAString& aUrl, ErrorResult& aRv) return false; } + if (nsContentUtils::IsCallerChrome()) { + WarnOnceAbout(nsIDocument::eChromeUseOfDOM3LoadMethod); + } else { + WarnOnceAbout(nsIDocument::eUseOfDOM3LoadMethod); + } + nsIURI *baseURI = mDocumentURI; nsAutoCString charset;