Bug 1118413 - Mark virtual overridden functions as MOZ_OVERRIDE in places; r=mak
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 06 Jan 2015 15:10:56 -0500
changeset 225574 fdefac62cd56a1ae2f1edfa08d2300b8769888bf
parent 225573 f06646cb71f120ca4fd3e8abf9ab75d04aca8fb8
child 225575 aa3aec12cc77bbbbfaa77ba434acf50ad6f95202
push id28167
push userryanvm@gmail.com
push dateSun, 25 Jan 2015 00:24:46 +0000
treeherdermozilla-central@c18776175a69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1118413
milestone38.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 1118413 - Mark virtual overridden functions as MOZ_OVERRIDE in places; r=mak
toolkit/components/places/Helpers.h
toolkit/components/places/History.cpp
toolkit/components/places/nsAnnoProtocolHandler.cpp
toolkit/components/places/nsNavBookmarks.h
toolkit/components/places/nsNavHistoryResult.h
toolkit/components/places/tests/cpp/mock_Link.h
toolkit/components/places/tests/cpp/places_test_harness.h
toolkit/components/places/tests/cpp/test_IHistory.cpp
--- a/toolkit/components/places/Helpers.h
+++ b/toolkit/components/places/Helpers.h
@@ -34,18 +34,18 @@ protected:
   virtual ~AsyncStatementCallback() {}
 };
 
 /**
  * Macros to use in place of NS_DECL_MOZISTORAGESTATEMENTCALLBACK to declare the
  * methods this class assumes silent or notreached.
  */
 #define NS_DECL_ASYNCSTATEMENTCALLBACK \
-  NS_IMETHOD HandleResult(mozIStorageResultSet *); \
-  NS_IMETHOD HandleCompletion(uint16_t);
+  NS_IMETHOD HandleResult(mozIStorageResultSet *) MOZ_OVERRIDE; \
+  NS_IMETHOD HandleCompletion(uint16_t) MOZ_OVERRIDE;
 
 /**
  * Utils to bind a specified URI (or URL) to a statement or binding params, at
  * the specified index or name.
  * @note URIs are always bound as UTF8.
  */
 class URIBinder // static
 {
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -513,45 +513,45 @@ public:
     nsresult rv = history->GetIsVisitedStatement(cb);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return NS_OK;
   }
 
   // Note: the return value matters here.  We call into this method, it's not
   // just xpcom boilerplate.
-  NS_IMETHOD Complete(nsresult aResult, nsISupports* aStatement)
+  NS_IMETHOD Complete(nsresult aResult, nsISupports* aStatement) MOZ_OVERRIDE
   {
     NS_ENSURE_SUCCESS(aResult, aResult);
     nsCOMPtr<mozIStorageAsyncStatement> stmt = do_QueryInterface(aStatement);
     NS_ENSURE_STATE(stmt);
     // Bind by index for performance.
     nsresult rv = URIBinder::Bind(stmt, 0, mURI);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<mozIStoragePendingStatement> handle;
     return stmt->ExecuteAsync(this, getter_AddRefs(handle));
   }
 
-  NS_IMETHOD HandleResult(mozIStorageResultSet* aResults)
+  NS_IMETHOD HandleResult(mozIStorageResultSet* aResults) MOZ_OVERRIDE
   {
     // If this method is called, we've gotten results, which means we have a
     // visit.
     mIsVisited = true;
     return NS_OK;
   }
 
-  NS_IMETHOD HandleError(mozIStorageError* aError)
+  NS_IMETHOD HandleError(mozIStorageError* aError) MOZ_OVERRIDE
   {
     // mIsVisited is already set to false, and that's the assumption we will
     // make if an error occurred.
     return NS_OK;
   }
 
-  NS_IMETHOD HandleCompletion(uint16_t aReason)
+  NS_IMETHOD HandleCompletion(uint16_t aReason) MOZ_OVERRIDE
   {
     if (aReason != mozIStorageStatementCallback::REASON_FINISHED) {
       return NS_OK;
     }
 
     nsresult rv = NotifyVisitedStatus();
     NS_ENSURE_SUCCESS(rv, rv);
     return NS_OK;
@@ -1469,23 +1469,23 @@ public:
   explicit SetDownloadAnnotations(nsIURI* aDestination)
   : mDestination(aDestination)
   , mHistory(History::GetService())
   {
     MOZ_ASSERT(mDestination);
     MOZ_ASSERT(NS_IsMainThread());
   }
 
-  NS_IMETHOD HandleError(nsresult aResultCode, mozIPlaceInfo *aPlaceInfo)
+  NS_IMETHOD HandleError(nsresult aResultCode, mozIPlaceInfo *aPlaceInfo) MOZ_OVERRIDE
   {
     // Just don't add the annotations in case the visit isn't added.
     return NS_OK;
   }
 
-  NS_IMETHOD HandleResult(mozIPlaceInfo *aPlaceInfo)
+  NS_IMETHOD HandleResult(mozIPlaceInfo *aPlaceInfo) MOZ_OVERRIDE
   {
     // Exit silently if the download destination is not a local file.
     nsCOMPtr<nsIFileURL> destinationFileURL = do_QueryInterface(mDestination);
     if (!destinationFileURL) {
       return NS_OK;
     }
 
     nsCOMPtr<nsIURI> source;
@@ -1537,17 +1537,17 @@ public:
     if (title.IsEmpty()) {
       rv = mHistory->SetURITitle(source, destinationFileName);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
     return NS_OK;
   }
 
-  NS_IMETHOD HandleCompletion()
+  NS_IMETHOD HandleCompletion() MOZ_OVERRIDE
   {
     return NS_OK;
   }
 
 private:
   ~SetDownloadAnnotations() {}
 
   nsCOMPtr<nsIURI> mDestination;
@@ -2028,17 +2028,17 @@ public:
   NS_DECL_ISUPPORTS
 
   explicit ConcurrentStatementsHolder(mozIStorageConnection* aDBConn)
   {
     DebugOnly<nsresult> rv = aDBConn->AsyncClone(true, this);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
 
-  NS_IMETHOD Complete(nsresult aStatus, nsISupports* aConnection) {
+  NS_IMETHOD Complete(nsresult aStatus, nsISupports* aConnection) MOZ_OVERRIDE {
     if (NS_FAILED(aStatus))
       return NS_OK;
     mReadOnlyDBConn = do_QueryInterface(aConnection);
 
     // Now we can create our cached statements.
 
     if (!mIsVisitedStatement) {
       (void)mReadOnlyDBConn->CreateAsyncStatement(NS_LITERAL_CSTRING(
--- a/toolkit/components/places/nsAnnoProtocolHandler.cpp
+++ b/toolkit/components/places/nsAnnoProtocolHandler.cpp
@@ -86,17 +86,17 @@ public:
                  "Not providing a channel will result in crashes!");
     NS_ASSERTION(aOutputStream,
                  "Not providing an output stream will result in crashes!");
   }
 
   //////////////////////////////////////////////////////////////////////////////
   //// mozIStorageStatementCallback
 
-  NS_IMETHOD HandleResult(mozIStorageResultSet *aResultSet)
+  NS_IMETHOD HandleResult(mozIStorageResultSet *aResultSet) MOZ_OVERRIDE
   {
     // We will only get one row back in total, so we do not need to loop.
     nsCOMPtr<mozIStorageRow> row;
     nsresult rv = aResultSet->GetNextRow(getter_AddRefs(row));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // We do not allow favicons without a MIME type, so we'll return the default
     // icon.
@@ -137,17 +137,17 @@ public:
     NS_ENSURE_SUCCESS(rv, rv);
 
     // At this point, we should have written out all of our data to our stream.
     // HandleCompletion will close the output stream, so we are done here.
     mReturnDefaultIcon = false;
     return NS_OK;
   }
 
-  NS_IMETHOD HandleCompletion(uint16_t aReason)
+  NS_IMETHOD HandleCompletion(uint16_t aReason) MOZ_OVERRIDE
   {
     if (!mReturnDefaultIcon)
       return mOutputStream->Close();
 
     // We need to return our default icon, so we'll open up a new channel to get
     // that data, and push it to our output stream.  If at any point we get an
     // error, we can't do anything, so we'll just close our output stream.
     nsCOMPtr<nsIStreamListener> listener;
@@ -163,22 +163,22 @@ public:
     NS_ENSURE_SUCCESS(rv, mOutputStream->Close());
 
     return NS_OK;
   }
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIRequestObserver
 
-  NS_IMETHOD OnStartRequest(nsIRequest *, nsISupports *)
+  NS_IMETHOD OnStartRequest(nsIRequest *, nsISupports *) MOZ_OVERRIDE
   {
     return NS_OK;
   }
 
-  NS_IMETHOD OnStopRequest(nsIRequest *, nsISupports *, nsresult aStatusCode)
+  NS_IMETHOD OnStopRequest(nsIRequest *, nsISupports *, nsresult aStatusCode) MOZ_OVERRIDE
   {
     // We always need to close our output stream, regardless of the status code.
     (void)mOutputStream->Close();
 
     // But, we'll warn about it not being successful if it wasn't.
     NS_WARN_IF_FALSE(NS_SUCCEEDED(aStatusCode),
                      "Got an error when trying to load our default favicon!");
 
--- a/toolkit/components/places/nsNavBookmarks.h
+++ b/toolkit/components/places/nsNavBookmarks.h
@@ -362,49 +362,49 @@ private:
   int64_t RecursiveFindRedirectedBookmark(int64_t aPlaceId);
 
   class RemoveFolderTransaction MOZ_FINAL : public nsITransaction {
   public:
     explicit RemoveFolderTransaction(int64_t aID) : mID(aID) {}
 
     NS_DECL_ISUPPORTS
 
-    NS_IMETHOD DoTransaction() {
+    NS_IMETHOD DoTransaction() MOZ_OVERRIDE {
       nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
       NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
       BookmarkData folder;
       nsresult rv = bookmarks->FetchItemInfo(mID, folder);
       // TODO (Bug 656935): store the BookmarkData struct instead.
       mParent = folder.parentId;
       mIndex = folder.position;
 
       rv = bookmarks->GetItemTitle(mID, mTitle);
       NS_ENSURE_SUCCESS(rv, rv);
 
       return bookmarks->RemoveItem(mID);
     }
 
-    NS_IMETHOD UndoTransaction() {
+    NS_IMETHOD UndoTransaction() MOZ_OVERRIDE {
       nsNavBookmarks* bookmarks = nsNavBookmarks::GetBookmarksService();
       NS_ENSURE_TRUE(bookmarks, NS_ERROR_OUT_OF_MEMORY);
       int64_t newFolder;
       return bookmarks->CreateContainerWithID(mID, mParent, mTitle, true,
                                               &mIndex, EmptyCString(), &newFolder);
     }
 
-    NS_IMETHOD RedoTransaction() {
+    NS_IMETHOD RedoTransaction() MOZ_OVERRIDE {
       return DoTransaction();
     }
 
-    NS_IMETHOD GetIsTransient(bool* aResult) {
+    NS_IMETHOD GetIsTransient(bool* aResult) MOZ_OVERRIDE {
       *aResult = false;
       return NS_OK;
     }
 
-    NS_IMETHOD Merge(nsITransaction* aTransaction, bool* aResult) {
+    NS_IMETHOD Merge(nsITransaction* aTransaction, bool* aResult) MOZ_OVERRIDE {
       *aResult = false;
       return NS_OK;
     }
 
   private:
     ~RemoveFolderTransaction() {}
 
     int64_t mID;
--- a/toolkit/components/places/nsNavHistoryResult.h
+++ b/toolkit/components/places/nsNavHistoryResult.h
@@ -55,51 +55,51 @@ public:
 
 private:
   const int64_t mValue;
 };
 
 
 // Declare methods for implementing nsINavBookmarkObserver
 // and nsINavHistoryObserver (some methods, such as BeginUpdateBatch overlap)
-#define NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE                          \
+#define NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE(...)                     \
   NS_DECL_NSINAVBOOKMARKOBSERVER                                        \
   NS_IMETHOD OnTitleChanged(nsIURI* aURI, const nsAString& aPageTitle,  \
-                            const nsACString& aGUID);                   \
+                            const nsACString& aGUID) __VA_ARGS__;       \
   NS_IMETHOD OnFrecencyChanged(nsIURI* aURI, int32_t aNewFrecency,      \
                                const nsACString& aGUID, bool aHidden,   \
-                               PRTime aLastVisitDate);                  \
-  NS_IMETHOD OnManyFrecenciesChanged();                                 \
+                               PRTime aLastVisitDate) __VA_ARGS__;      \
+  NS_IMETHOD OnManyFrecenciesChanged() __VA_ARGS__;                     \
   NS_IMETHOD OnDeleteURI(nsIURI *aURI, const nsACString& aGUID,         \
-                         uint16_t aReason);                             \
-  NS_IMETHOD OnClearHistory();                                          \
+                         uint16_t aReason) __VA_ARGS__;                 \
+  NS_IMETHOD OnClearHistory() __VA_ARGS__;                              \
   NS_IMETHOD OnPageChanged(nsIURI *aURI, uint32_t aChangedAttribute,    \
                            const nsAString &aNewValue,                  \
-                           const nsACString &aGUID);                    \
+                           const nsACString &aGUID) __VA_ARGS__;        \
   NS_IMETHOD OnDeleteVisits(nsIURI* aURI, PRTime aVisitTime,            \
                             const nsACString& aGUID, uint16_t aReason,  \
-                            uint32_t aTransitionType);
+                            uint32_t aTransitionType) __VA_ARGS__;
 
 // The internal version has an output aAdded parameter, it is incremented by
 // query nodes when the visited uri belongs to them. If no such query exists,
 // the history result creates a new query node dynamically.
 #define NS_DECL_BOOKMARK_HISTORY_OBSERVER_INTERNAL                      \
-  NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE                                \
+  NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE()                              \
   NS_IMETHOD OnVisit(nsIURI* aURI, int64_t aVisitId, PRTime aTime,      \
                      int64_t aSessionId, int64_t aReferringId,          \
                      uint32_t aTransitionType, const nsACString& aGUID, \
                      bool aHidden, uint32_t* aAdded);
 
 // The external version is used by results.
-#define NS_DECL_BOOKMARK_HISTORY_OBSERVER_EXTERNAL                      \
-  NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE                                \
+#define NS_DECL_BOOKMARK_HISTORY_OBSERVER_EXTERNAL(...)                 \
+  NS_DECL_BOOKMARK_HISTORY_OBSERVER_BASE(__VA_ARGS__)                   \
   NS_IMETHOD OnVisit(nsIURI* aURI, int64_t aVisitId, PRTime aTime,      \
                      int64_t aSessionId, int64_t aReferringId,          \
                      uint32_t aTransitionType, const nsACString& aGUID, \
-                     bool aHidden);
+                     bool aHidden) __VA_ARGS__;
 
 // nsNavHistoryResult
 //
 //    nsNavHistory creates this object and fills in mChildren (by getting
 //    it through GetTopLevel()). Then FilledAllResults() is called to finish
 //    object initialization.
 
 #define NS_NAVHISTORYRESULT_IID \
@@ -117,17 +117,17 @@ public:
                                    nsNavHistoryContainerResultNode* aRoot,
                                    bool aBatchInProgress,
                                    nsNavHistoryResult** result);
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYRESULT_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSINAVHISTORYRESULT
-  NS_DECL_BOOKMARK_HISTORY_OBSERVER_EXTERNAL
+  NS_DECL_BOOKMARK_HISTORY_OBSERVER_EXTERNAL(MOZ_OVERRIDE)
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsNavHistoryResult, nsINavHistoryResult)
 
   void AddHistoryObserver(nsNavHistoryQueryResultNode* aNode);
   void AddBookmarkFolderObserver(nsNavHistoryFolderResultNode* aNode, int64_t aFolder);
   void AddAllBookmarksObserver(nsNavHistoryQueryResultNode* aNode);
   void RemoveHistoryObserver(nsNavHistoryQueryResultNode* aNode);
   void RemoveBookmarkFolderObserver(nsNavHistoryFolderResultNode* aNode, int64_t aFolder);
   void RemoveAllBookmarksObserver(nsNavHistoryQueryResultNode* aNode);
@@ -199,80 +199,80 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHisto
 #define NS_NAVHISTORYRESULTNODE_IID \
   {0x54b61d38, 0x57c1, 0x11da, {0x95, 0xb8, 0x00, 0x13, 0x21, 0xc9, 0xf6, 0x9e}}
 
 // These are all the simple getters, they can be used for the result node
 // implementation and all subclasses. More complex are GetIcon, GetParent
 // (which depends on the definition of container result node), and GetUri
 // (which is overridded for lazy construction for some containers).
 #define NS_IMPLEMENT_SIMPLE_RESULTNODE \
-  NS_IMETHOD GetTitle(nsACString& aTitle) \
+  NS_IMETHOD GetTitle(nsACString& aTitle) MOZ_OVERRIDE \
     { aTitle = mTitle; return NS_OK; } \
-  NS_IMETHOD GetAccessCount(uint32_t* aAccessCount) \
+  NS_IMETHOD GetAccessCount(uint32_t* aAccessCount) MOZ_OVERRIDE \
     { *aAccessCount = mAccessCount; return NS_OK; } \
-  NS_IMETHOD GetTime(PRTime* aTime) \
+  NS_IMETHOD GetTime(PRTime* aTime) MOZ_OVERRIDE \
     { *aTime = mTime; return NS_OK; } \
-  NS_IMETHOD GetIndentLevel(int32_t* aIndentLevel) \
+  NS_IMETHOD GetIndentLevel(int32_t* aIndentLevel) MOZ_OVERRIDE \
     { *aIndentLevel = mIndentLevel; return NS_OK; } \
-  NS_IMETHOD GetBookmarkIndex(int32_t* aIndex) \
+  NS_IMETHOD GetBookmarkIndex(int32_t* aIndex) MOZ_OVERRIDE \
     { *aIndex = mBookmarkIndex; return NS_OK; } \
-  NS_IMETHOD GetDateAdded(PRTime* aDateAdded) \
+  NS_IMETHOD GetDateAdded(PRTime* aDateAdded) MOZ_OVERRIDE \
     { *aDateAdded = mDateAdded; return NS_OK; } \
-  NS_IMETHOD GetLastModified(PRTime* aLastModified) \
+  NS_IMETHOD GetLastModified(PRTime* aLastModified) MOZ_OVERRIDE \
     { *aLastModified = mLastModified; return NS_OK; } \
-  NS_IMETHOD GetItemId(int64_t* aId) \
+  NS_IMETHOD GetItemId(int64_t* aId) MOZ_OVERRIDE \
     { *aId = mItemId; return NS_OK; }
 
 // This is used by the base classes instead of
 // NS_FORWARD_NSINAVHISTORYRESULTNODE(nsNavHistoryResultNode) because they
 // need to redefine GetType and GetUri rather than forwarding them. This
 // implements all the simple getters instead of forwarding because they are so
 // short and we can save a virtual function call.
 //
 // (GetUri is redefined only by QueryResultNode and FolderResultNode because
 // the queries might not necessarily be parsed. The rest just return the node's
 // buffer.)
 #define NS_FORWARD_COMMON_RESULTNODE_TO_BASE \
   NS_IMPLEMENT_SIMPLE_RESULTNODE \
-  NS_IMETHOD GetIcon(nsACString& aIcon) \
+  NS_IMETHOD GetIcon(nsACString& aIcon) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetIcon(aIcon); } \
-  NS_IMETHOD GetParent(nsINavHistoryContainerResultNode** aParent) \
+  NS_IMETHOD GetParent(nsINavHistoryContainerResultNode** aParent) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetParent(aParent); } \
-  NS_IMETHOD GetParentResult(nsINavHistoryResult** aResult) \
+  NS_IMETHOD GetParentResult(nsINavHistoryResult** aResult) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetParentResult(aResult); } \
-  NS_IMETHOD GetTags(nsAString& aTags) \
+  NS_IMETHOD GetTags(nsAString& aTags) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetTags(aTags); } \
-  NS_IMETHOD GetPageGuid(nsACString& aPageGuid) \
+  NS_IMETHOD GetPageGuid(nsACString& aPageGuid) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetPageGuid(aPageGuid); } \
-  NS_IMETHOD GetBookmarkGuid(nsACString& aBookmarkGuid) \
+  NS_IMETHOD GetBookmarkGuid(nsACString& aBookmarkGuid) MOZ_OVERRIDE \
     { return nsNavHistoryResultNode::GetBookmarkGuid(aBookmarkGuid); }
 
 class nsNavHistoryResultNode : public nsINavHistoryResultNode
 {
 public:
   nsNavHistoryResultNode(const nsACString& aURI, const nsACString& aTitle,
                          uint32_t aAccessCount, PRTime aTime,
                          const nsACString& aIconURI);
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYRESULTNODE_IID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(nsNavHistoryResultNode)
 
   NS_IMPLEMENT_SIMPLE_RESULTNODE
-  NS_IMETHOD GetIcon(nsACString& aIcon);
-  NS_IMETHOD GetParent(nsINavHistoryContainerResultNode** aParent);
-  NS_IMETHOD GetParentResult(nsINavHistoryResult** aResult);
-  NS_IMETHOD GetType(uint32_t* type)
+  NS_IMETHOD GetIcon(nsACString& aIcon) MOZ_OVERRIDE;
+  NS_IMETHOD GetParent(nsINavHistoryContainerResultNode** aParent) MOZ_OVERRIDE;
+  NS_IMETHOD GetParentResult(nsINavHistoryResult** aResult) MOZ_OVERRIDE;
+  NS_IMETHOD GetType(uint32_t* type) MOZ_OVERRIDE
     { *type = nsNavHistoryResultNode::RESULT_TYPE_URI; return NS_OK; }
-  NS_IMETHOD GetUri(nsACString& aURI)
+  NS_IMETHOD GetUri(nsACString& aURI) MOZ_OVERRIDE
     { aURI = mURI; return NS_OK; }
-  NS_IMETHOD GetTags(nsAString& aTags);
-  NS_IMETHOD GetPageGuid(nsACString& aPageGuid);
-  NS_IMETHOD GetBookmarkGuid(nsACString& aBookmarkGuid);
+  NS_IMETHOD GetTags(nsAString& aTags) MOZ_OVERRIDE;
+  NS_IMETHOD GetPageGuid(nsACString& aPageGuid) MOZ_OVERRIDE;
+  NS_IMETHOD GetBookmarkGuid(nsACString& aBookmarkGuid) MOZ_OVERRIDE;
 
   virtual void OnRemoving();
 
   // Called from result's onItemChanged, see also bookmark observer declaration in
   // nsNavHistoryFolderResultNode
   NS_IMETHOD OnItemChanged(int64_t aItemId,
                            const nsACString &aProperty,
                            bool aIsAnnotationProperty,
@@ -389,31 +389,31 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHisto
 //    This is the base class for all nodes that can have children. It is
 //    overridden for nodes that are dynamically populated such as queries and
 //    folders. It is used directly for simple containers such as host groups
 //    in history views.
 
 // derived classes each provide their own implementation of has children and
 // forward the rest to us using this macro
 #define NS_FORWARD_CONTAINERNODE_EXCEPT_HASCHILDREN \
-  NS_IMETHOD GetState(uint16_t* _state) \
+  NS_IMETHOD GetState(uint16_t* _state) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::GetState(_state); } \
-  NS_IMETHOD GetContainerOpen(bool *aContainerOpen) \
+  NS_IMETHOD GetContainerOpen(bool *aContainerOpen) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::GetContainerOpen(aContainerOpen); } \
-  NS_IMETHOD SetContainerOpen(bool aContainerOpen) \
+  NS_IMETHOD SetContainerOpen(bool aContainerOpen) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::SetContainerOpen(aContainerOpen); } \
-  NS_IMETHOD GetChildCount(uint32_t *aChildCount) \
+  NS_IMETHOD GetChildCount(uint32_t *aChildCount) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::GetChildCount(aChildCount); } \
-  NS_IMETHOD GetChild(uint32_t index, nsINavHistoryResultNode **_retval) \
+  NS_IMETHOD GetChild(uint32_t index, nsINavHistoryResultNode **_retval) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::GetChild(index, _retval); } \
-  NS_IMETHOD GetChildIndex(nsINavHistoryResultNode* aNode, uint32_t* _retval) \
+  NS_IMETHOD GetChildIndex(nsINavHistoryResultNode* aNode, uint32_t* _retval) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::GetChildIndex(aNode, _retval); } \
   NS_IMETHOD FindNodeByDetails(const nsACString& aURIString, PRTime aTime, \
                                int64_t aItemId, bool aRecursive, \
-                               nsINavHistoryResultNode** _retval) \
+                               nsINavHistoryResultNode** _retval) MOZ_OVERRIDE \
     { return nsNavHistoryContainerResultNode::FindNodeByDetails(aURIString, aTime, aItemId, \
                                                                 aRecursive, _retval); }
 
 #define NS_NAVHISTORYCONTAINERRESULTNODE_IID \
   { 0x6e3bf8d3, 0x22aa, 0x4065, { 0x86, 0xbc, 0x37, 0x46, 0xb5, 0xb3, 0x2c, 0xe8 } }
 
 class nsNavHistoryContainerResultNode : public nsNavHistoryResultNode,
                                         public nsINavHistoryContainerResultNode
