Bug 1444580: Devirtualize GetImplementation. r=smaug

MozReview-Commit-ID: 2nsR595RotH
This commit is contained in:
Emilio Cobos Álvarez 2018-03-10 06:18:17 +01:00
Родитель 6100eb8087
Коммит 5ffef03826
3 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -5660,7 +5660,7 @@ nsIDocument::GetDoctype() const
} }
DOMImplementation* DOMImplementation*
nsDocument::GetImplementation(ErrorResult& rv) nsIDocument::GetImplementation(ErrorResult& rv)
{ {
if (!mDOMImplementation) { if (!mDOMImplementation) {
nsCOMPtr<nsIURI> uri; nsCOMPtr<nsIURI> uri;

Просмотреть файл

@ -713,9 +713,6 @@ public:
virtual nsIDOMNode* AsDOMNode() override { return this; } virtual nsIDOMNode* AsDOMNode() override { return this; }
// WebIDL bits // WebIDL bits
virtual mozilla::dom::DOMImplementation*
GetImplementation(mozilla::ErrorResult& rv) override;
virtual already_AddRefed<Element> CreateElement(const nsAString& aTagName, virtual already_AddRefed<Element> CreateElement(const nsAString& aTagName,
const mozilla::dom::ElementCreationOptionsOrString& aOptions, const mozilla::dom::ElementCreationOptionsOrString& aOptions,
ErrorResult& rv) override; ErrorResult& rv) override;
@ -890,8 +887,6 @@ private:
// Set if we've found a URL for the current picture // Set if we've found a URL for the current picture
nsString mPreloadPictureFoundSource; nsString mPreloadPictureFoundSource;
RefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
RefPtr<nsContentList> mImageMaps; RefPtr<nsContentList> mImageMaps;
nsCString mScrollToRef; nsCString mScrollToRef;

Просмотреть файл

@ -2910,8 +2910,7 @@ public:
static already_AddRefed<nsIDocument> static already_AddRefed<nsIDocument>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,
mozilla::ErrorResult& rv); mozilla::ErrorResult& rv);
virtual mozilla::dom::DOMImplementation* mozilla::dom::DOMImplementation* GetImplementation(mozilla::ErrorResult& rv);
GetImplementation(mozilla::ErrorResult& rv) = 0;
MOZ_MUST_USE nsresult GetURL(nsString& retval) const; MOZ_MUST_USE nsresult GetURL(nsString& retval) const;
MOZ_MUST_USE nsresult GetDocumentURI(nsString& retval) const; MOZ_MUST_USE nsresult GetDocumentURI(nsString& retval) const;
// Return the URI for the document. // Return the URI for the document.
@ -4052,6 +4051,8 @@ protected:
// non-null when this document is in fullscreen mode. // non-null when this document is in fullscreen mode.
nsWeakPtr mFullscreenRoot; nsWeakPtr mFullscreenRoot;
RefPtr<mozilla::dom::DOMImplementation> mDOMImplementation;
nsTArray<RefPtr<mozilla::StyleSheet>> mOnDemandBuiltInUASheets; nsTArray<RefPtr<mozilla::StyleSheet>> mOnDemandBuiltInUASheets;
nsTArray<RefPtr<mozilla::StyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount]; nsTArray<RefPtr<mozilla::StyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount];