Bug 1118417 - Mark virtual overridden functions as MOZ_OVERRIDE in parser; r=hsivonen
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 06 Jan 2015 15:11:44 -0500
changeset 250891 ac69293e8e269564f11e28e077cca2d9224ecc90
parent 250890 ef1bb856aeb2c0ccde86e0543a7c50507b914a80
child 250892 ab1e869cfc5649ba7008d38deb73acac36e6096a
push id698
push userjlund@mozilla.com
push dateMon, 23 Mar 2015 22:08:11 +0000
treeherdermozilla-release@b0c0ae7b02a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1118417
milestone37.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 1118417 - Mark virtual overridden functions as MOZ_OVERRIDE in parser; r=hsivonen
parser/html/nsHtml5DocumentBuilder.h
parser/html/nsHtml5Module.cpp
parser/html/nsHtml5Parser.cpp
parser/html/nsHtml5Parser.h
parser/html/nsHtml5StreamParser.h
parser/html/nsHtml5TreeOpExecutor.h
parser/htmlparser/nsIDTD.h
parser/htmlparser/nsITokenizer.h
parser/htmlparser/nsParser.h
parser/htmlparser/nsParserService.h
parser/xml/nsSAXXMLReader.h
--- a/parser/html/nsHtml5DocumentBuilder.h
+++ b/parser/html/nsHtml5DocumentBuilder.h
@@ -97,18 +97,18 @@ public:
   void SetDocumentMode(nsHtml5DocumentMode m);
 
   void SetNodeInfoManager(nsNodeInfoManager* aManager)
   {
     mNodeInfoManager = aManager;
   }
 
   // nsContentSink methods
-  virtual void UpdateChildCounts();
-  virtual nsresult FlushTags();
+  virtual void UpdateChildCounts() MOZ_OVERRIDE;
+  virtual nsresult FlushTags() MOZ_OVERRIDE;
 
 protected:
 
   explicit nsHtml5DocumentBuilder(bool aRunsToCompletion);
   virtual ~nsHtml5DocumentBuilder();
 
 protected:
   nsAutoTArray<nsCOMPtr<nsIContent>, 32> mOwnedElements;
--- a/parser/html/nsHtml5Module.cpp
+++ b/parser/html/nsHtml5Module.cpp
@@ -87,17 +87,17 @@ nsHtml5Module::Initialize(nsIParser* aPa
 
 class nsHtml5ParserThreadTerminator MOZ_FINAL : public nsIObserver
 {
   public:
     NS_DECL_ISUPPORTS
     explicit nsHtml5ParserThreadTerminator(nsIThread* aThread)
       : mThread(aThread)
     {}
-    NS_IMETHODIMP Observe(nsISupports *, const char *topic, const char16_t *)
+    NS_IMETHODIMP Observe(nsISupports *, const char *topic, const char16_t *) MOZ_OVERRIDE
     {
       NS_ASSERTION(!strcmp(topic, "xpcom-shutdown-threads"), 
                    "Unexpected topic");
       if (mThread) {
         mThread->Shutdown();
         mThread = nullptr;
       }
       return NS_OK;
--- a/parser/html/nsHtml5Parser.cpp
+++ b/parser/html/nsHtml5Parser.cpp
@@ -183,17 +183,17 @@ nsHtml5Parser::Parse(nsIURI* aURL,
                   "Can't call this Parse() variant on script-created parser");
   GetStreamParser()->SetObserver(aObserver);
   GetStreamParser()->SetViewSourceTitle(aURL); // In case we're viewing source
   mExecutor->SetStreamParser(GetStreamParser());
   mExecutor->SetParser(this);
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 nsHtml5Parser::Parse(const nsAString& aSourceBuffer,
                      void* aKey,
                      const nsACString& aContentType,
                      bool aLastCall,
                      nsDTDMode aMode) // ignored
 {
   nsresult rv;
   if (NS_FAILED(rv = mExecutor->IsBroken())) {
@@ -531,24 +531,16 @@ nsHtml5Parser::CancelParsingEvents()
 
 void
 nsHtml5Parser::Reset()
 {
   NS_NOTREACHED("Don't call this!");
 }
 
 bool
-nsHtml5Parser::CanInterrupt()
-{
-  // nsContentSink needs this to let nsContentSink::DidProcessATokenImpl
-  // interrupt.
-  return true;
-}
-
-bool
 nsHtml5Parser::IsInsertionPointDefined()
 {
   return !mExecutor->IsFlushing() &&
     (!GetStreamParser() || mParserInsertedScriptsBeingEvaluated);
 }
 
 void
 nsHtml5Parser::BeginEvaluatingParserInsertedScript()
--- a/parser/html/nsHtml5Parser.h
+++ b/parser/html/nsHtml5Parser.h
@@ -37,189 +37,184 @@ class nsHtml5Parser MOZ_FINAL : public n
     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHtml5Parser, nsIParser)
 
     nsHtml5Parser();
 
     /* Start nsIParser */
     /**
      * No-op for backwards compat.
      */
-    NS_IMETHOD_(void) SetContentSink(nsIContentSink* aSink);
+    NS_IMETHOD_(void) SetContentSink(nsIContentSink* aSink) MOZ_OVERRIDE;
 
     /**
      * Returns the tree op executor for backwards compat.
      */
-    NS_IMETHOD_(nsIContentSink*) GetContentSink();
+    NS_IMETHOD_(nsIContentSink*) GetContentSink() MOZ_OVERRIDE;
 
     /**
      * Always returns "view" for backwards compat.
      */
-    NS_IMETHOD_(void) GetCommand(nsCString& aCommand);
+    NS_IMETHOD_(void) GetCommand(nsCString& aCommand) MOZ_OVERRIDE;
 
     /**
      * No-op for backwards compat.
      */
-    NS_IMETHOD_(void) SetCommand(const char* aCommand);
+    NS_IMETHOD_(void) SetCommand(const char* aCommand) MOZ_OVERRIDE;
 
     /**
      * No-op for backwards compat.
      */
-    NS_IMETHOD_(void) SetCommand(eParserCommands aParserCommand);
+    NS_IMETHOD_(void) SetCommand(eParserCommands aParserCommand) MOZ_OVERRIDE;
 
     /**
      *  Call this method once you've created a parser, and want to instruct it
      *  about what charset to load
      *
      *  @param   aCharset the charset of a document
      *  @param   aCharsetSource the source of the charset
      */
-    NS_IMETHOD_(void) SetDocumentCharset(const nsACString& aCharset, int32_t aSource);
+    NS_IMETHOD_(void) SetDocumentCharset(const nsACString& aCharset, int32_t aSource) MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    NS_IMETHOD_(void) GetDocumentCharset(nsACString& aCharset, int32_t& aSource)
+    NS_IMETHOD_(void) GetDocumentCharset(nsACString& aCharset, int32_t& aSource) MOZ_OVERRIDE
     {
       NS_NOTREACHED("No one should call this.");
     }
 
     /**
      * Get the channel associated with this parser
      * @param aChannel out param that will contain the result
      * @return NS_OK if successful or NS_NOT_AVAILABLE if not
      */
-    NS_IMETHOD GetChannel(nsIChannel** aChannel);
+    NS_IMETHOD GetChannel(nsIChannel** aChannel) MOZ_OVERRIDE;
 
     /**
      * Return |this| for backwards compat.
      */
-    NS_IMETHOD GetDTD(nsIDTD** aDTD);
+    NS_IMETHOD GetDTD(nsIDTD** aDTD) MOZ_OVERRIDE;
 
     /**
      * Get the stream parser for this parser
      */
-    virtual nsIStreamListener* GetStreamListener();
+    virtual nsIStreamListener* GetStreamListener() MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    NS_IMETHOD ContinueInterruptedParsing();
+    NS_IMETHOD ContinueInterruptedParsing() MOZ_OVERRIDE;
 
     /**
      * Blocks the parser.
      */
-    NS_IMETHOD_(void) BlockParser();
+    NS_IMETHOD_(void) BlockParser() MOZ_OVERRIDE;
 
     /**
      * Unblocks the parser.
      */
-    NS_IMETHOD_(void) UnblockParser();
+    NS_IMETHOD_(void) UnblockParser() MOZ_OVERRIDE;
 
     /**
      * Asynchronously continues parsing.
      */
-    NS_IMETHOD_(void) ContinueInterruptedParsingAsync();
+    NS_IMETHOD_(void) ContinueInterruptedParsingAsync() MOZ_OVERRIDE;
 
     /**
      * Query whether the parser is enabled (i.e. not blocked) or not.
      */
-    NS_IMETHOD_(bool) IsParserEnabled();
+    NS_IMETHOD_(bool) IsParserEnabled() MOZ_OVERRIDE;
 
     /**
      * Query whether the parser thinks it's done with parsing.
      */
-    NS_IMETHOD_(bool) IsComplete();
+    NS_IMETHOD_(bool) IsComplete() MOZ_OVERRIDE;
 
     /**
      * Set up request observer.
      *
      * @param   aURL used for View Source title
      * @param   aListener a listener to forward notifications to
      * @param   aKey the root context key (used for document.write)
      * @param   aMode ignored (for interface compat only)
      */
     NS_IMETHOD Parse(nsIURI* aURL,
                      nsIRequestObserver* aListener = nullptr,
                      void* aKey = 0,
-                     nsDTDMode aMode = eDTDMode_autodetect);
+                     nsDTDMode aMode = eDTDMode_autodetect) MOZ_OVERRIDE;
 
     /**
      * document.write and document.close
      *
      * @param   aSourceBuffer the argument of document.write (empty for .close())
      * @param   aKey a key unique to the script element that caused this call
      * @param   aContentType "text/html" for HTML mode, else text/plain mode
      * @param   aLastCall true if .close() false if .write()
      * @param   aMode ignored (for interface compat only)
      */
-    NS_IMETHOD Parse(const nsAString& aSourceBuffer,
-                     void* aKey,
-                     const nsACString& aContentType,
-                     bool aLastCall,
-                     nsDTDMode aMode = eDTDMode_autodetect);
+    nsresult Parse(const nsAString& aSourceBuffer,
+                   void* aKey,
+                   const nsACString& aContentType,
+                   bool aLastCall,
+                   nsDTDMode aMode = eDTDMode_autodetect);
 
     /**
      * Stops the parser prematurely
      */
-    NS_IMETHOD Terminate();
+    NS_IMETHOD Terminate() MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface backwards compat only.
      */
     NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
-                             nsTArray<nsString>& aTagStack);
+                             nsTArray<nsString>& aTagStack) MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    NS_IMETHOD BuildModel();
+    NS_IMETHOD BuildModel() MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    NS_IMETHODIMP CancelParsingEvents();
+    NS_IMETHODIMP CancelParsingEvents() MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    virtual void Reset();
-    
-    /**
-     * True in fragment mode and during synchronous document.write
-     */
-    virtual bool CanInterrupt();
+    virtual void Reset() MOZ_OVERRIDE;
 
     /**
      * True if the insertion point (per HTML5) is defined.
      */
-    virtual bool IsInsertionPointDefined();
+    virtual bool IsInsertionPointDefined() MOZ_OVERRIDE;
 
     /**
      * Call immediately before starting to evaluate a parser-inserted script.
      */
-    virtual void BeginEvaluatingParserInsertedScript();
+    virtual void BeginEvaluatingParserInsertedScript() MOZ_OVERRIDE;
 
     /**
      * Call immediately after having evaluated a parser-inserted script.
      */
-    virtual void EndEvaluatingParserInsertedScript();
+    virtual void EndEvaluatingParserInsertedScript() MOZ_OVERRIDE;
 
     /**
      * Marks the HTML5 parser as not a script-created parser: Prepares the 
      * parser to be able to read a stream.
      *
      * @param aCommand the parser command (Yeah, this is bad API design. Let's
      * make this better when retiring nsIParser)
      */
-    virtual void MarkAsNotScriptCreated(const char* aCommand);
+    virtual void MarkAsNotScriptCreated(const char* aCommand) MOZ_OVERRIDE;
 
     /**
      * True if this is a script-created HTML5 parser.
      */
-    virtual bool IsScriptCreated();
+    virtual bool IsScriptCreated() MOZ_OVERRIDE;
 
     /* End nsIParser  */
 
     // Not from an external interface
     // Non-inherited methods
 
   public:
 
--- a/parser/html/nsHtml5StreamParser.h
+++ b/parser/html/nsHtml5StreamParser.h
@@ -132,17 +132,17 @@ class nsHtml5StreamParser : public nsICh
     nsresult OnStopRequest(nsIRequest* aRequest,
                            nsISupports* aContext,
                            nsresult status);
 
     // nsICharsetDetectionObserver
     /**
      * Chardet calls this to report the detection result
      */
-    NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf);
+    NS_IMETHOD Notify(const char* aCharset, nsDetectionConfident aConf) MOZ_OVERRIDE;
 
     // EncodingDeclarationHandler
     // http://hg.mozilla.org/projects/htmlparser/file/tip/src/nu/validator/htmlparser/common/EncodingDeclarationHandler.java
     /**
      * Tree builder uses this to report a late <meta charset>
      */
     bool internalEncodingDeclaration(nsString* aEncoding);
 
