OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/chromeos/external_metrics.h" | 5 #include "chrome/browser/chromeos/external_metrics.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // Announce the experiment to any listeners (especially important is the UMA | 84 // Announce the experiment to any listeners (especially important is the UMA |
85 // software, which will append the group names to UMA statistics). | 85 // software, which will append the group names to UMA statistics). |
86 const int group_num = trial->group(); | 86 const int group_num = trial->group(); |
87 std::string group_char = "x"; | 87 std::string group_char = "x"; |
88 if (ContainsKey(group_to_char, group_num)) | 88 if (ContainsKey(group_to_char, group_num)) |
89 group_char = group_to_char[group_num]; | 89 group_char = group_to_char[group_num]; |
90 | 90 |
91 // Write the group to the file to be read by ChromeOS. | 91 // Write the group to the file to be read by ChromeOS. |
92 int size = static_cast<int>(group_char.length()); | 92 int size = static_cast<int>(group_char.length()); |
93 if (file_util::WriteFile(group_file_path, group_char.c_str(), size) == size) { | 93 if (base::WriteFile(group_file_path, group_char.c_str(), size) == size) { |
94 VLOG(1) << "Configured in group '" << trial->group_name() | 94 VLOG(1) << "Configured in group '" << trial->group_name() |
95 << "' ('" << group_char << "') for " | 95 << "' ('" << group_char << "') for " |
96 << name_of_experiment << " field trial"; | 96 << name_of_experiment << " field trial"; |
97 } else { | 97 } else { |
98 VLOG(1) << "Couldn't write to " << group_file_path.value(); | 98 VLOG(1) << "Couldn't write to " << group_file_path.value(); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 } // namespace | 102 } // namespace |
103 | 103 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 void ExternalMetrics::SetupFieldTrialsOnFileThread() { | 352 void ExternalMetrics::SetupFieldTrialsOnFileThread() { |
353 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 353 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
354 // Field trials that do not read from files can be initialized in | 354 // Field trials that do not read from files can be initialized in |
355 // ExternalMetrics::Start() above. | 355 // ExternalMetrics::Start() above. |
356 SetupProgressiveScanFieldTrial(); | 356 SetupProgressiveScanFieldTrial(); |
357 | 357 |
358 ScheduleCollector(); | 358 ScheduleCollector(); |
359 } | 359 } |
360 | 360 |
361 } // namespace chromeos | 361 } // namespace chromeos |
OLD | NEW |