Index: chrome/browser/history/chrome_history_client.h |
diff --git a/chrome/browser/history/chrome_history_client.h b/chrome/browser/history/chrome_history_client.h |
index c9cc6284d5287ed67a347060d874ac91bbc4cebb..af30ebd39f8bdc8c94eef16c388f45dd3d77fa01 100644 |
--- a/chrome/browser/history/chrome_history_client.h |
+++ b/chrome/browser/history/chrome_history_client.h |
@@ -6,6 +6,7 @@ |
#define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
#include "components/history/core/browser/history_client.h" |
#include "components/history/core/browser/top_sites_observer.h" |
@@ -25,9 +26,9 @@ class TopSites; |
class ChromeHistoryClient : public history::HistoryClient, |
public history::TopSitesObserver { |
public: |
- explicit ChromeHistoryClient(bookmarks::BookmarkModel* bookmark_model, |
- Profile* profile, |
- history::TopSites* top_sites); |
+ ChromeHistoryClient(bookmarks::BookmarkModel* bookmark_model, |
sdefresne
2015/01/21 17:57:23
Upstream code has been changed and no longer requi
|
+ Profile* profile, |
+ const scoped_refptr<history::TopSites>& top_sites); |
~ChromeHistoryClient() override; |
// history::HistoryClient: |
@@ -48,17 +49,7 @@ class ChromeHistoryClient : public history::HistoryClient, |
// The BookmarkModel, this should outlive ChromeHistoryClient. |
bookmarks::BookmarkModel* bookmark_model_; |
Profile* profile_; |
- // The TopSites object is owned by the Profile (see |
- // chrome/browser/profiles/profile_impl.h) |
- // and lazily constructed by the getter. |
- // ChromeHistoryClient is a KeyedService linked to the Profile lifetime by the |
- // ChromeHistoryClientFactory (which is a BrowserContextKeyedServiceFactory). |
- // Before the Profile is destroyed, all the KeyedService Shutdown methods are |
- // called, and the Profile is fully constructed before any of the KeyedService |
- // can be constructed. The TopSites does not use the HistoryService nor the |
- // HistoryClient during construction (it uses it later, but supports getting |
- // an NULL pointer). |
- history::TopSites* top_sites_; |
+ scoped_refptr<history::TopSites> top_sites_; |
DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); |
}; |