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

Unified Diff: chrome/renderer/prerender/prerender_dispatcher.h

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/renderer/prerender/prerender_dispatcher.h
diff --git a/chrome/renderer/prerender/prerender_dispatcher.h b/chrome/renderer/prerender/prerender_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..5537401112cb13637d6849b91f2c780a153c335d
--- /dev/null
+++ b/chrome/renderer/prerender/prerender_dispatcher.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_
+#define CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_
+#pragma once
+
+#include <map>
+
+#include "base/compiler_specific.h"
+#include "content/public/renderer/render_process_observer.h"
+
+class GURL;
+
+namespace prerender {
+
+// PrerenderDispatcher keeps track of which URLs are being prerendered. There
+// is only one PrerenderDispatcher per render process, and it will only be
+// aware of prerenders that are triggered by this render process.
+class PrerenderDispatcher : public content::RenderProcessObserver {
+ public:
+ PrerenderDispatcher();
+ virtual ~PrerenderDispatcher();
+
+ bool IsPrerenderURL(const GURL & url) const;
+
+ private:
+ void OnAddPrerenderURL(const GURL& url);
+ void OnRemovePrerenderURL(const GURL& url);
+
+ // RenderProcessObserver:
+ virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ typedef std::map<GURL, int> PrerenderMap;
+ PrerenderMap prerender_urls_;
+};
+
+} // namespace prerender
+
+#endif // CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_

Powered by Google App Engine
This is Rietveld 408576698