Bug 708888: Remove no-longer-needed SVGDocumentWrapper::kSVGAtom. r=roc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 09 Dec 2011 01:11:06 -0800
changeset 84358 1384f34c9bddf5752dd0e226559c911ba018c657
parent 84357 c2370a1dba1ddefbb3dd972f99f4fdb3fb0ea19e
child 84359 02ec94922e9631b3a12fbdac01f73a6a1b6fd986
push id114
push userffxbld
push dateFri, 09 Mar 2012 01:01:18 +0000
treeherdermozilla-release@c081ebf13261 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs708888
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 708888: Remove no-longer-needed SVGDocumentWrapper::kSVGAtom. r=roc
image/src/SVGDocumentWrapper.cpp
image/src/SVGDocumentWrapper.h
--- a/image/src/SVGDocumentWrapper.cpp
+++ b/image/src/SVGDocumentWrapper.cpp
@@ -63,34 +63,26 @@
 #include "nsSVGLength2.h"
 #include "nsSVGEffects.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace imagelib {
 
-nsIAtom* SVGDocumentWrapper::kSVGAtom = nsnull; // lazily initialized
-
 NS_IMPL_ISUPPORTS4(SVGDocumentWrapper,
                    nsIStreamListener,
                    nsIRequestObserver,
                    nsIObserver,
                    nsISupportsWeakReference)
 
 SVGDocumentWrapper::SVGDocumentWrapper()
   : mIgnoreInvalidation(false),
     mRegisteredForXPCOMShutdown(false)
 {
-  // Lazy-initialize our "svg" atom.  (It'd be nicer to just use nsGkAtoms::svg
-  // directly, but we can't access it from here in non-libxul builds.)
-  if (!SVGDocumentWrapper::kSVGAtom) {
-    SVGDocumentWrapper::kSVGAtom =
-      NS_NewPermanentAtom(NS_LITERAL_STRING("svg"));
-  }
 }
 
 SVGDocumentWrapper::~SVGDocumentWrapper()
 {
   DestroyViewer();
   if (mRegisteredForXPCOMShutdown) {
     UnregisterForXPCOMShutdown();
   }
@@ -462,17 +454,17 @@ SVGDocumentWrapper::GetRootSVGElem()
 
   nsIDocument* doc = mViewer->GetDocument();
   if (!doc)
     return nsnull; // Can happen during destruction
 
   Element* rootElem = mViewer->GetDocument()->GetRootElement();
   if (!rootElem ||
       rootElem->GetNameSpaceID() != kNameSpaceID_SVG ||
-      rootElem->Tag() != SVGDocumentWrapper::kSVGAtom) {
+      rootElem->Tag() != nsGkAtoms::svg) {
     return nsnull;
   }
 
   return static_cast<nsSVGSVGElement*>(rootElem);
 }
 
 } // namespace imagelib
 } // namespace mozilla
--- a/image/src/SVGDocumentWrapper.h
+++ b/image/src/SVGDocumentWrapper.h
@@ -178,18 +178,14 @@ private:
 
   void     FlushLayout();
 
   nsCOMPtr<nsIContentViewer>  mViewer;
   nsCOMPtr<nsILoadGroup>      mLoadGroup;
   nsCOMPtr<nsIStreamListener> mListener;
   bool                        mIgnoreInvalidation;
   bool                        mRegisteredForXPCOMShutdown;
-
-  // Lazily-initialized pointer to nsGkAtoms::svg, to make life easier in
-  // non-libxul builds, which don't let us reference nsGkAtoms from imagelib.
-  static nsIAtom* kSVGAtom;
 };
 
 } // namespace imagelib
 } // namespace mozilla
 
 #endif // mozilla_imagelib_SVGDocumentWrapper_h_