| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 "platform/metrics_collection/metrics_client.h" | 5 #include "platform/metrics_collection/metrics_client.h" |
| 6 #include <errno.h> | 6 #include <errno.h> |
| 7 #include <sys/file.h> | 7 #include <sys/file.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <cstdlib> |
| 10 #include <iostream> | 11 #include <iostream> |
| 11 #include "platform/metrics_collection/metrics_library.h" | 12 #include "platform/metrics_collection/metrics_library.h" |
| 12 | 13 |
| 13 using namespace std; | 14 using namespace std; |
| 14 | 15 |
| 15 void MetricsClient::ParseFile(FILE *input) { | 16 void MetricsClient::ParseFile(FILE *input) { |
| 16 // Open both Chrome and autotest files | 17 // Open both Chrome and autotest files |
| 17 bool autotest_file_opened = true; | 18 bool autotest_file_opened = true; |
| 18 bool chrome_file_opened = true; | 19 bool chrome_file_opened = true; |
| 19 FILE *autotest_file = fopen(kAutotestPath, "a+"); | 20 FILE *autotest_file = fopen(kAutotestPath, "a+"); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 MetricsLibrary::SendToAutotest(argv[metric_name_index], | 137 MetricsLibrary::SendToAutotest(argv[metric_name_index], |
| 137 argv[metric_value_index], NULL); | 138 argv[metric_value_index], NULL); |
| 138 } | 139 } |
| 139 if (send_to_chrome) { | 140 if (send_to_chrome) { |
| 140 MetricsLibrary::SendToChrome(argv[metric_name_index], | 141 MetricsLibrary::SendToChrome(argv[metric_name_index], |
| 141 argv[metric_value_index], -1); | 142 argv[metric_value_index], -1); |
| 142 } | 143 } |
| 143 } | 144 } |
| 144 return 0; | 145 return 0; |
| 145 } | 146 } |
| OLD | NEW |