OLD | NEW |
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 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 default: | 1695 default: |
1696 NOTREACHED() << "Unexpected notification type " << type.value; | 1696 NOTREACHED() << "Unexpected notification type " << type.value; |
1697 return; | 1697 return; |
1698 } | 1698 } |
1699 } | 1699 } |
1700 | 1700 |
1701 // Recursively counts the number of bookmarks and folders in node. | 1701 // Recursively counts the number of bookmarks and folders in node. |
1702 static void CountBookmarks(const BookmarkNode* node, | 1702 static void CountBookmarks(const BookmarkNode* node, |
1703 int* bookmarks, | 1703 int* bookmarks, |
1704 int* folders) { | 1704 int* folders) { |
1705 if (node->GetType() == history::StarredEntry::URL) | 1705 if (node->GetType() == BookmarkNode::URL) |
1706 (*bookmarks)++; | 1706 (*bookmarks)++; |
1707 else | 1707 else |
1708 (*folders)++; | 1708 (*folders)++; |
1709 for (int i = 0; i < node->GetChildCount(); ++i) | 1709 for (int i = 0; i < node->GetChildCount(); ++i) |
1710 CountBookmarks(node->GetChild(i), bookmarks, folders); | 1710 CountBookmarks(node->GetChild(i), bookmarks, folders); |
1711 } | 1711 } |
1712 | 1712 |
1713 void MetricsService::LogBookmarks(const BookmarkNode* node, | 1713 void MetricsService::LogBookmarks(const BookmarkNode* node, |
1714 const wchar_t* num_bookmarks_key, | 1714 const wchar_t* num_bookmarks_key, |
1715 const wchar_t* num_folders_key) { | 1715 const wchar_t* num_folders_key) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 L"." + key; | 1907 L"." + key; |
1908 prof_prefs->SetInteger(pref_key.c_str(), value); | 1908 prof_prefs->SetInteger(pref_key.c_str(), value); |
1909 } | 1909 } |
1910 | 1910 |
1911 static bool IsSingleThreaded() { | 1911 static bool IsSingleThreaded() { |
1912 static PlatformThreadId thread_id = 0; | 1912 static PlatformThreadId thread_id = 0; |
1913 if (!thread_id) | 1913 if (!thread_id) |
1914 thread_id = PlatformThread::CurrentId(); | 1914 thread_id = PlatformThread::CurrentId(); |
1915 return PlatformThread::CurrentId() == thread_id; | 1915 return PlatformThread::CurrentId() == thread_id; |
1916 } | 1916 } |
OLD | NEW |