--- a/parser/html/nsHtml5TreeOpExecutor.h
+++ b/parser/html/nsHtml5TreeOpExecutor.h
@@ -104,86 +104,80 @@ class nsHtml5TreeOpExecutor MOZ_FINAL : 
 
   public:
 
     // nsIContentSink
 
     /**
      * Unimplemented. For interface compat only.
      */
-    NS_IMETHOD WillParse();
+    NS_IMETHOD WillParse() MOZ_OVERRIDE;
 
     /**
      * 
      */
-    NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode);
+    NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode) MOZ_OVERRIDE;
 
     /**
      * Emits EOF.
      */
-    NS_IMETHOD DidBuildModel(bool aTerminated);
+    NS_IMETHOD DidBuildModel(bool aTerminated) MOZ_OVERRIDE;
 
     /**
      * Forwards to nsContentSink
      */
-    NS_IMETHOD WillInterrupt();
+    NS_IMETHOD WillInterrupt() MOZ_OVERRIDE;
 
     /**
      * Unimplemented. For interface compat only.
      */
-    NS_IMETHOD WillResume();
+    NS_IMETHOD WillResume() MOZ_OVERRIDE;
 
     /**
      * Sets the parser.
      */
-    NS_IMETHOD SetParser(nsParserBase* aParser);
+    NS_IMETHOD SetParser(nsParserBase* aParser) MOZ_OVERRIDE;
 
     /**
      * No-op for backwards compat.
      */
