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

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: 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
SteveT 2012/05/03 04:02:52 nit: extra break here not needed
jwd 2012/05/03 22:27:49 fixed On 2012/05/03 04:02:52, SteveT wrote:
19 VariationsService() {}
20
SteveT 2012/05/03 04:02:52 nit: extra break here not needed
jwd 2012/05/03 22:27:49 fixed On 2012/05/03 04:02:52, SteveT wrote:
21 virtual ~VariationsService() {}
Ilya Sherman 2012/05/02 23:15:08 nit: It's a violation of the style guide to inline
jwd 2012/05/03 22:27:49 fixed On 2012/05/02 23:15:08, Ilya Sherman wrote:
22
SteveT 2012/05/03 04:02:52 Methods below can probably be alphabetized (and in
23 // Loads the Variations seed data from the given local prefs.
24 void LoadVariationsSeed(PrefService* local_prefs);
25
26 void FetchVariationsSeed();
SteveT 2012/05/03 04:02:52 nit: Maybe StartFetchingVariationsSeed is a better
SteveT 2012/05/03 04:02:52 Document, please. Remember to point out where the
jwd 2012/05/03 22:27:49 Agreed, fixed On 2012/05/03 04:02:52, SteveT wrote
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
27
28 // content::URLFetcherDelegate implementation:
29 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
30
31 // Store the given seed data to the given local prefs. Note that |seed_data|
32 // is assumed to be the raw data stored in a string. It will Base64Encoded for
SteveT 2012/05/03 04:02:52 nit: assumed to be the raw *what* data? Raw protob
jwd 2012/05/03 22:27:49 Fixed. On 2012/05/03 04:02:52, SteveT wrote:
33 // storage. If the string is invalid or the encoding fails, the |local_prefs|
34 // is left as is.
35 void StoreSeedData(std::string seed_data, PrefService* local_prefs);
SteveT 2012/05/03 04:02:52 I think you can make seed_data a const ref.
SteveT 2012/05/03 04:02:52 I think StoreSeedData can probably be private?
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
36
37 // Register Variations related prefs in Lacal State.
SteveT 2012/05/03 04:02:52 sp: Lacal -> Local
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
38 static void RegisterPrefs(PrefService* prefs);
39
40 // Default server of Variations seed info.
41 static const char* kDefaultVariationsServer;
Ilya Sherman 2012/05/02 23:15:08 nit: This should probably be "const char kDefaultV
Ilya Sherman 2012/05/02 23:15:08 nit: Does this need to be exposed in the header fi
SteveT 2012/05/03 04:02:52 Currently this doesn't need to be publically expos
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
42
43 private:
44
SteveT 2012/05/03 04:02:52 nit: extra break here not needed
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
45 scoped_ptr<content::URLFetcher> seed_request_pending_;
Ilya Sherman 2012/05/02 23:15:08 nit: The current name sounds like it is describing
SteveT 2012/05/03 04:02:52 Please document.
jwd 2012/05/03 22:27:49 Agreed, fixed. On 2012/05/02 23:15:08, Ilya Sherma
jwd 2012/05/03 22:27:49 Fixed On 2012/05/03 04:02:52, SteveT wrote:
46 // The variations seed data being used for this session.
47 chrome_variations::TrialsSeed variations_seed_;
48 };
49
50 #endif // CHROME_BROWSER_METRICS_VARIATIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698