AppBannerDataFetcher currently performs the asynchronous fetching and validating of a site's installability (i.e. whether the site is a PWA). This includes:
- fetching a manifest
- checking its properties
- checking for a service worker
- fetching an app icon
This runs on every page load on Android. However, the fetched resources are not easily accessible outside the banner code, and more clients wish to do similar checks, including:
- add to homescreen (manifest + icon)
- WebAPKs (everything)
- etc.
The data fetcher functionality will be moved into a new InstallableChecker, which will act as a browser-process WebContents-scoped cache for app installability data. Clients will ask it for resources and provide a callback to be run when the resources are fetched/checked. Data that is multiply requested will not be re-fetched, reducing the number of IPCs required between the browser and renderer and reducing code duplication throughout banners, WebAPKs, add to homescreen, and future clients.
Splitting out the fetcher will improve the testability of the app banner code, and help consolidate the platform-specific functionality in the Android/Desktop managers, rather than splitting it between the managers and data fetchers.
AppBannerDataFetcher currently performs the asynchronous fetching and validating of a site's installability (i.e. whether the site is a PWA). This includes:
- fetching a manifest
- checking its properties
- checking for a service worker
- fetching an app icon
This runs on every page load on Android. However, the fetched resources are not easily accessible outside the banner code, and more clients wish to do similar checks, including:
- add to homescreen (manifest + icon)
- WebAPKs (everything)
- etc.
The data fetcher functionality will be moved into a new InstallableChecker, which will act as a browser-process WebContents-scoped cache for app installability data. Clients will ask it for resources and provide a callback to be run when the resources are fetched/checked. Data that is requested multiple times will not need to be re-fetched, reducing the number of IPCs between the browser and renderer and reducing code duplication throughout banners, WebAPKs, add to homescreen, and future clients.
Splitting out the fetcher will improve the testability of the app banner code, and help consolidate the platform-specific functionality in the Android/Desktop managers, rather than splitting it between the managers and data fetchers.
Comment 1 by dominickn@chromium.org
, Jul 18 2016