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

Side by Side Diff: chrome/browser/metrics/variations_service.h

Issue 10343007: Retrieving Chrome Variations seed from server and storing in local prefs. Loading seed data from lo… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing many nits Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_SERVICE_H_
6 #define CHROME_BROWSER_METRICS_VARIATIONS_SERVICE_H_
7 #pragma once
8
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/metrics/proto/trials_seed.pb.h"
12 #include "content/public/common/url_fetcher_delegate.h"
13
14 class PrefService;
15
16 class VariationsService : public content::URLFetcherDelegate {
17 public:
18 VariationsService();
19 virtual ~VariationsService();
20
21 // Loads the Variations seed data from the given local prefs. If there is a
22 // problem with loading, the pref value is cleared.
23 void LoadVariationsSeed(PrefService* local_prefs);
24
25 // Starts the fetching process, where |OnURLFetchComplete| is called with the
26 // response.
27 void StartFetchingVariationsSeed();
28
29 // content::URLFetcherDelegate implementation:
30 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
31
32
MAD 2012/05/04 12:29:57 Single empty line please...
jwd 2012/05/04 19:33:06 Done.
33 // Register Variations related prefs in Local State.
34 static void RegisterPrefs(PrefService* prefs);
35
36 private:
37 // Store the given seed data to the given local prefs. Note that |seed_data|
38 // is assumed to be the raw serialized protobuf data stored in a string. It
39 // will Base64Encoded for storage. If the string is invalid or the encoding
MAD 2012/05/04 12:29:57 will BE Base...
jwd 2012/05/04 19:33:06 Done.
40 // fails, the |local_prefs| is left as is.
41 void StoreSeedData(const std::string& seed_data, PrefService* local_prefs);
42
43 // Contains the current seed request. Will only have a value while a request
44 // is pending, and will be reset by |OnURLFetchComplete|.
45 scoped_ptr<content::URLFetcher> pending_seed_request_;
46
47 // The variations seed data being used for this session.
48 chrome_variations::TrialsSeed variations_seed_;
MAD 2012/05/04 12:29:57 I don't think we will use the variations_seed_ dat
jwd 2012/05/04 19:33:06 Based on in person conversation, this won't be nee
49 };
50
51 #endif // CHROME_BROWSER_METRICS_VARIATIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698