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

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

Issue 13375003: Fixing iframe jank in the local omnibox popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing sites, too. Created 7 years, 8 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
Index: chrome/browser/search/instant_io_context.h
diff --git a/chrome/browser/search/instant_io_context.h b/chrome/browser/search/instant_io_context.h
index d061fa8859ed9b0ea3c7a5212738a52e6c2c79aa..658a7c140ed60f5ab69bf0f5d8dce43a9022d388 100644
--- a/chrome/browser/search/instant_io_context.h
+++ b/chrome/browser/search/instant_io_context.h
@@ -44,7 +44,7 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
// processes. Used to keep process IDs in sync with InstantService.
static void AddInstantProcessOnIO(
scoped_refptr<InstantIOContext> instant_io_context,
- int process_id);
+ int process_id, const GURL& site_url);
static void RemoveInstantProcessOnIO(
scoped_refptr<InstantIOContext> instant_io_context,
int process_id);
@@ -60,6 +60,9 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
// process.
static bool ShouldServiceRequest(const net::URLRequest* request);
+ // Returns the expected origin of a request from an Instant process.
+ static std::string GetExpectedOrigin(const net::URLRequest* request);
+
// If there is a mapping for the |most_visited_item_id|, sets |url| and
// returns true.
static bool GetURLForMostVisitedItemID(
@@ -77,6 +80,9 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
// |process_ids_|.
bool IsInstantProcess(int process_id) const;
+ // Gets the site associated with the given Instant process.
+ std::string GetSiteForInstantProcess(int process_id) const;
+
bool GetURLForMostVisitedItemID(InstantRestrictedID most_visited_item_id,
GURL* url) const;
@@ -85,6 +91,9 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
// thread.
std::set<int> process_ids_;
+ // The site URLs associated with Instant processes. See |process_ids_|.
+ std::map<int, std::string> process_sites_;
+
// The Most Visited item cache. Mirror of the Most Visited item cache in
// InstantService. Duplicated here for synchronous access on the IO thread.
InstantRestrictedIDCache<InstantMostVisitedItem> most_visited_item_cache_;

Powered by Google App Engine
This is Rietveld 408576698