| 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is created at ChromeFrame startup in | 10 // A MetricsService instance is created at ChromeFrame startup in |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // TODO(robertshield): Chrome Frame shouldn't generate a new ID on every run | 304 // TODO(robertshield): Chrome Frame shouldn't generate a new ID on every run |
| 305 // as this apparently breaks some assumptions during metric analysis. | 305 // as this apparently breaks some assumptions during metric analysis. |
| 306 // See http://crbug.com/117188 | 306 // See http://crbug.com/117188 |
| 307 if (client_id_.empty()) { | 307 if (client_id_.empty()) { |
| 308 const int kGUIDSize = 39; | 308 const int kGUIDSize = 39; |
| 309 | 309 |
| 310 GUID guid; | 310 GUID guid; |
| 311 HRESULT guid_result = CoCreateGuid(&guid); | 311 HRESULT guid_result = CoCreateGuid(&guid); |
| 312 DCHECK(SUCCEEDED(guid_result)); | 312 DCHECK(SUCCEEDED(guid_result)); |
| 313 | 313 |
| 314 string16 guid_string; | 314 base::string16 guid_string; |
| 315 int result = StringFromGUID2(guid, | 315 int result = StringFromGUID2(guid, |
| 316 WriteInto(&guid_string, kGUIDSize), kGUIDSize); | 316 WriteInto(&guid_string, kGUIDSize), kGUIDSize); |
| 317 DCHECK(result == kGUIDSize); | 317 DCHECK(result == kGUIDSize); |
| 318 client_id_ = WideToUTF8(guid_string.substr(1, guid_string.length() - 2)); | 318 client_id_ = WideToUTF8(guid_string.substr(1, guid_string.length() - 2)); |
| 319 } | 319 } |
| 320 return client_id_; | 320 return client_id_; |
| 321 } | 321 } |
| 322 | 322 |
| 323 // static | 323 // static |
| 324 void CALLBACK MetricsService::TransmissionTimerProc(HWND window, | 324 void CALLBACK MetricsService::TransmissionTimerProc(HWND window, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 version += "-F"; | 454 version += "-F"; |
| 455 if (!version_info.IsOfficialBuild()) | 455 if (!version_info.IsOfficialBuild()) |
| 456 version.append("-devel"); | 456 version.append("-devel"); |
| 457 return version; | 457 return version; |
| 458 } else { | 458 } else { |
| 459 NOTREACHED() << "Unable to retrieve version string."; | 459 NOTREACHED() << "Unable to retrieve version string."; |
| 460 } | 460 } |
| 461 | 461 |
| 462 return std::string(); | 462 return std::string(); |
| 463 } | 463 } |
| OLD | NEW |