| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ |
| 6 #define CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ | 6 #define CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // it holds on to other objects that must exist once per-renderer process, | 24 // it holds on to other objects that must exist once per-renderer process, |
| 25 // such as the PrerenderingSupport. | 25 // such as the PrerenderingSupport. |
| 26 class PrerenderDispatcher : public content::RenderProcessObserver { | 26 class PrerenderDispatcher : public content::RenderProcessObserver { |
| 27 public: | 27 public: |
| 28 PrerenderDispatcher(); | 28 PrerenderDispatcher(); |
| 29 virtual ~PrerenderDispatcher(); | 29 virtual ~PrerenderDispatcher(); |
| 30 | 30 |
| 31 bool IsPrerenderURL(const GURL & url) const; | 31 bool IsPrerenderURL(const GURL & url) const; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 friend class PrerenderDispatcherTest; |
| 35 |
| 34 void OnAddPrerenderURL(const GURL& url); | 36 void OnAddPrerenderURL(const GURL& url); |
| 35 void OnRemovePrerenderURL(const GURL& url); | 37 void OnRemovePrerenderURL(const GURL& url); |
| 36 | 38 |
| 37 // RenderProcessObserver: | 39 // RenderProcessObserver: |
| 38 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 40 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| 39 | 41 |
| 40 typedef std::map<GURL, int> PrerenderMap; | 42 typedef std::map<GURL, int> PrerenderMap; |
| 41 PrerenderMap prerender_urls_; | 43 PrerenderMap prerender_urls_; |
| 42 | 44 |
| 43 // There is one PrerenderingSupport object per renderer, and it provides | 45 // There is one PrerenderingSupport object per renderer, and it provides |
| 44 // the interface to prerendering to the WebKit platform. | 46 // the interface to prerendering to the WebKit platform. |
| 45 scoped_ptr<PrerenderingSupport> prerendering_support_; | 47 scoped_ptr<PrerenderingSupport> prerendering_support_; |
| 46 }; | 48 }; |
| 47 | 49 |
| 48 } // namespace prerender | 50 } // namespace prerender |
| 49 | 51 |
| 50 #endif // CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ | 52 #endif // CHROME_RENDERER_PRERENDER_PRERENDER_DISPATCHER_H_ |
| OLD | NEW |