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

Side by Side Diff: components/suggestions/suggestions_service.cc

Issue 421663003: Move variations component code to variations namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/suggestions/suggestions_service.h" 5 #include "components/suggestions/suggestions_service.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 // Will log the supplied response |state|. 47 // Will log the supplied response |state|.
48 void LogResponseState(SuggestionsResponseState state) { 48 void LogResponseState(SuggestionsResponseState state) {
49 UMA_HISTOGRAM_ENUMERATION("Suggestions.ResponseState", state, 49 UMA_HISTOGRAM_ENUMERATION("Suggestions.ResponseState", state,
50 RESPONSE_STATE_SIZE); 50 RESPONSE_STATE_SIZE);
51 } 51 }
52 52
53 // Obtains the experiment parameter under the supplied |key|, or empty string 53 // Obtains the experiment parameter under the supplied |key|, or empty string
54 // if the parameter does not exist. 54 // if the parameter does not exist.
55 std::string GetExperimentParam(const std::string& key) { 55 std::string GetExperimentParam(const std::string& key) {
56 return chrome_variations::GetVariationParamValue(kSuggestionsFieldTrialName, 56 return variations::GetVariationParamValue(kSuggestionsFieldTrialName, key);
57 key);
58 } 57 }
59 58
60 GURL BuildBlacklistRequestURL(const std::string& blacklist_url_prefix, 59 GURL BuildBlacklistRequestURL(const std::string& blacklist_url_prefix,
61 const GURL& candidate_url) { 60 const GURL& candidate_url) {
62 return GURL(blacklist_url_prefix + 61 return GURL(blacklist_url_prefix +
63 net::EscapeQueryParamValue(candidate_url.spec(), true)); 62 net::EscapeQueryParamValue(candidate_url.spec(), true));
64 } 63 }
65 64
66 // Runs each callback in |requestors| on |suggestions|, then deallocates 65 // Runs each callback in |requestors| on |suggestions|, then deallocates
67 // |requestors|. 66 // |requestors|.
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 if (last_request_successful) { 378 if (last_request_successful) {
380 blacklist_delay_sec_ = kBlacklistDefaultDelaySec; 379 blacklist_delay_sec_ = kBlacklistDefaultDelaySec;
381 } else { 380 } else {
382 int candidate_delay = blacklist_delay_sec_ * kBlacklistBackoffMultiplier; 381 int candidate_delay = blacklist_delay_sec_ * kBlacklistBackoffMultiplier;
383 if (candidate_delay < kBlacklistMaxDelaySec) 382 if (candidate_delay < kBlacklistMaxDelaySec)
384 blacklist_delay_sec_ = candidate_delay; 383 blacklist_delay_sec_ = candidate_delay;
385 } 384 }
386 } 385 }
387 386
388 } // namespace suggestions 387 } // namespace suggestions
OLDNEW
« no previous file with comments | « components/rappor/rappor_service.cc ('k') | components/suggestions/suggestions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698