| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 base::TimeTicks load_start_time() const { return load_start_time_; } | 199 base::TimeTicks load_start_time() const { return load_start_time_; } |
| 200 | 200 |
| 201 // Indicates whether this prerendered page can be used for the provided | 201 // Indicates whether this prerendered page can be used for the provided |
| 202 // |url| and |session_storage_namespace|. | 202 // |url| and |session_storage_namespace|. |
| 203 bool Matches( | 203 bool Matches( |
| 204 const GURL& url, | 204 const GURL& url, |
| 205 const content::SessionStorageNamespace* session_storage_namespace) const; | 205 const content::SessionStorageNamespace* session_storage_namespace) const; |
| 206 | 206 |
| 207 // content::WebContentsObserver implementation. | 207 // content::WebContentsObserver implementation. |
| 208 virtual void RenderFrameCreated( | 208 virtual void RenderFrameCreated( |
| 209 content::RenderFrameHost* render_frame_host) OVERRIDE; | 209 content::RenderFrameHost* render_frame_host) override; |
| 210 virtual void DidStopLoading( | 210 virtual void DidStopLoading( |
| 211 content::RenderViewHost* render_view_host) OVERRIDE; | 211 content::RenderViewHost* render_view_host) override; |
| 212 virtual void DocumentLoadedInFrame( | 212 virtual void DocumentLoadedInFrame( |
| 213 content::RenderFrameHost* render_frame_host) OVERRIDE; | 213 content::RenderFrameHost* render_frame_host) override; |
| 214 virtual void DidStartProvisionalLoadForFrame( | 214 virtual void DidStartProvisionalLoadForFrame( |
| 215 content::RenderFrameHost* render_frame_host, | 215 content::RenderFrameHost* render_frame_host, |
| 216 const GURL& validated_url, | 216 const GURL& validated_url, |
| 217 bool is_error_page, | 217 bool is_error_page, |
| 218 bool is_iframe_srcdoc) OVERRIDE; | 218 bool is_iframe_srcdoc) override; |
| 219 virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host, | 219 virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 220 const GURL& validated_url) OVERRIDE; | 220 const GURL& validated_url) override; |
| 221 virtual void DidNavigateMainFrame( | 221 virtual void DidNavigateMainFrame( |
| 222 const content::LoadCommittedDetails& details, | 222 const content::LoadCommittedDetails& details, |
| 223 const content::FrameNavigateParams& params) OVERRIDE; | 223 const content::FrameNavigateParams& params) override; |
| 224 virtual void DidGetRedirectForResourceRequest( | 224 virtual void DidGetRedirectForResourceRequest( |
| 225 content::RenderViewHost* render_view_host, | 225 content::RenderViewHost* render_view_host, |
| 226 const content::ResourceRedirectDetails& details) OVERRIDE; | 226 const content::ResourceRedirectDetails& details) override; |
| 227 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 227 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 228 | 228 |
| 229 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 229 virtual void RenderProcessGone(base::TerminationStatus status) override; |
| 230 | 230 |
| 231 // content::NotificationObserver | 231 // content::NotificationObserver |
| 232 virtual void Observe(int type, | 232 virtual void Observe(int type, |
| 233 const content::NotificationSource& source, | 233 const content::NotificationSource& source, |
| 234 const content::NotificationDetails& details) OVERRIDE; | 234 const content::NotificationDetails& details) override; |
| 235 | 235 |
| 236 // Checks that a URL may be prerendered, for one of the many redirections. If | 236 // Checks that a URL may be prerendered, for one of the many redirections. If |
| 237 // the URL can not be prerendered - for example, it's an ftp URL - |this| will | 237 // the URL can not be prerendered - for example, it's an ftp URL - |this| will |
| 238 // be destroyed and false is returned. Otherwise, true is returned. | 238 // be destroyed and false is returned. Otherwise, true is returned. |
| 239 virtual bool CheckURL(const GURL& url); | 239 virtual bool CheckURL(const GURL& url); |
| 240 | 240 |
| 241 // Adds an alias URL. If the URL can not be prerendered, |this| will be | 241 // Adds an alias URL. If the URL can not be prerendered, |this| will be |
| 242 // destroyed and false is returned. | 242 // destroyed and false is returned. |
| 243 bool AddAliasURL(const GURL& url); | 243 bool AddAliasURL(const GURL& url); |
| 244 | 244 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 // A running tally of the number of bytes this prerender has caused to be | 465 // A running tally of the number of bytes this prerender has caused to be |
| 466 // transferred over the network for resources. Updated with AddNetworkBytes. | 466 // transferred over the network for resources. Updated with AddNetworkBytes. |
| 467 int64 network_bytes_; | 467 int64 network_bytes_; |
| 468 | 468 |
| 469 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 469 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 470 }; | 470 }; |
| 471 | 471 |
| 472 } // namespace prerender | 472 } // namespace prerender |
| 473 | 473 |
| 474 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 474 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |