OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 Factory() {} | 53 Factory() {} |
54 virtual ~Factory() {} | 54 virtual ~Factory() {} |
55 | 55 |
56 // Ownership is not transfered through this interface as prerender_manager, | 56 // Ownership is not transfered through this interface as prerender_manager, |
57 // prerender_tracker, and profile are stored as weak pointers. | 57 // prerender_tracker, and profile are stored as weak pointers. |
58 virtual PrerenderContents* CreatePrerenderContents( | 58 virtual PrerenderContents* CreatePrerenderContents( |
59 PrerenderManager* prerender_manager, | 59 PrerenderManager* prerender_manager, |
60 PrerenderTracker* prerender_tracker, | 60 PrerenderTracker* prerender_tracker, |
61 Profile* profile, | 61 Profile* profile, |
62 const GURL& url, | 62 const GURL& url, |
63 const GURL& referrer) = 0; | 63 const GURL& referrer, |
| 64 Origin origin) = 0; |
64 | 65 |
65 private: | 66 private: |
66 DISALLOW_COPY_AND_ASSIGN(Factory); | 67 DISALLOW_COPY_AND_ASSIGN(Factory); |
67 }; | 68 }; |
68 | 69 |
69 virtual ~PrerenderContents(); | 70 virtual ~PrerenderContents(); |
70 | 71 |
71 bool Init(); | 72 bool Init(); |
72 | 73 |
73 static Factory* CreateFactory(); | 74 static Factory* CreateFactory(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 161 |
161 int32 starting_page_id() { return starting_page_id_; } | 162 int32 starting_page_id() { return starting_page_id_; } |
162 | 163 |
163 Value* GetAsValue() const; | 164 Value* GetAsValue() const; |
164 | 165 |
165 protected: | 166 protected: |
166 PrerenderContents(PrerenderManager* prerender_manager, | 167 PrerenderContents(PrerenderManager* prerender_manager, |
167 PrerenderTracker* prerender_tracker, | 168 PrerenderTracker* prerender_tracker, |
168 Profile* profile, | 169 Profile* profile, |
169 const GURL& url, | 170 const GURL& url, |
170 const GURL& referrer); | 171 const GURL& referrer, |
| 172 Origin origin); |
171 | 173 |
172 NotificationRegistrar& notification_registrar() { | 174 NotificationRegistrar& notification_registrar() { |
173 return notification_registrar_; | 175 return notification_registrar_; |
174 } | 176 } |
175 | 177 |
176 // Called whenever a RenderViewHost is created for prerendering. Only called | 178 // Called whenever a RenderViewHost is created for prerendering. Only called |
177 // once the RenderViewHost has a RenderView and RenderWidgetHostView. | 179 // once the RenderViewHost has a RenderView and RenderWidgetHostView. |
178 virtual void OnRenderViewHostCreated(RenderViewHost* new_render_view_host); | 180 virtual void OnRenderViewHostCreated(RenderViewHost* new_render_view_host); |
179 | 181 |
180 private: | 182 private: |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 265 |
264 scoped_ptr<TabContentsDelegateImpl> tab_contents_delegate_; | 266 scoped_ptr<TabContentsDelegateImpl> tab_contents_delegate_; |
265 | 267 |
266 // These are -1 before a RenderView is created. | 268 // These are -1 before a RenderView is created. |
267 int child_id_; | 269 int child_id_; |
268 int route_id_; | 270 int route_id_; |
269 | 271 |
270 // Page ID at which prerendering started. | 272 // Page ID at which prerendering started. |
271 int32 starting_page_id_; | 273 int32 starting_page_id_; |
272 | 274 |
| 275 // Origin for this prerender. |
| 276 Origin origin_; |
| 277 |
273 // Offset by which to offset prerendered pages | 278 // Offset by which to offset prerendered pages |
274 static const int32 kPrerenderPageIdOffset = 10; | 279 static const int32 kPrerenderPageIdOffset = 10; |
275 | 280 |
276 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 281 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
277 }; | 282 }; |
278 | 283 |
279 } // namespace prerender | 284 } // namespace prerender |
280 | 285 |
281 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 286 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |