Chromium Code Reviews| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 | 197 |
| 198 // The prerender WebContents (may be NULL). | 198 // The prerender WebContents (may be NULL). |
| 199 content::WebContents* prerender_contents() const { | 199 content::WebContents* prerender_contents() const { |
| 200 return prerender_contents_.get(); | 200 return prerender_contents_.get(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 std::unique_ptr<content::WebContents> ReleasePrerenderContents(); | 203 std::unique_ptr<content::WebContents> ReleasePrerenderContents(); |
| 204 | 204 |
| 205 // Sets the final status, calls OnDestroy and adds |this| to the | 205 // Sets the final status, calls OnDestroy and adds |this| to the |
| 206 // PrerenderManager's pending deletes list. | 206 // PrerenderManager's pending deletes list. |
| 207 void Destroy(FinalStatus reason); | 207 virtual void Destroy(FinalStatus reason); |
|
droger
2016/09/20 10:57:19
Add a comment:
// Virtual for testing.
I think it
mattcary
2016/09/21 08:45:10
That's not a bad idea. Why multiply observers if w
| |
| 208 | 208 |
| 209 // Called by the history tab helper with the information that it woudl have | 209 // Called by the history tab helper with the information that it woudl have |
| 210 // added to the history service had this web contents not been used for | 210 // added to the history service had this web contents not been used for |
| 211 // prerendering. | 211 // prerendering. |
| 212 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); | 212 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); |
| 213 | 213 |
| 214 // Applies all the URL history encountered during prerendering to the | 214 // Applies all the URL history encountered during prerendering to the |
| 215 // new tab. | 215 // new tab. |
| 216 void CommitHistory(content::WebContents* tab); | 216 void CommitHistory(content::WebContents* tab); |
| 217 | 217 |
| (...skipping 146 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 | 364 // A running tally of the number of bytes this prerender has caused to be |
| 365 // transferred over the network for resources. Updated with AddNetworkBytes. | 365 // transferred over the network for resources. Updated with AddNetworkBytes. |
| 366 int64_t network_bytes_; | 366 int64_t network_bytes_; |
| 367 | 367 |
| 368 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 368 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 369 }; | 369 }; |
| 370 | 370 |
| 371 } // namespace prerender | 371 } // namespace prerender |
| 372 | 372 |
| 373 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 373 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |