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

Unified Diff: chrome/browser/metrics/variations_service.h

Issue 10828255: Revert 150949 - Have the VariationsService attempt to fetch the seed when an update is ready. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/metrics/variations_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations_service.h
===================================================================
--- chrome/browser/metrics/variations_service.h (revision 151030)
+++ chrome/browser/metrics/variations_service.h (working copy)
@@ -11,14 +11,11 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
-#include "base/threading/non_thread_safe.h"
#include "base/time.h"
#include "base/timer.h"
#include "chrome/browser/metrics/proto/study.pb.h"
#include "chrome/browser/metrics/proto/trials_seed.pb.h"
#include "chrome/common/chrome_version_info.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_fetcher_delegate.h"
@@ -32,9 +29,7 @@
// Used to setup field trials based on stored variations seed data, and fetch
// new seed data from the variations server.
-class VariationsService : public net::URLFetcherDelegate,
- public content::NotificationObserver,
- public base::NonThreadSafe {
+class VariationsService : public net::URLFetcherDelegate {
public:
VariationsService();
virtual ~VariationsService();
@@ -49,15 +44,16 @@
// |CreateTrialsFromSeed|.
void StartRepeatedVariationsSeedFetch();
+ // Starts the fetching process once, where |OnURLFetchComplete| is called with
+ // the response.
+ void FetchVariationsSeed();
+
+ // net::URLFetcherDelegate implementation:
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
// Register Variations related prefs in Local State.
static void RegisterPrefs(PrefService* prefs);
- protected:
- // Starts the fetching process once, where |OnURLFetchComplete| is called with
- // the response. This is protected so we can override this for testing
- // purposes.
- virtual void FetchVariationsSeed();
-
private:
FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, CheckStudyChannel);
FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, CheckStudyLocale);
@@ -70,14 +66,6 @@
FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, StoreSeed);
FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, ValidateStudy);
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
- // Overridden from net::URLFetcherDelegate:
- virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
-
// Store the given seed data to the given local prefs. Note that |seed_data|
// is assumed to be the raw serialized protobuf data stored in a string. It
// will be Base64Encoded for storage. If the string is invalid or the encoding
@@ -137,10 +125,10 @@
// is pending, and will be reset by |OnURLFetchComplete|.
scoped_ptr<net::URLFetcher> pending_seed_request_;
- // The URL to use for querying the Variations server.
+ // The URL to use for querying the variations server.
GURL variations_server_url_;
- // Cached serial number from the most recently fetched Variations seed.
+ // Cached serial number from the most recently fetched variations seed.
std::string variations_serial_number_;
// Tracks whether |CreateTrialsFromSeed| has been called, to ensure that
@@ -151,9 +139,6 @@
// member so if VariationsService goes out of scope, the timer is
// automatically canceled.
base::RepeatingTimer<VariationsService> timer_;
-
- // The registrar used to manage our Notification registrations.
- content::NotificationRegistrar registrar_;
};
} // namespace chrome_variations
« no previous file with comments | « no previous file | chrome/browser/metrics/variations_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698