@@ -431,25 +431,25 @@ public:
 
   virtual nsresult Refresh();
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_NAVHISTORYCONTAINERRESULTNODE_IID)
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsNavHistoryContainerResultNode, nsNavHistoryResultNode)
   NS_FORWARD_COMMON_RESULTNODE_TO_BASE
-  NS_IMETHOD GetType(uint32_t* type)
+  NS_IMETHOD GetType(uint32_t* type) MOZ_OVERRIDE
     { *type = mContainerType; return NS_OK; }
-  NS_IMETHOD GetUri(nsACString& aURI)
+  NS_IMETHOD GetUri(nsACString& aURI) MOZ_OVERRIDE
     { aURI = mURI; return NS_OK; }
   NS_DECL_NSINAVHISTORYCONTAINERRESULTNODE
 
 public:
 
-  virtual void OnRemoving();
+  virtual void OnRemoving() MOZ_OVERRIDE;
 
   bool AreChildrenVisible();
 
   // Overridded by descendents to populate.
   virtual nsresult OpenContainer();
   nsresult CloseContainer(bool aSuppressNotifications = false);
 
   virtual nsresult OpenContainerAsync();
@@ -626,30 +626,30 @@ public:
   nsNavHistoryQueryResultNode(const nsACString& aTitle,
                               const nsACString& aIconURI,
                               PRTime aTime,
                               const nsCOMArray<nsNavHistoryQuery>& aQueries,
                               nsNavHistoryQueryOptions* aOptions);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_FORWARD_COMMON_RESULTNODE_TO_BASE
