| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const content::Referrer& referrer, | 67 const content::Referrer& referrer, |
| 68 Origin origin) = 0; | 68 Origin origin) = 0; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 DISALLOW_COPY_AND_ASSIGN(Factory); | 71 DISALLOW_COPY_AND_ASSIGN(Factory); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class Observer { | 74 class Observer { |
| 75 public: | 75 public: |
| 76 // Signals that the prerender has started running. | 76 // Signals that the prerender has started running. |
| 77 virtual void OnPrerenderStart(PrerenderContents* contents) = 0; | 77 virtual void OnPrerenderStart(PrerenderContents* contents); |
| 78 | 78 |
| 79 // Signals that the prerender has had its load event. | 79 // Signals that the prerender has had its load event. |
| 80 virtual void OnPrerenderStopLoading(PrerenderContents* contents); | 80 virtual void OnPrerenderStopLoading(PrerenderContents* contents); |
| 81 | 81 |
| 82 // Signals that the prerender has had its 'DOMContentLoaded' event. | 82 // Signals that the prerender has had its 'DOMContentLoaded' event. |
| 83 virtual void OnPrerenderDomContentLoaded(PrerenderContents* contents); | 83 virtual void OnPrerenderDomContentLoaded(PrerenderContents* contents); |
| 84 | 84 |
| 85 // Signals that the prerender has stopped running. A PrerenderContents with | 85 // Signals that the prerender has stopped running. A PrerenderContents with |
| 86 // an unset final status will always call OnPrerenderStop before being | 86 // an unset final status will always call OnPrerenderStop before being |
| 87 // destroyed. | 87 // destroyed. |
| 88 virtual void OnPrerenderStop(PrerenderContents* contents) = 0; | 88 virtual void OnPrerenderStop(PrerenderContents* contents); |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 Observer(); | 91 Observer(); |
| 92 virtual ~Observer() = 0; | 92 virtual ~Observer() = 0; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 ~PrerenderContents() override; | 95 ~PrerenderContents() override; |
| 96 | 96 |
| 97 // All observers of a PrerenderContents are removed after the OnPrerenderStop | 97 // All observers of a PrerenderContents are removed after the OnPrerenderStop |
| 98 // event is sent, so there is no need to call RemoveObserver() in the normal | 98 // event is sent, so there is no need to call RemoveObserver() in the normal |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // 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 |
| 368 // transferred over the network for resources. Updated with AddNetworkBytes. | 368 // transferred over the network for resources. Updated with AddNetworkBytes. |
| 369 int64_t network_bytes_; | 369 int64_t network_bytes_; |
| 370 | 370 |
| 371 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 371 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
| 372 }; | 372 }; |
| 373 | 373 |
| 374 } // namespace prerender | 374 } // namespace prerender |
| 375 | 375 |
| 376 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 376 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
| OLD | NEW |