| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const char* user_agent, | 64 const char* user_agent, |
| 65 DWORD interval, | 65 DWORD interval, |
| 66 StatsUploader* stats_uploader) { | 66 StatsUploader* stats_uploader) { |
| 67 PersistentMetricsIteratorWin32 it(PRODUCT_NAME_STRING_WIDE), end; | 67 PersistentMetricsIteratorWin32 it(PRODUCT_NAME_STRING_WIDE), end; |
| 68 Formatter formatter(CStringA(PRODUCT_NAME_STRING), interval); | 68 Formatter formatter(CStringA(PRODUCT_NAME_STRING), interval); |
| 69 | 69 |
| 70 for (; it != end; ++it) | 70 for (; it != end; ++it) |
| 71 formatter.AddMetric(*it); | 71 formatter.AddMetric(*it); |
| 72 DLOG(INFO) << "formatter.output() = " << formatter.output(); | 72 DLOG(INFO) << "formatter.output() = " << formatter.output(); |
| 73 return stats_uploader->UploadMetrics(extra_url_data, user_agent, | 73 return stats_uploader->UploadMetrics(extra_url_data, user_agent, |
| 74 formatter.output()); | 74 formatter.output().c_str()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void ResetPersistentMetrics(CRegKey *key) { | 77 void ResetPersistentMetrics(CRegKey *key) { |
| 78 key->DeleteValue(kLastTransmissionTimeValueName); | 78 key->DeleteValue(kLastTransmissionTimeValueName); |
| 79 key->DeleteSubKey(kCountsKeyName); | 79 key->DeleteSubKey(kCountsKeyName); |
| 80 key->DeleteSubKey(kTimingsKeyName); | 80 key->DeleteSubKey(kTimingsKeyName); |
| 81 key->DeleteSubKey(kIntegersKeyName); | 81 key->DeleteSubKey(kIntegersKeyName); |
| 82 key->DeleteSubKey(kBooleansKeyName); | 82 key->DeleteSubKey(kBooleansKeyName); |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Used primarily for testing. Default functionality. | 183 // Used primarily for testing. Default functionality. |
| 184 bool StatsUploader::UploadMetrics(const char* extra_url_data, | 184 bool StatsUploader::UploadMetrics(const char* extra_url_data, |
| 185 const char* user_agent, | 185 const char* user_agent, |
| 186 const char *content) { | 186 const char *content) { |
| 187 return stats_report::UploadMetrics(extra_url_data, user_agent, content); | 187 return stats_report::UploadMetrics(extra_url_data, user_agent, content); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace stats_report | 190 } // namespace stats_report |
| OLD | NEW |