-  NS_IMETHOD GetType(uint32_t* type)
+  NS_IMETHOD GetType(uint32_t* type) MOZ_OVERRIDE
     { *type = nsNavHistoryResultNode::RESULT_TYPE_QUERY; return NS_OK; }
-  NS_IMETHOD GetUri(nsACString& aURI); // does special lazy creation
+  NS_IMETHOD GetUri(nsACString& aURI) MOZ_OVERRIDE; // does special lazy creation
   NS_FORWARD_CONTAINERNODE_EXCEPT_HASCHILDREN
-  NS_IMETHOD GetHasChildren(bool* aHasChildren);
+  NS_IMETHOD GetHasChildren(bool* aHasChildren) MOZ_OVERRIDE;
   NS_DECL_NSINAVHISTORYQUERYRESULTNODE
 
   bool CanExpand();
   bool IsContainersQuery();
 
-  virtual nsresult OpenContainer();
+  virtual nsresult OpenContainer() MOZ_OVERRIDE;
 
   NS_DECL_BOOKMARK_HISTORY_OBSERVER_INTERNAL
-  virtual void OnRemoving();
+  virtual void OnRemoving() MOZ_OVERRIDE;
 
 public:
   // this constructs lazily mURI from mQueries and mOptions, call
   // VerifyQueriesSerialized either this or mQueries/mOptions should be valid
   nsresult VerifyQueriesSerialized();
 
   // these may be constructed lazily from mURI, call VerifyQueriesParsed
   // either this or mURI should be valid
@@ -662,22 +662,22 @@ public:
   nsNavHistoryQueryOptions* Options();
 
   // this indicates whether the query contents are valid, they don't go away
   // after the container is closed until a notification comes in
   bool mContentsValid;
 
   nsresult FillChildren();
   void ClearChildren(bool unregister);
-  nsresult Refresh();
+  nsresult Refresh() MOZ_OVERRIDE;
 
-  virtual uint16_t GetSortType();
-  virtual void GetSortingAnnotation(nsACString& aSortingAnnotation);
+  virtual uint16_t GetSortType() MOZ_OVERRIDE;
+  virtual void GetSortingAnnotation(nsACString& aSortingAnnotation) MOZ_OVERRIDE;
   virtual void RecursiveSort(const char* aData,
-                             SortComparator aComparator);
+                             SortComparator aComparator) MOZ_OVERRIDE;
 
   nsCOMPtr<nsIURI> mRemovingURI;
   nsresult NotifyIfTagsChanged(nsIURI* aURI);
 
   uint32_t mBatchChanges;
 
   // Tracks transition type filters shared by all mQueries.
   nsTArray<uint32_t> mTransitions;
@@ -699,54 +699,54 @@ class nsNavHistoryFolderResultNode MOZ_F
 {
 public:
   nsNavHistoryFolderResultNode(const nsACString& aTitle,
                                nsNavHistoryQueryOptions* options,
                                int64_t aFolderId);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_FORWARD_COMMON_RESULTNODE_TO_BASE
-  NS_IMETHOD GetType(uint32_t* type) {
+  NS_IMETHOD GetType(uint32_t* type) MOZ_OVERRIDE {
     if (mTargetFolderItemId != mItemId) {
       *type = nsNavHistoryResultNode::RESULT_TYPE_FOLDER_SHORTCUT;
     } else {
       *type = nsNavHistoryResultNode::RESULT_TYPE_FOLDER;
     }
     return NS_OK;
   }
-  NS_IMETHOD GetUri(nsACString& aURI);
+  NS_IMETHOD GetUri(nsACString& aURI) MOZ_OVERRIDE;
   NS_FORWARD_CONTAINERNODE_EXCEPT_HASCHILDREN
-  NS_IMETHOD GetHasChildren(bool* aHasChildren);
+  NS_IMETHOD GetHasChildren(bool* aHasChildren) MOZ_OVERRIDE;
   NS_DECL_NSINAVHISTORYQUERYRESULTNODE
 
-  virtual nsresult OpenContainer();
+  virtual nsresult OpenContainer() MOZ_OVERRIDE;
 
-  virtual nsresult OpenContainerAsync();
+  virtual nsresult OpenContainerAsync() MOZ_OVERRIDE;
   NS_DECL_ASYNCSTATEMENTCALLBACK
 
   // This object implements a bookmark observer interface. This is called from the
   // result's actual observer and it knows all observers are FolderResultNodes
   NS_DECL_NSINAVBOOKMARKOBSERVER
 
-  virtual void OnRemoving();
+  virtual void OnRemoving() MOZ_OVERRIDE;
 
   // this indicates whether the folder contents are valid, they don't go away
   // after the container is closed until a notification comes in
   bool mContentsValid;
 
   // If the node is generated from a place:folder=X query, this is the target
   // folder id and GUID.  For regular folder nodes, they are set to the same
   // values as mItemId and mBookmarkGuid. For more complex queries, they are set
   // to -1/an empty string.
   int64_t mTargetFolderItemId;
   nsCString mTargetFolderGuid;
 
   nsresult FillChildren();
   void ClearChildren(bool aUnregister);
-  nsresult Refresh();
+  nsresult Refresh() MOZ_OVERRIDE;
 
   bool StartIncrementalUpdate();
   void ReindexRange(int32_t aStartIndex, int32_t aEndIndex, int32_t aDelta);
 
   nsNavHistoryResultNode* FindChildById(int64_t aItemId,
                                         uint32_t* aNodeIndex);
 
 protected:
--- a/toolkit/components/places/tests/cpp/mock_Link.h
+++ b/toolkit/components/places/tests/cpp/mock_Link.h
@@ -29,26 +29,26 @@ public:
     // Create a cyclic ownership, so that the link will be released only
     // after its status has been updated.  This will ensure that, when it should
     // run the next test, it will happen at the end of the test function, if
     // the link status has already been set before.  Indeed the link status is
     // updated on a separate connection, thus may happen at any time.
     mDeathGrip = this;
   }
 
-  virtual void SetLinkState(nsLinkState aState)
+  virtual void SetLinkState(nsLinkState aState) MOZ_OVERRIDE
   {
     // Notify our callback function.
     mHandler(aState);
 
     // Break the cycle so the object can be destroyed.
     mDeathGrip = 0;
   }
 
-  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
+  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
   {
     return 0;   // the value shouldn't matter
   }
 
 protected:
   ~mock_Link() {
     // Run the next test if we are supposed to.
     if (mRunNextTest) {
--- a/toolkit/components/places/tests/cpp/places_test_harness.h
+++ b/toolkit/components/places/tests/cpp/places_test_harness.h
@@ -120,17 +120,17 @@ public:
         break;
       }
       (void)NS_ProcessNextEvent();
     }
   }
 
   NS_IMETHOD Observe(nsISupports* aSubject,
                      const char* aTopic,
-                     const char16_t* aData)
+                     const char16_t* aData) MOZ_OVERRIDE
   {
     mTopicReceived = true;
     nsCOMPtr<nsIObserverService> observerService =
       do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
     do_check_true(observerService);
     (void)observerService->RemoveObserver(this, aTopic);
     return NS_OK;
   }
