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

Unified Diff: chrome/browser/search/instant_service.h

Issue 15907006: Rip out browser-side RID caching for most visited items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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/search/instant_io_context.cc ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service.h
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h
index 8bd6cbd403497532b37c1014f008cb5697d585b7..4832dedc21ef65289c1739bd4138519831b228e5 100644
--- a/chrome/browser/search/instant_service.h
+++ b/chrome/browser/search/instant_service.h
@@ -8,13 +8,14 @@
#include <map>
#include <set>
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/history/history_types.h"
-#include "chrome/common/instant_restricted_id_cache.h"
+#include "chrome/common/instant_types.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -34,19 +35,6 @@ class InstantService : public BrowserContextKeyedService,
explicit InstantService(Profile* profile);
virtual ~InstantService();
- // A utility to translate an Instant path if it is of Most Visited item ID
- // form. If path is a Most Visited item ID and we have a URL for it, then
- // this URL is returned in string form. The |path| is a URL fragment
- // corresponding to the path of url with the leading slash ("/") stripped.
- // For example, chrome-search://favicon/72 would yield a |path| value of "72",
- // and since 72 is a valid uint64 the path is translated to a valid url,
- // "http://bingo.com/", say.
- static const std::string MaybeTranslateInstantPathOnUI(
- Profile* profile, const std::string& path);
- static const std::string MaybeTranslateInstantPathOnIO(
- const net::URLRequest* request, const std::string& path);
- static bool IsInstantPath(const GURL& url);
-
// Add, remove, and query RenderProcessHost IDs that are associated with
// Instant processes.
void AddInstantProcess(int process_id);
@@ -60,10 +48,6 @@ class InstantService : public BrowserContextKeyedService,
// Most visited item API.
- // Adds |items| to the |most_visited_item_cache_| assigning restricted IDs in
- // the process.
- void AddMostVisitedItems(const std::vector<InstantMostVisitedItem>& items);
-
// Invoked by the InstantController when the Instant page wants to delete a
// Most Visited item.
void DeleteMostVisitedItem(const GURL& url);
@@ -76,11 +60,9 @@ class InstantService : public BrowserContextKeyedService,
// Most Visited deletions.
void UndoAllMostVisitedDeletions();
- // Returns the last added InstantMostVisitedItems. After the call to
- // |AddMostVisitedItems|, the caller should call this to get the items with
- // the assigned IDs.
+ // Returns the last added InstantMostVisitedItems.
void GetCurrentMostVisitedItems(
- std::vector<InstantMostVisitedItemIDPair>* items) const;
+ std::vector<InstantMostVisitedItem>* items) const;
private:
// Overridden from BrowserContextKeyedService:
@@ -91,11 +73,6 @@ class InstantService : public BrowserContextKeyedService,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // If the |most_visited_item_id| is found in the cache, sets the |item| to it
- // and returns true.
- bool GetMostVisitedItemForID(InstantRestrictedID most_visited_item_id,
- InstantMostVisitedItem* item) const;
-
// Called when we get new most visited items from TopSites, registered as an
// async callback. Parses them and sends them to the renderer via
// SendMostVisitedItems.
@@ -106,8 +83,8 @@ class InstantService : public BrowserContextKeyedService,
// The process ids associated with Instant processes.
std::set<int> process_ids_;
- // A cache of the InstantMostVisitedItems sent to the Instant Pages.
- InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_item_cache_;
+ // InstantMostVisitedItems sent to the Instant Pages.
+ std::vector<InstantMostVisitedItem> most_visited_items_;
content::NotificationRegistrar registrar_;
« no previous file with comments | « chrome/browser/search/instant_io_context.cc ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698