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

Side by Side Diff: components/variations/variations_request_scheduler.cc

Issue 2223263002: Change variations service domain for Android Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/variations/variations_url_constants.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/variations/variations_request_scheduler.h" 5 #include "components/variations/variations_request_scheduler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 29 matching lines...) Expand all
40 task_); 40 task_);
41 } 41 }
42 42
43 void VariationsRequestScheduler::OnAppEnterForeground() { 43 void VariationsRequestScheduler::OnAppEnterForeground() {
44 NOTREACHED() << "Attempted to OnAppEnterForeground on non-mobile device"; 44 NOTREACHED() << "Attempted to OnAppEnterForeground on non-mobile device";
45 } 45 }
46 46
47 base::TimeDelta VariationsRequestScheduler::GetFetchPeriod() const { 47 base::TimeDelta VariationsRequestScheduler::GetFetchPeriod() const {
48 // The fetch interval can be overridden by a variation param. 48 // The fetch interval can be overridden by a variation param.
49 std::string period_min_str = 49 std::string period_min_str =
50 variations::GetVariationParamValue("VarationsServiceControl", 50 variations::GetVariationParamValue("VariationsServiceControl",
51 "fetch_period_min"); 51 "fetch_period_min");
52 size_t period_min; 52 size_t period_min;
53 if (base::StringToSizeT(period_min_str, &period_min)) 53 if (base::StringToSizeT(period_min_str, &period_min))
54 return base::TimeDelta::FromMinutes(period_min); 54 return base::TimeDelta::FromMinutes(period_min);
55 55
56 // The default fetch interval is every 30 minutes. 56 // The default fetch interval is every 30 minutes.
57 return base::TimeDelta::FromMinutes(30); 57 return base::TimeDelta::FromMinutes(30);
58 } 58 }
59 59
60 base::Closure VariationsRequestScheduler::task() const { 60 base::Closure VariationsRequestScheduler::task() const {
61 return task_; 61 return task_;
62 } 62 }
63 63
64 #if !defined(OS_ANDROID) && !defined(OS_IOS) 64 #if !defined(OS_ANDROID) && !defined(OS_IOS)
65 // static 65 // static
66 VariationsRequestScheduler* VariationsRequestScheduler::Create( 66 VariationsRequestScheduler* VariationsRequestScheduler::Create(
67 const base::Closure& task, 67 const base::Closure& task,
68 PrefService* local_state) { 68 PrefService* local_state) {
69 return new VariationsRequestScheduler(task); 69 return new VariationsRequestScheduler(task);
70 } 70 }
71 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) 71 #endif // !defined(OS_ANDROID) && !defined(OS_IOS)
72 72
73 } // namespace variations 73 } // namespace variations
OLDNEW
« no previous file with comments | « no previous file | components/variations/variations_url_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698