-    virtual void FlushPendingNotifications(mozFlushType aType);
+    virtual void FlushPendingNotifications(mozFlushType aType) MOZ_OVERRIDE;
 
     /**
      * Don't call. For interface compat only.
      */
-    NS_IMETHOD SetDocumentCharset(nsACString& aCharset) {
+    NS_IMETHOD SetDocumentCharset(nsACString& aCharset) MOZ_OVERRIDE {
     	NS_NOTREACHED("No one should call this.");
     	return NS_ERROR_NOT_IMPLEMENTED;
     }
 
     /**
      * Returns the document.
      */
-    virtual nsISupports *GetTarget();
+    virtual nsISupports *GetTarget() MOZ_OVERRIDE;
   
-    virtual void ContinueInterruptedParsingAsync();
- 
-    // XXX Does anyone need this?
-    nsIDocShell* GetDocShell()
-    {
-      return mDocShell;
-    }
+    virtual void ContinueInterruptedParsingAsync() MOZ_OVERRIDE;
 
-    bool IsScriptExecuting()
+    bool IsScriptExecuting() MOZ_OVERRIDE
     {
       return IsScriptExecutingImpl();
     }
 
     // Not from interface
 
     void SetStreamParser(nsHtml5StreamParser* aStreamParser)
     {
       mStreamParser = aStreamParser;
     }
     
     void InitializeDocWriteParserState(nsAHtml5TreeBuilderState* aState, int32_t aLine);
 
     bool IsScriptEnabled();
 
-    virtual nsresult MarkAsBroken(nsresult aReason);
+    virtual nsresult MarkAsBroken(nsresult aReason) MOZ_OVERRIDE;
 
     void StartLayout();
     
     void FlushSpeculativeLoads();
                   
     void RunFlushLoop();
 
     nsresult FlushDocumentWrite();
@@ -225,17 +219,17 @@ class nsHtml5TreeOpExecutor MOZ_FINAL : 
 #endif
     
     void RunScript(nsIContent* aScriptElement);
     
     /**
      * Flush the operations from the tree operations from the argument
      * queue unconditionally. (This is for the main thread case.)
      */
-    virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue);
+    virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue) MOZ_OVERRIDE;
     
     nsHtml5TreeOpStage* GetStage()
     {
       return &mStage;
     }
     
     void StartReadingFromStage()
     {
--- a/parser/htmlparser/nsIDTD.h
+++ b/parser/htmlparser/nsIDTD.h
@@ -122,17 +122,17 @@ public:
      * DTD actually is using, as it may differ from aParserContext.mDTDMode.
      */
     NS_IMETHOD_(nsDTDMode) GetMode() const = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDTD, NS_IDTD_IID)
 
 #define NS_DECL_NSIDTD \
-    NS_IMETHOD WillBuildModel(  const CParserContext& aParserContext, nsITokenizer* aTokenizer, nsIContentSink* aSink);\
-    NS_IMETHOD DidBuildModel(nsresult anErrorCode);\
-    NS_IMETHOD BuildModel(nsITokenizer* aTokenizer, nsIContentSink* aSink);\
-    NS_IMETHOD_(bool) CanContain(int32_t aParent,int32_t aChild) const;\
-    NS_IMETHOD_(bool) IsContainer(int32_t aTag) const;\
-    NS_IMETHOD_(void)  Terminate();\
-    NS_IMETHOD_(int32_t) GetType();\
-    NS_IMETHOD_(nsDTDMode) GetMode() const;
+    NS_IMETHOD WillBuildModel(  const CParserContext& aParserContext, nsITokenizer* aTokenizer, nsIContentSink* aSink) MOZ_OVERRIDE;\
+    NS_IMETHOD DidBuildModel(nsresult anErrorCode) MOZ_OVERRIDE;\
+    NS_IMETHOD BuildModel(nsITokenizer* aTokenizer, nsIContentSink* aSink) MOZ_OVERRIDE;\
+    NS_IMETHOD_(bool) CanContain(int32_t aParent,int32_t aChild) const MOZ_OVERRIDE;\
+    NS_IMETHOD_(bool) IsContainer(int32_t aTag) const MOZ_OVERRIDE;\
+    NS_IMETHOD_(void)  Terminate() MOZ_OVERRIDE;\
+    NS_IMETHOD_(int32_t) GetType() MOZ_OVERRIDE;\
+    NS_IMETHOD_(nsDTDMode) GetMode() const MOZ_OVERRIDE;
 #endif /* nsIDTD_h___ */
--- a/parser/htmlparser/nsITokenizer.h
+++ b/parser/htmlparser/nsITokenizer.h
@@ -32,13 +32,13 @@ public:
 
   NS_IMETHOD                     WillTokenize(bool aIsFinalChunk)=0;
   NS_IMETHOD                     ConsumeToken(nsScanner& aScanner,bool& aFlushTokens)=0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsITokenizer, NS_ITOKENIZER_IID)
 
 #define NS_DECL_NSITOKENIZER \
-  NS_IMETHOD                     WillTokenize(bool aIsFinalChunk);\
-  NS_IMETHOD                     ConsumeToken(nsScanner& aScanner,bool& aFlushTokens);\
+  NS_IMETHOD                     WillTokenize(bool aIsFinalChunk) MOZ_OVERRIDE;\
+  NS_IMETHOD                     ConsumeToken(nsScanner& aScanner,bool& aFlushTokens) MOZ_OVERRIDE;\
 
 
 #endif
--- a/parser/htmlparser/nsParser.h
+++ b/parser/htmlparser/nsParser.h
@@ -93,103 +93,103 @@ class nsParser MOZ_FINAL : public nsIPar
     nsParser();
 
     /**
      * Select given content sink into parser for parser output
      * @update	gess5/11/98
      * @param   aSink is the new sink to be used by parser
      * @return  old sink, or nullptr
      */
-    NS_IMETHOD_(void) SetContentSink(nsIContentSink* aSink);
+    NS_IMETHOD_(void) SetContentSink(nsIContentSink* aSink) MOZ_OVERRIDE;
 
     /**
      * retrive the sink set into the parser 
      * @update	gess5/11/98
      * @param   aSink is the new sink to be used by parser
      * @return  old sink, or nullptr
      */
-    NS_IMETHOD_(nsIContentSink*) GetContentSink(void);
+    NS_IMETHOD_(nsIContentSink*) GetContentSink(void) MOZ_OVERRIDE;
     
     /**
      *  Call this method once you've created a parser, and want to instruct it
      *  about the command which caused the parser to be constructed. For example,
      *  this allows us to select a DTD which can do, say, view-source.
      *  
      *  @update  gess 3/25/98
      *  @param   aCommand -- ptrs to string that contains command
      *  @return	 nada
      */
-    NS_IMETHOD_(void) GetCommand(nsCString& aCommand);
-    NS_IMETHOD_(void) SetCommand(const char* aCommand);
-    NS_IMETHOD_(void) SetCommand(eParserCommands aParserCommand);
+    NS_IMETHOD_(void) GetCommand(nsCString& aCommand) MOZ_OVERRIDE;
+    NS_IMETHOD_(void) SetCommand(const char* aCommand) MOZ_OVERRIDE;
+    NS_IMETHOD_(void) SetCommand(eParserCommands aParserCommand) MOZ_OVERRIDE;
 
     /**
      *  Call this method once you've created a parser, and want to instruct it
      *  about what charset to load
      *  
      *  @update  ftang 4/23/99
      *  @param   aCharset- the charset of a document
      *  @param   aCharsetSource- the source of the charset
      *  @return	 nada
      */
-    NS_IMETHOD_(void) SetDocumentCharset(const nsACString& aCharset, int32_t aSource);
+    NS_IMETHOD_(void) SetDocumentCharset(const nsACString& aCharset, int32_t aSource) MOZ_OVERRIDE;
 
-    NS_IMETHOD_(void) GetDocumentCharset(nsACString& aCharset, int32_t& aSource)
+    NS_IMETHOD_(void) GetDocumentCharset(nsACString& aCharset, int32_t& aSource) MOZ_OVERRIDE
     {
          aCharset = mCharset;
          aSource = mCharsetSource;
     }
 
     /**
      * Cause parser to parse input from given URL 
      * @update	gess5/11/98
      * @param   aURL is a descriptor for source document
      * @param   aListener is a listener to forward notifications to
      * @return  TRUE if all went well -- FALSE otherwise
      */
     NS_IMETHOD Parse(nsIURI* aURL,
                      nsIRequestObserver* aListener = nullptr,
                      void* aKey = 0,
-                     nsDTDMode aMode = eDTDMode_autodetect);
+                     nsDTDMode aMode = eDTDMode_autodetect) MOZ_OVERRIDE;
 
     /**
      * This method needs documentation
      */
     NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
-                             nsTArray<nsString>& aTagStack);
+                             nsTArray<nsString>& aTagStack) MOZ_OVERRIDE;
                              
     /**
      * This method gets called when the tokens have been consumed, and it's time
      * to build the model via the content sink.
      * @update	gess5/11/98
      * @return  YES if model building went well -- NO otherwise.
      */
-    NS_IMETHOD BuildModel(void);
+    NS_IMETHOD BuildModel(void) MOZ_OVERRIDE;
 
-    NS_IMETHOD        ContinueInterruptedParsing();
-    NS_IMETHOD_(void) BlockParser();
-    NS_IMETHOD_(void) UnblockParser();
-    NS_IMETHOD_(void) ContinueInterruptedParsingAsync();
-    NS_IMETHOD        Terminate(void);
+    NS_IMETHOD        ContinueInterruptedParsing() MOZ_OVERRIDE;
+    NS_IMETHOD_(void) BlockParser() MOZ_OVERRIDE;
+    NS_IMETHOD_(void) UnblockParser() MOZ_OVERRIDE;
+    NS_IMETHOD_(void) ContinueInterruptedParsingAsync() MOZ_OVERRIDE;
+    NS_IMETHOD        Terminate(void) MOZ_OVERRIDE;
 
     /**
      * Call this to query whether the parser is enabled or not.
      *
      *  @update  vidur 4/12/99
      *  @return  current state
      */
