Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: chrome/browser/history/history.h

Issue 11573060: Remove VisitedLink dependency on rest of chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use delegate instead Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history.h
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index fdbc3f3e4d69551406d830ec344d67f3e34d70b8..7b116b047f30f9e913ef75a0b92029bcbe068485 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -25,6 +25,7 @@
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/search_engines/template_url_id.h"
+#include "chrome/browser/visitedlink/visitedlink_delegate.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/ref_counted_util.h"
#include "content/public/browser/notification_observer.h"
@@ -45,6 +46,7 @@ class HistoryURLProvider;
class PageUsageData;
class PageUsageRequest;
class Profile;
+class VisitedLinkMaster;
struct HistoryURLProviderParams;
namespace base {
@@ -107,7 +109,8 @@ class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
class HistoryService : public CancelableRequestProvider,
public content::NotificationObserver,
public syncer::SyncableService,
- public ProfileKeyedService {
+ public ProfileKeyedService,
+ public VisitedLinkDelegate {
public:
// Miscellaneous commonly-used types.
typedef std::vector<PageUsageData*> PageUsageDataList;
@@ -261,31 +264,6 @@ class HistoryService : public CancelableRequestProvider,
// Querying ------------------------------------------------------------------
- // Callback class that a client can implement to iterate over URLs. The
- // callbacks WILL BE CALLED ON THE BACKGROUND THREAD! Your implementation
- // should handle this appropriately.
- class URLEnumerator {
- public:
- // Indicates that a URL is available. There will be exactly one call for
- // every URL in history.
- virtual void OnURL(const history::URLRow& url_row) = 0;
-
- // Indicates we are done iterating over URLs. Once called, there will be no
- // more callbacks made. This call is guaranteed to occur, even if there are
- // no URLs. If all URLs were iterated, success will be true.
- virtual void OnComplete(bool success) = 0;
-
- protected:
- virtual ~URLEnumerator() {}
- };
-
- // Enumerate all URLs in history. The given iterator will be owned by the
- // caller, so the caller should ensure it exists until OnComplete is called.
- // You should not generally use this since it will be slow to slurp all URLs
- // in from the database. It is designed for rebuilding the visited link
- // database from history.
- void IterateURLs(URLEnumerator* iterator);
-
// Returns the information about the requested URL. If the URL is found,
// success will be true and the information will be in the URLRow parameter.
// On success, the visits, if requested, will be sorted by date. If they have
@@ -673,6 +651,12 @@ class HistoryService : public CancelableRequestProvider,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Implementation of VisitedLinkDelegate.
+ virtual bool IsEquivalentContext(content::BrowserContext* context1,
Jói 2012/12/19 14:07:20 nit: I know I suggested this name, but now that I
boliu 2012/12/29 01:48:12 Done.
+ content::BrowserContext* context2) OVERRIDE;
+ virtual void RebuildTable(
+ VisitedLinkDelegate::URLEnumerator* enumerator) OVERRIDE;
+
// Low-level Init(). Same as the public version, but adds a |no_db| parameter
// that is only set by unittests which causes the backend to not init its DB.
bool Init(const FilePath& history_dir,
@@ -1094,6 +1078,9 @@ class HistoryService : public CancelableRequestProvider,
// The profile, may be null when testing.
Profile* profile_;
+ // This is null in tests.
+ scoped_ptr<VisitedLinkMaster> visitedlink_master_;
+
// Has the backend finished loading? The backend is loaded once Init has
// completed.
bool backend_loaded_;

Powered by Google App Engine
This is Rietveld 408576698