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

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

Issue 11784006: Revert "Remove VisitedLink dependency on rest of chrome" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 months 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
« no previous file with comments | « chrome/browser/history/DEPS ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history.h
diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h
index b8c48a2003d24586eb089073f3e60053d3bc849c..011764f0b15342e68252c37c040460b7c38e59cb 100644
--- a/chrome/browser/history/history.h
+++ b/chrome/browser/history/history.h
@@ -25,7 +25,6 @@
#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"
@@ -46,7 +45,6 @@ class HistoryURLProvider;
class PageUsageData;
class PageUsageRequest;
class Profile;
-class VisitedLinkMaster;
struct HistoryURLProviderParams;
namespace base {
@@ -109,8 +107,7 @@ class HistoryDBTask : public base::RefCountedThreadSafe<HistoryDBTask> {
class HistoryService : public CancelableRequestProvider,
public content::NotificationObserver,
public syncer::SyncableService,
- public ProfileKeyedService,
- public VisitedLinkDelegate {
+ public ProfileKeyedService {
public:
// Miscellaneous commonly-used types.
typedef std::vector<PageUsageData*> PageUsageDataList;
@@ -264,6 +261,31 @@ 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
@@ -657,12 +679,6 @@ class HistoryService : public CancelableRequestProvider,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Implementation of VisitedLinkDelegate.
- virtual bool AreEquivalentContexts(
- content::BrowserContext* context1,
- content::BrowserContext* context2) OVERRIDE;
- virtual void RebuildTable(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,
@@ -1087,10 +1103,6 @@ class HistoryService : public CancelableRequestProvider,
// The profile, may be null when testing.
Profile* profile_;
- // Used for propagating link highlighting data across renderers. May be null
- // in tests.
- scoped_ptr<VisitedLinkMaster> visitedlink_master_;
-
// Has the backend finished loading? The backend is loaded once Init has
// completed.
bool backend_loaded_;
« no previous file with comments | « chrome/browser/history/DEPS ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698