OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 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 #include "chrome/browser/origin_trials/origin_trial_controller.h" | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/command_line.h" | |
10 #include "chrome/common/chrome_switches.h" | |
11 #include "components/variations/variations_associated_data.h" | |
12 | |
13 const char OriginTrialController::kFieldTrialName[] = "OriginTrials"; | |
14 const char OriginTrialController::kPublicKeyFieldName[] = "PublicKey"; | |
15 | |
16 // static | |
17 void OriginTrialController::UpdateCommandLineFromFieldTrials( | |
18 base::CommandLine* command_line) { | |
19 DCHECK(command_line); | |
Alexei Svitkine (slow)
2016/02/26 16:29:08
Nit: Not needed.
iclelland
2016/02/26 19:55:04
Removed.
| |
20 | |
21 std::map<std::string, std::string> field_params; | |
22 if (!variations::GetVariationParams(kFieldTrialName, &field_params)) { | |
Alexei Svitkine (slow)
2016/02/26 16:29:08
Nit: No {}'s
iclelland
2016/02/26 19:55:04
Thanks; these were all leftovers from my in-develo
| |
23 return; | |
24 } | |
25 | |
26 std::string override_public_key = field_params[kPublicKeyFieldName]; | |
27 if (override_public_key.size()) { | |
Alexei Svitkine (slow)
2016/02/26 16:29:08
Nit: !.empty()
iclelland
2016/02/26 19:55:04
Done.
| |
28 command_line->AppendSwitchASCII(switches::kOriginTrialPublicKey, | |
29 override_public_key); | |
Alexei Svitkine (slow)
2016/02/26 16:29:08
I'm not a big fan of plumbing this through the com
iclelland
2016/02/26 16:49:14
I wrote the command-line handling code first, as a
Alexei Svitkine (slow)
2016/02/26 17:32:20
Ah, you're right - I missed that you're checking i
| |
30 } | |
31 } | |
OLD | NEW |