Bug 1446568: Move UseCounter stuff and IsSynthesized to nsIDocument. r=smaug

MozReview-Commit-ID: IeKzmi31e8d
This commit is contained in:
Emilio Cobos Álvarez 2018-03-15 19:37:02 +01:00
parent 3e33f2a705
commit 55a1729e6a
3 changed files with 18 additions and 18 deletions

View File

@ -2687,7 +2687,7 @@ WarnIfSandboxIneffective(nsIDocShell* aDocShell,
}
bool
nsDocument::IsSynthesized() {
nsIDocument::IsSynthesized() {
nsCOMPtr<nsIHttpChannelInternal> internalChan = do_QueryInterface(mChannel);
bool synthesized = false;
if (internalChan) {
@ -12250,7 +12250,7 @@ ReportExternalResourceUseCounters(nsIDocument* aDocument, void* aData)
}
void
nsDocument::ReportUseCounters(UseCounterReportKind aKind)
nsIDocument::ReportUseCounters(UseCounterReportKind aKind)
{
static const bool sDebugUseCounters = false;
if (mReportedUseCounters) {

View File

@ -206,22 +206,6 @@ public:
nsRadioGroupStruct* GetRadioGroup(const nsAString& aName) const;
nsRadioGroupStruct* GetOrCreateRadioGroup(const nsAString& aName);
enum class UseCounterReportKind {
// Flush the document's use counters only; the use counters for any
// external resource documents will be flushed when the external
// resource documents themselves are destroyed.
eDefault,
// Flush use counters for the document and for its external resource
// documents. (Should only be necessary for tests, where we need
// flushing to happen synchronously and deterministically.)
eIncludeExternalResources,
};
void ReportUseCounters(UseCounterReportKind aKind = UseCounterReportKind::eDefault);
bool IsSynthesized();
// Check whether shadow DOM is enabled for the global of aObject.
static bool IsShadowDOMEnabled(JSContext* aCx, JSObject* aObject);
// Check whether shadow DOM is enabled for the document this node belongs to.

View File

@ -3488,6 +3488,22 @@ public:
bool DidFireDOMContentLoaded() const { return mDidFireDOMContentLoaded; }
bool IsSynthesized();
enum class UseCounterReportKind {
// Flush the document's use counters only; the use counters for any
// external resource documents will be flushed when the external
// resource documents themselves are destroyed.
eDefault,
// Flush use counters for the document and for its external resource
// documents. (Should only be necessary for tests, where we need
// flushing to happen synchronously and deterministically.)
eIncludeExternalResources,
};
void ReportUseCounters(UseCounterReportKind aKind = UseCounterReportKind::eDefault);
void SetDocumentUseCounter(mozilla::UseCounter aUseCounter)
{
if (!mUseCounters[aUseCounter]) {