Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 ~PrerenderingLoader() override; | 39 ~PrerenderingLoader() override; |
| 40 | 40 |
| 41 // Loads a page in the background if possible and returns whether the | 41 // Loads a page in the background if possible and returns whether the |
| 42 // request was accepted. If so, the LoadPageCallback will be informed | 42 // request was accepted. If so, the LoadPageCallback will be informed |
| 43 // of status. Only one load request may exist as a time. If a previous | 43 // of status. Only one load request may exist as a time. If a previous |
| 44 // request is still in progress it must be stopped before a new | 44 // request is still in progress it must be stopped before a new |
| 45 // request will be accepted. The callback may be called more than | 45 // request will be accepted. The callback may be called more than |
| 46 // once - first for a successful load and then if canceled after the | 46 // once - first for a successful load and then if canceled after the |
| 47 // load (which may be from resources being reclaimed) at which point | 47 // load (which may be from resources being reclaimed) at which point |
| 48 // the retrieved WebContents should no longer be used. | 48 // the retrieved WebContents should no longer be used. |
| 49 virtual bool LoadPage(const GURL& url, const LoadPageCallback& callback); | 49 virtual bool LoadPage(const GURL& url, LoadPageCallback callback); |
|
Pete Williamson
2016/06/08 17:32:16
Generally speaking, we like to pass classes by poi
dougarnett
2016/06/08 20:02:31
Done - holding copy of callback, fixed param signa
| |
| 50 | 50 |
| 51 // Stops (completes or cancels) the load request. Must be called when | 51 // Stops (completes or cancels) the load request. Must be called when |
| 52 // LoadPageCallback is done with consuming the contents. May be called | 52 // LoadPageCallback is done with consuming the contents. May be called |
| 53 // prior to LoadPageCallback in order to cancel the current request (in | 53 // prior to LoadPageCallback in order to cancel the current request (in |
| 54 // which case the callback will not be run). | 54 // which case the callback will not be run). |
| 55 // This loader should also be responsible for stopping offline | 55 // This loader should also be responsible for stopping offline |
| 56 // prerenders when Chrome is transitioned to foreground. | 56 // prerenders when Chrome is transitioned to foreground. |
| 57 virtual void StopLoading(); | 57 virtual void StopLoading(); |
| 58 | 58 |
| 59 // Returns whether prerendering is possible for this device's configuration | 59 // Returns whether prerendering is possible for this device's configuration |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 // Callback to call when the active load request completes, fails, or is | 117 // Callback to call when the active load request completes, fails, or is |
| 118 // canceled. | 118 // canceled. |
| 119 LoadPageCallback callback_; | 119 LoadPageCallback callback_; |
| 120 | 120 |
| 121 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); | 121 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace offline_pages | 124 } // namespace offline_pages |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 126 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| OLD | NEW |