-    NS_IMETHOD_(bool) IsParserEnabled();
+    NS_IMETHOD_(bool) IsParserEnabled() MOZ_OVERRIDE;
 
     /**
      * Call this to query whether the parser thinks it's done with parsing.
      *
      *  @update  rickg 5/12/01
      *  @return  complete state
      */
-    NS_IMETHOD_(bool) IsComplete();
+    NS_IMETHOD_(bool) IsComplete() MOZ_OVERRIDE;
 
     /**
      *  This rather arcane method (hack) is used as a signal between the
      *  DTD and the parser. It allows the DTD to tell the parser that content
      *  that comes through (parser::parser(string)) but not consumed should
      *  propagate into the next string based parse call.
      *  
      *  @update  gess 9/1/98
@@ -222,64 +222,64 @@ class nsParser MOZ_FINAL : public nsIPar
     CParserContext*   PeekContext() {return mParserContext;}
 
     /** 
      * Get the channel associated with this parser
      * @update harishd,gagan 07/17/01
      * @param aChannel out param that will contain the result
      * @return NS_OK if successful
      */
-    NS_IMETHOD GetChannel(nsIChannel** aChannel);
+    NS_IMETHOD GetChannel(nsIChannel** aChannel) MOZ_OVERRIDE;
 
     /** 
      * Get the DTD associated with this parser
      * @update vidur 9/29/99
      * @param aDTD out param that will contain the result
      * @return NS_OK if successful, NS_ERROR_FAILURE for runtime error
      */
-    NS_IMETHOD GetDTD(nsIDTD** aDTD);
+    NS_IMETHOD GetDTD(nsIDTD** aDTD) MOZ_OVERRIDE;
   
     /**
      * Get the nsIStreamListener for this parser
      */
-    virtual nsIStreamListener* GetStreamListener();
+    virtual nsIStreamListener* GetStreamListener() MOZ_OVERRIDE;
 
     void SetSinkCharset(nsACString& aCharset);
 
     /**
      *  Removes continue parsing events
      *  @update  kmcclusk 5/18/98
      */
 
-    NS_IMETHODIMP CancelParsingEvents();
+    NS_IMETHODIMP CancelParsingEvents() MOZ_OVERRIDE;
 
     /**
      * Return true.
      */
-    virtual bool IsInsertionPointDefined();
+    virtual bool IsInsertionPointDefined() MOZ_OVERRIDE;
 
     /**
      * No-op.
      */
-    virtual void BeginEvaluatingParserInsertedScript();
+    virtual void BeginEvaluatingParserInsertedScript() MOZ_OVERRIDE;
 
     /**
      * No-op.
      */
-    virtual void EndEvaluatingParserInsertedScript();
+    virtual void EndEvaluatingParserInsertedScript() MOZ_OVERRIDE;
 
     /**
      * No-op.
      */
-    virtual void MarkAsNotScriptCreated(const char* aCommand);
+    virtual void MarkAsNotScriptCreated(const char* aCommand) MOZ_OVERRIDE;
 
     /**
      * Always false.
      */
-    virtual bool IsScriptCreated();
+    virtual bool IsScriptCreated() MOZ_OVERRIDE;
 
     /**  
      *  Set to parser state to indicate whether parsing tokens can be interrupted
      *  @param aCanInterrupt true if parser can be interrupted, false if it can not be interrupted.
      *  @update  kmcclusk 5/18/98
      */
     void SetCanInterrupt(bool aCanInterrupt);
 
@@ -294,17 +294,17 @@ class nsParser MOZ_FINAL : public nsIPar
     nsresult PostContinueEvent();
 
     /**
      *  Fired when the continue parse event is triggered.
      *  @update  kmcclusk 5/18/98
      */
     void HandleParserContinueEvent(class nsParserContinueEvent *);
 
