Chromium Code Reviews| Index: chrome/browser/android/offline_pages/prerendering_loader.h |
| diff --git a/chrome/browser/android/offline_pages/prerendering_loader.h b/chrome/browser/android/offline_pages/prerendering_loader.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..838d21151d14c0f29d1b5f4e980d3561f011be98 |
| --- /dev/null |
| +++ b/chrome/browser/android/offline_pages/prerendering_loader.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| +#define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "components/offline_pages/background/offliner.h" |
| + |
| +class GURL; |
| +class PrerenderManager; |
| +class Profile; |
| + |
| +namespace content { |
| +class WebContents; |
| +class SessionStorageNamespace; |
| +} // namespace content |
| + |
| +namespace gfx { |
| +class Size; |
| +} // namespace gfx |
| + |
| +namespace offline_pages { |
| + |
| +// A client-side page loader that integrates with the PrerenderManager to do |
| +// the page loading in the background. |
| +class PrerenderingLoader { |
| + public: |
| + typedef base::Callback<void( |
| + Offliner::CompletionStatus, |
| + content::WebContents*)> LoadPageCallback; |
| + |
| + explicit PrerenderingLoader(Profile* profile); |
| + ~PrerenderingLoader(); |
| + |
| + bool LoadPage( |
| + const GURL url, |
|
fgorski
2016/04/28 11:32:20
const ref
dougarnett
2016/04/28 20:13:13
Done.
|
| + content::SessionStorageNamespace* session_storage_namespace, |
| + const gfx::Size& size, |
| + const LoadPageCallback& callback); |
| + |
| + void StopLoad(); |
|
fgorski
2016/04/28 11:32:20
nit: StopLoading? Also Cancel is perfect here.
dougarnett
2016/04/28 20:13:13
Done.
|
| + |
| + private: |
| + // Not owned. |
| + Profile* profile_; |
|
fgorski
2016/04/28 11:32:20
Not sure if that is doable, but see if you can wor
dougarnett
2016/04/28 20:13:13
updated to pass in PrerenderManager instead
|
| + PrerenderManager* manager_; |
| +}; |
| + |
| +} // namespace offline_pages |
| + |
| +#endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |