Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc

Issue 2506103002: [Offline Pages] Fix test harness not using default policy. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
diff --git a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
index 1d138ad90a24d5c4101be3e94e50a174f957f34d..73531ca38d4a9dc1ced6b2f0948b702a99f8095c 100644
--- a/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
+++ b/chrome/browser/android/offline_pages/evaluation/offline_page_evaluation_bridge.cc
@@ -47,11 +47,6 @@ namespace offline_pages {
namespace android {
namespace {
-const bool kPreferUntriedRequest = false;
-const bool kPreferEarlierRequest = true;
-const bool kPreferRetryCountOverRecency = false;
-const int kMaxStartedTries = 4;
-const int kMaxCompletedTries = 1;
const int kImmediateRequestExpirationTimeInSeconds = 3600;
void ToJavaOfflinePageList(JNIEnv* env,
@@ -172,9 +167,13 @@ OfflinePageEvaluationBridge::GetTestingRequestCoordinator(
content::BrowserContext* context) {
// Create a new OfflinerPolicy with a larger background processing
// budget (3600 sec). Other values are the same with default ones.
+ OfflinerPolicy default_policy;
std::unique_ptr<OfflinerPolicy> policy(new OfflinerPolicy(
- kPreferUntriedRequest, kPreferEarlierRequest,
- kPreferRetryCountOverRecency, kMaxStartedTries, kMaxCompletedTries,
+ default_policy.ShouldPreferUntriedRequests(),
+ default_policy.ShouldPreferEarlierRequests(),
+ default_policy.RetryCountIsMoreImportantThanRecency(),
+ default_policy.GetMaxStartedTries(),
+ default_policy.GetMaxCompletedTries(),
kImmediateRequestExpirationTimeInSeconds));
dougarnett 2016/11/16 20:16:42 I was confused by this name - consider something l
std::unique_ptr<OfflinerFactory> prerenderer_offliner(
new PrerenderingOfflinerFactory(context));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698