@@ -389,17 +389,17 @@ public:
     if (os) {
       MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->AddObserver(this, TOPIC_PROFILE_CHANGE, false)));
     }
     mSpinner = new WaitForTopicSpinner(TOPIC_PLACES_CONNECTION_CLOSED);
   }
 
   NS_IMETHOD Observe(nsISupports* aSubject,
                      const char* aTopic,
-                     const char16_t* aData)
+                     const char16_t* aData) MOZ_OVERRIDE
   {
     nsCOMPtr<nsIObserverService> os =
       do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
     MOZ_ASSERT(os);
     if (os) {
       MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->RemoveObserver(this, aTopic)));
     }
 
--- a/toolkit/components/places/tests/cpp/test_IHistory.cpp
+++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp
@@ -70,17 +70,17 @@ public:
   {
     while (mVisits < mExpectedVisits) {
       (void)NS_ProcessNextEvent();
     }
   }
 
   NS_IMETHOD Observe(nsISupports* aSubject,
                      const char* aTopic,
-                     const char16_t* aData)
+                     const char16_t* aData) MOZ_OVERRIDE
   {
     mVisits++;
 
     if (mVisits == mExpectedVisits) {
       nsCOMPtr<nsIObserverService> observerService =
         do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
       (void)observerService->RemoveObserver(this, "uri-visit-saved");
     }
@@ -324,17 +324,17 @@ namespace test_observer_topic_dispatched
       do_check_true(observerService);
       (void)observerService->AddObserver(this,
                                          URI_VISITED_RESOLUTION_TOPIC,
                                          false);
     }
 
     NS_IMETHOD Observe(nsISupports* aSubject,
                        const char* aTopic,
-                       const char16_t* aData)
+                       const char16_t* aData) MOZ_OVERRIDE
     {
       // Make sure we got notified of the right topic.
       do_check_false(strcmp(aTopic, URI_VISITED_RESOLUTION_TOPIC));
 
       // If this isn't for our URI, do not do anything.
       nsCOMPtr<nsIURI> notifiedURI = do_QueryInterface(aSubject);
       do_check_true(notifiedURI);