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

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

Issue 12732005: Most visited thumbnails and favicons need id-based urls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds proper handling of ThumbnailSource Created 7 years, 9 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/instant/instant_io_context.h
diff --git a/chrome/browser/instant/instant_io_context.h b/chrome/browser/instant/instant_io_context.h
index 26b9a562a9c3ed5b0e1ad6a49d50a68c515acc3f..4e8905e143bd12d6b64245b01eef9ada9adc72b8 100644
--- a/chrome/browser/instant/instant_io_context.h
+++ b/chrome/browser/instant/instant_io_context.h
@@ -5,11 +5,14 @@
#ifndef CHROME_BROWSER_INSTANT_INSTANT_IO_CONTEXT_
#define CHROME_BROWSER_INSTANT_INSTANT_IO_CONTEXT_
+#include <map>
#include <set>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+class GURL;
+
namespace content {
class ResourceContext;
}
@@ -46,10 +49,20 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
static void ClearInstantProcessesOnIO(
scoped_refptr<InstantIOContext> instant_io_context);
+ // Associates the |restricted_id| with the |url|.
+ static void AddRestrictedIDOnIO(
+ scoped_refptr<InstantIOContext> instant_io_context,
+ uint64 restricted_id, const GURL& url);
+
// Determine if this chrome-search: request is coming from an Instant render
// process.
static bool ShouldServiceRequest(const net::URLRequest* request);
+ // Returns true if the |restricted_id| is known, and |url| is set.
+ // Returns false otherwise.
+ static bool GetURLForRestrictedId(const net::URLRequest* request,
+ uint64 restricted_id, GURL* url);
+
protected:
virtual ~InstantIOContext();
@@ -60,11 +73,18 @@ class InstantIOContext : public base::RefCountedThreadSafe<InstantIOContext> {
// |process_ids_|.
bool IsInstantProcess(int process_id) const;
+ bool GetURLForRestrictedId(uint64 restricted_id, GURL* url);
+
// The process IDs associated with Instant processes. Mirror of the process
// IDs in InstantService. Duplicated here for synchronous access on the IO
// thread.
std::set<int> process_ids_;
+ // The restricted IDs map associated with Instant processes. Mirror of the
+ // restricted ID map in InstantService. Duplicated here for synchronous
+ // access on the IO thread.
+ std::map<uint64, GURL> id_to_url_map_;
+
DISALLOW_COPY_AND_ASSIGN(InstantIOContext);
};

Powered by Google App Engine
This is Rietveld 408576698