Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: chrome/browser/metrics/metrics_service.cc

Issue 149758: Enable Client ID generation on Linux/OS X. Enables UMA logging. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 6
7 //------------------------------------------------------------------------------ 7 //------------------------------------------------------------------------------
8 // Description of the life cycle of a instance of MetricsService. 8 // Description of the life cycle of a instance of MetricsService.
9 // 9 //
10 // OVERVIEW 10 // OVERVIEW
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 GUID guid; 756 GUID guid;
757 HRESULT guid_result = CoCreateGuid(&guid); 757 HRESULT guid_result = CoCreateGuid(&guid);
758 DCHECK(SUCCEEDED(guid_result)); 758 DCHECK(SUCCEEDED(guid_result));
759 759
760 std::wstring guid_string; 760 std::wstring guid_string;
761 int result = StringFromGUID2(guid, 761 int result = StringFromGUID2(guid,
762 WriteInto(&guid_string, kGUIDSize), kGUIDSize); 762 WriteInto(&guid_string, kGUIDSize), kGUIDSize);
763 DCHECK(result == kGUIDSize); 763 DCHECK(result == kGUIDSize);
764 764
765 return WideToUTF8(guid_string.substr(1, guid_string.length() - 2)); 765 return WideToUTF8(guid_string.substr(1, guid_string.length() - 2));
766 #elif defined(LINUX2) 766 #else
767 uint64 sixteen_bytes[2] = { base::RandUint64(), base::RandUint64() }; 767 uint64 sixteen_bytes[2] = { base::RandUint64(), base::RandUint64() };
768 return RandomBytesToGUIDString(sixteen_bytes); 768 return RandomBytesToGUIDString(sixteen_bytes);
769 #else
770 // TODO(cmasone): enable the above for all OS_POSIX platforms once the
771 // first-run dialog text is all up to date.
772 NOTIMPLEMENTED();
773 return std::string();
774 #endif 769 #endif
775 } 770 }
776 771
777 #if defined(OS_POSIX) 772 #if defined(OS_POSIX)
778 // TODO(cmasone): Once we're comfortable this works, migrate Windows code to 773 // TODO(cmasone): Once we're comfortable this works, migrate Windows code to
779 // use this as well. 774 // use this as well.
780 std::string MetricsService::RandomBytesToGUIDString(const uint64 bytes[2]) { 775 std::string MetricsService::RandomBytesToGUIDString(const uint64 bytes[2]) {
781 return StringPrintf("%08llX-%04llX-%04llX-%04llX-%012llX", 776 return StringPrintf("%08llX-%04llX-%04llX-%04llX-%012llX",
782 bytes[0] >> 32, 777 bytes[0] >> 32,
783 (bytes[0] >> 16) & 0x0000ffff, 778 (bytes[0] >> 16) & 0x0000ffff,
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 L"." + key; 1916 L"." + key;
1922 prof_prefs->SetInteger(pref_key.c_str(), value); 1917 prof_prefs->SetInteger(pref_key.c_str(), value);
1923 } 1918 }
1924 1919
1925 static bool IsSingleThreaded() { 1920 static bool IsSingleThreaded() {
1926 static PlatformThreadId thread_id = 0; 1921 static PlatformThreadId thread_id = 0;
1927 if (!thread_id) 1922 if (!thread_id)
1928 thread_id = PlatformThread::CurrentId(); 1923 thread_id = PlatformThread::CurrentId();
1929 return PlatformThread::CurrentId() == thread_id; 1924 return PlatformThread::CurrentId() == thread_id;
1930 } 1925 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698