-    virtual void Reset() {
+    virtual void Reset() MOZ_OVERRIDE {
       Cleanup();
       Initialize();
     }
 
     bool IsScriptExecuting() {
       return mSink && mSink->IsScriptExecuting();
     }
 
--- a/parser/htmlparser/nsParserService.h
+++ b/parser/htmlparser/nsParserService.h
@@ -16,27 +16,27 @@ extern "C" int MOZ_XMLTranslateEntity(co
 class nsParserService : public nsIParserService {
   virtual ~nsParserService();
 
 public:
   nsParserService();
 
   NS_DECL_ISUPPORTS
 
-  int32_t HTMLAtomTagToId(nsIAtom* aAtom) const;
+  int32_t HTMLAtomTagToId(nsIAtom* aAtom) const MOZ_OVERRIDE;
 
-  int32_t HTMLCaseSensitiveAtomTagToId(nsIAtom* aAtom) const;
+  int32_t HTMLCaseSensitiveAtomTagToId(nsIAtom* aAtom) const MOZ_OVERRIDE;
 
-  int32_t HTMLStringTagToId(const nsAString& aTag) const;
+  int32_t HTMLStringTagToId(const nsAString& aTag) const MOZ_OVERRIDE;
 
-  const char16_t *HTMLIdToStringTag(int32_t aId) const;
+  const char16_t *HTMLIdToStringTag(int32_t aId) const MOZ_OVERRIDE;
   
-  nsIAtom *HTMLIdToAtomTag(int32_t aId) const;
+  nsIAtom *HTMLIdToAtomTag(int32_t aId) const MOZ_OVERRIDE;
 
   NS_IMETHOD HTMLConvertEntityToUnicode(const nsAString& aEntity, 
-                                        int32_t* aUnicode) const;
+                                        int32_t* aUnicode) const MOZ_OVERRIDE;
   NS_IMETHOD HTMLConvertUnicodeToEntity(int32_t aUnicode,
-                                        nsCString& aEntity) const;
-  NS_IMETHOD IsContainer(int32_t aId, bool& aIsContainer) const;
-  NS_IMETHOD IsBlock(int32_t aId, bool& aIsBlock) const;
+                                        nsCString& aEntity) const MOZ_OVERRIDE;
+  NS_IMETHOD IsContainer(int32_t aId, bool& aIsContainer) const MOZ_OVERRIDE;
+  NS_IMETHOD IsBlock(int32_t aId, bool& aIsBlock) const MOZ_OVERRIDE;
 };
 
 #endif
--- a/parser/xml/nsSAXXMLReader.h
+++ b/parser/xml/nsSAXXMLReader.h
@@ -36,45 +36,45 @@ public:
   NS_DECL_NSIEXTENDEDEXPATSINK
   NS_DECL_NSISAXXMLREADER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   nsSAXXMLReader();
 
   //nsIContentSink
-  NS_IMETHOD WillParse()
+  NS_IMETHOD WillParse() MOZ_OVERRIDE
   {
     return NS_OK;
   }
 
-  NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode);
-  NS_IMETHOD DidBuildModel(bool aTerminated);
-  NS_IMETHOD SetParser(nsParserBase* aParser);
+  NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode) MOZ_OVERRIDE;
+  NS_IMETHOD DidBuildModel(bool aTerminated) MOZ_OVERRIDE;
+  NS_IMETHOD SetParser(nsParserBase* aParser) MOZ_OVERRIDE;
   
-  NS_IMETHOD WillInterrupt()
+  NS_IMETHOD WillInterrupt() MOZ_OVERRIDE
   {
     return NS_OK;
   }
 
-  NS_IMETHOD WillResume()
+  NS_IMETHOD WillResume() MOZ_OVERRIDE
   {
     return NS_OK;
   }
   
-  virtual void FlushPendingNotifications(mozFlushType aType)
+  virtual void FlushPendingNotifications(mozFlushType aType) MOZ_OVERRIDE
   {
   }
   
-  NS_IMETHOD SetDocumentCharset(nsACString& aCharset)
+  NS_IMETHOD SetDocumentCharset(nsACString& aCharset) MOZ_OVERRIDE
   {
     return NS_OK;
   }
   
-  virtual nsISupports *GetTarget()
+  virtual nsISupports *GetTarget() MOZ_OVERRIDE
   {
     return nullptr;
   }
 
 private:
   ~nsSAXXMLReader() {}
 
   nsCOMPtr<nsISAXContentHandler> mContentHandler;