Bug 1446097. Switch to "set" as the canonical nsGkAtoms name of the string "set", so it matches the actual tag name "set" in SVG. r=hsivonen,njn
Most of the noise is from the fact that clang-format on parser/html/*.{h,cpp}
reformatted all sorts of stuff. Not running it caused lots of format changes
from the generator... I guess we changed the format rules since the last time
this got run?
MozReview-Commit-ID: IA2G87zUIKN
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsHtml5Module.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsHtml5AttributeName.h"
|
||||
#include "nsHtml5ElementName.h"
|
||||
#include "nsHtml5HtmlAttributes.h"
|
||||
@@ -11,12 +15,8 @@
|
||||
#include "nsHtml5Tokenizer.h"
|
||||
#include "nsHtml5TreeBuilder.h"
|
||||
#include "nsHtml5UTF16Buffer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@@ -77,39 +77,44 @@ nsHtml5Module::NewHtml5Parser()
|
||||
|
||||
// static
|
||||
nsresult
|
||||
nsHtml5Module::Initialize(nsIParser* aParser, nsIDocument* aDoc, nsIURI* aURI, nsISupports* aContainer, nsIChannel* aChannel)
|
||||
nsHtml5Module::Initialize(nsIParser* aParser,
|
||||
nsIDocument* aDoc,
|
||||
nsIURI* aURI,
|
||||
nsISupports* aContainer,
|
||||
nsIChannel* aChannel)
|
||||
{
|
||||
MOZ_ASSERT(sNsHtml5ModuleInitialized, "nsHtml5Module not initialized.");
|
||||
nsHtml5Parser* parser = static_cast<nsHtml5Parser*> (aParser);
|
||||
nsHtml5Parser* parser = static_cast<nsHtml5Parser*>(aParser);
|
||||
return parser->Initialize(aDoc, aURI, aContainer, aChannel);
|
||||
}
|
||||
|
||||
class nsHtml5ParserThreadTerminator final : public nsIObserver
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
explicit nsHtml5ParserThreadTerminator(nsIThread* aThread)
|
||||
: mThread(aThread)
|
||||
{}
|
||||
NS_IMETHOD Observe(nsISupports *, const char *topic, const char16_t *) override
|
||||
{
|
||||
NS_ASSERTION(!strcmp(topic, "xpcom-shutdown-threads"),
|
||||
"Unexpected topic");
|
||||
if (mThread) {
|
||||
mThread->Shutdown();
|
||||
mThread = nullptr;
|
||||
}
|
||||
return NS_OK;
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
explicit nsHtml5ParserThreadTerminator(nsIThread* aThread)
|
||||
: mThread(aThread)
|
||||
{
|
||||
}
|
||||
NS_IMETHOD Observe(nsISupports*, const char* topic, const char16_t*) override
|
||||
{
|
||||
NS_ASSERTION(!strcmp(topic, "xpcom-shutdown-threads"), "Unexpected topic");
|
||||
if (mThread) {
|
||||
mThread->Shutdown();
|
||||
mThread = nullptr;
|
||||
}
|
||||
private:
|
||||
~nsHtml5ParserThreadTerminator() {}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIThread> mThread;
|
||||
private:
|
||||
~nsHtml5ParserThreadTerminator() {}
|
||||
|
||||
nsCOMPtr<nsIThread> mThread;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsHtml5ParserThreadTerminator, nsIObserver)
|
||||
|
||||
// static
|
||||
// static
|
||||
nsIThread*
|
||||
nsHtml5Module::GetStreamParserThread()
|
||||
{
|
||||
@@ -119,7 +124,7 @@ nsHtml5Module::GetStreamParserThread()
|
||||
NS_ASSERTION(sStreamParserThread, "Thread creation failed!");
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
NS_ASSERTION(os, "do_GetService failed");
|
||||
os->AddObserver(new nsHtml5ParserThreadTerminator(sStreamParserThread),
|
||||
os->AddObserver(new nsHtml5ParserThreadTerminator(sStreamParserThread),
|
||||
"xpcom-shutdown-threads",
|
||||
false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user