prerender_controller.h 1006 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef WEBLAYER_PUBLIC_PRERENDER_CONTROLLER_H_
  5. #define WEBLAYER_PUBLIC_PRERENDER_CONTROLLER_H_
  6. class GURL;
  7. namespace weblayer {
  8. // PrerenderController enables prerendering of urls.
  9. // Prerendering has the same effect as adding a link rel="prerender" resource
  10. // hint to a web page. It is implemented using NoStatePrefetch and fetches
  11. // resources needed for a url in advance, but does not execute Javascript or
  12. // render any part of the page in advance. For more information on
  13. // NoStatePrefetch, see
  14. // https://developers.google.com/web/updates/2018/07/nostate-prefetch.
  15. class PrerenderController {
  16. public:
  17. virtual void Prerender(const GURL& url) = 0;
  18. virtual void DestroyAllContents() = 0;
  19. protected:
  20. virtual ~PrerenderController() = default;
  21. };
  22. } // namespace weblayer
  23. #endif // WEBLAYER_PUBLIC_PRERENDER_CONTROLLER_H_