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_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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 void MakeIntoDummyReplacementOf( | 97 void MakeIntoDummyReplacementOf( |
98 const PrerenderContents* original_prerender_contents); | 98 const PrerenderContents* original_prerender_contents); |
99 | 99 |
100 bool Init(); | 100 bool Init(); |
101 | 101 |
102 static Factory* CreateFactory(); | 102 static Factory* CreateFactory(); |
103 | 103 |
104 // Start rendering the contents in the prerendered state. If | 104 // Start rendering the contents in the prerendered state. If |
105 // |is_control_group| is true, this will go through some of the mechanics of | 105 // |is_control_group| is true, this will go through some of the mechanics of |
106 // starting a prerender, without actually creating the RenderView. | 106 // starting a prerender, without actually creating the RenderView. |
107 // |creator_child_id| is the id of the child process that caused the prerender | 107 // |creator_child_id| is the id of the child process that caused the prerender |
dominich
2012/09/12 15:21:04
comment needs ref to prerender_id
| |
108 // to be created, and is needed so that the prerendered URLs can be sent to it | 108 // to be created, and is needed so that the prerendered URLs can be sent to it |
109 // so render-initiated navigations will swap in the prerendered page. |size| | 109 // so render-initiated navigations will swap in the prerendered page. |size| |
110 // indicates the rectangular dimensions that the prerendered page should be. | 110 // indicates the rectangular dimensions that the prerendered page should be. |
111 // |session_storage_namespace| indicates the namespace that the prerendered | 111 // |session_storage_namespace| indicates the namespace that the prerendered |
112 // page should be part of. | 112 // page should be part of. |
113 virtual void StartPrerendering( | 113 virtual void StartPrerendering( |
114 int creator_child_id, | 114 int creator_child_id, |
115 int prerender_id, | |
115 const gfx::Size& size, | 116 const gfx::Size& size, |
116 content::SessionStorageNamespace* session_storage_namespace, | 117 content::SessionStorageNamespace* session_storage_namespace, |
117 bool is_control_group); | 118 bool is_control_group); |
118 | 119 |
119 // Verifies that the prerendering is not using too many resources, and kills | 120 // Verifies that the prerendering is not using too many resources, and kills |
120 // it if not. | 121 // it if not. |
121 void DestroyWhenUsingTooManyResources(); | 122 void DestroyWhenUsingTooManyResources(); |
122 | 123 |
123 content::RenderViewHost* GetRenderViewHostMutable(); | 124 content::RenderViewHost* GetRenderViewHostMutable(); |
124 const content::RenderViewHost* GetRenderViewHost() const; | 125 const content::RenderViewHost* GetRenderViewHost() const; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 | 374 |
374 // Experiment during which this prerender is performed. | 375 // Experiment during which this prerender is performed. |
375 uint8 experiment_id_; | 376 uint8 experiment_id_; |
376 | 377 |
377 // List of all pages the prerendered page has tried to prerender. | 378 // List of all pages the prerendered page has tried to prerender. |
378 std::vector<PendingPrerenderInfo> pending_prerenders_; | 379 std::vector<PendingPrerenderInfo> pending_prerenders_; |
379 | 380 |
380 // The process that created the child id. | 381 // The process that created the child id. |
381 int creator_child_id_; | 382 int creator_child_id_; |
382 | 383 |
384 // The prerender id from the launcher. | |
385 int prerender_id_; | |
386 | |
383 // The size of the WebView from the launching page. | 387 // The size of the WebView from the launching page. |
384 gfx::Size size_; | 388 gfx::Size size_; |
385 | 389 |
386 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 390 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
387 }; | 391 }; |
388 | 392 |
389 } // namespace prerender | 393 } // namespace prerender |
390 | 394 |
391 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 395 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |