// Copyright 2016 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ #define COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_ namespace offline_pages { // The max number of started tries is to guard against pages that make the // background loader crash. It should be greater than or equal to the max // number of completed tries. constexpr int kMaxStartedTries = …; // The number of max completed tries is based on Gin2G-poor testing showing that // we often need about 4 tries with a 2 minute window, or 3 retries with a 3 // minute window. Also, we count one try now for foreground/disabled requests. constexpr int kMaxCompletedTries = …; // By the time we get to a week, the user has forgotten asking for a page. constexpr int kRequestExpirationTimeInSeconds = …; // Scheduled background processing time limits. constexpr int kDozeModeBackgroundServiceWindowSeconds = …; constexpr int kDefaultBackgroundProcessingTimeBudgetSeconds = …; constexpr int kSinglePageTimeLimitWhenBackgroundScheduledSeconds = …; // Immediate processing time limits. Note: experiments on GIN-2g-poor show many // page requests took 3 or 4 attempts in background scheduled mode with timeout // of 2 minutes. So for immediate processing mode, give page requests just under // 5 minutes, which was equal to the timeout limit in prerender. Then budget up // to 3 of those requests in processing window. // TODO(petewil): Consider if we want to up the immediate window to 8 minutes // now that we are always using the background loader. constexpr int kSinglePageTimeLimitForImmediateLoadSeconds = …; constexpr int kImmediateLoadProcessingTimeBudgetSeconds = …; // Policy for the Background Offlining system. Some policy will belong to the // RequestCoordinator, some to the RequestQueue, and some to the Offliner. class OfflinerPolicy { … }; } // namespace offline_pages #endif // COMPONENTS_OFFLINE_PAGES_CORE_BACKGROUND_OFFLINER_POLICY_H_