Bug 1423612 - Pass VisitData by reference r=standard8
authorDoug Thayer <dothayer@mozilla.com>
Wed, 06 Dec 2017 14:03:10 -0800
changeset 448500 bf435909ca6a3e3f585ba98e7bd1c3688cec626f
parent 448499 2941b6b2bcece74cce8bfbcad359ad7538a278a3
child 448501 dba2aba69348f5186f64ab2b2dcda5a812906912
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1423612
milestone59.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 1423612 - Pass VisitData by reference r=standard8 Fairly trivial. Prompted by a coverity report. MozReview-Commit-ID: 8Yg5KsRc2E1
toolkit/components/places/History.cpp
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -626,17 +626,17 @@ NS_IMPL_ISUPPORTS_INHERITED(
 )
 
 /**
  * Notifies observers about a visit or an array of visits.
  */
 class NotifyManyVisitsObservers : public Runnable
 {
 public:
-  explicit NotifyManyVisitsObservers(VisitData aPlace)
+  explicit NotifyManyVisitsObservers(const VisitData& aPlace)
     : Runnable("places::NotifyManyVisitsObservers")
     , mPlace(aPlace)
     , mHistory(History::GetService())
   {
   }
 
   explicit NotifyManyVisitsObservers(nsTArray<VisitData>& aPlaces)
     : Runnable("places::NotifyManyVisitsObservers")
@@ -644,17 +644,17 @@ public:
   {
     aPlaces.SwapElements(mPlaces);
   }
 
   nsresult NotifyVisit(nsNavHistory* aNavHistory,
                        nsCOMPtr<nsIObserverService>& aObsService,
                        PRTime aNow,
                        nsTArray<URIParams>& aNotifyVisitedURIs,
-                       VisitData aPlace) {
+                       const VisitData& aPlace) {
     nsCOMPtr<nsIURI> uri;
     MOZ_ALWAYS_SUCCEEDS(NS_NewURI(getter_AddRefs(uri), aPlace.spec));
     if (!uri) {
       return NS_ERROR_UNEXPECTED;
     }
     // Notify the visit.  Note that TRANSITION_EMBED visits are never added
     // to the database, thus cannot be queried and we don't notify them.
     if (aPlace.transitionType != nsINavHistoryService::TRANSITION_EMBED) {