| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void AddObserver(Observer* observer); | 100 void AddObserver(Observer* observer); |
| 101 void RemoveObserver(Observer* observer); | 101 void RemoveObserver(Observer* observer); |
| 102 | 102 |
| 103 bool Init(); | 103 bool Init(); |
| 104 | 104 |
| 105 // Set the mode of this contents. This must be called before prerender has | 105 // Set the mode of this contents. This must be called before prerender has |
| 106 // started. | 106 // started. |
| 107 void SetPrerenderMode(PrerenderMode mode); | 107 void SetPrerenderMode(PrerenderMode mode); |
| 108 PrerenderMode prerender_mode() const { return prerender_mode_; } | 108 PrerenderMode prerender_mode() const { return prerender_mode_; } |
| 109 | 109 |
| 110 // Returns true iff the method given is valid for prerendering. |
| 111 bool IsValidHttpMethod(const std::string& method); |
| 112 |
| 110 static Factory* CreateFactory(); | 113 static Factory* CreateFactory(); |
| 111 | 114 |
| 112 // Returns a PrerenderContents from the given web_contents, if it's used for | 115 // Returns a PrerenderContents from the given web_contents, if it's used for |
| 113 // prerendering. Otherwise returns NULL. Handles a NULL input for | 116 // prerendering. Otherwise returns NULL. Handles a NULL input for |
| 114 // convenience. | 117 // convenience. |
| 115 static PrerenderContents* FromWebContents(content::WebContents* web_contents); | 118 static PrerenderContents* FromWebContents(content::WebContents* web_contents); |
| 116 | 119 |
| 117 // Start rendering the contents in the prerendered state. If | 120 // Start rendering the contents in the prerendered state. If |
| 118 // |is_control_group| is true, this will go through some of the mechanics of | 121 // |is_control_group| is true, this will go through some of the mechanics of |
| 119 // starting a prerender, without actually creating the RenderView. |bounds| | 122 // starting a prerender, without actually creating the RenderView. |bounds| |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // A running tally of the number of bytes this prerender has caused to be | 367 // A running tally of the number of bytes this prerender has caused to be |
| 365 // transferred over the network for resources. Updated with AddNetworkBytes. | 368 // transferred over the network for resources. Updated with AddNetworkBytes. |
| 366 int64_t network_bytes_; | 369 int64_t network_bytes_; |
| 367 | 370 |
| 368 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 371 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 369 }; | 372 }; |
| 370 | 373 |
| 371 } // namespace prerender | 374 } // namespace prerender |
| 372 | 375 |
| 373 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 376 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |