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

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

Issue 155165: Lands http://codereview.chromium.org/155128 for Thiago.... (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 | « chrome/browser/importer/importer.cc ('k') | chrome/browser/views/bookmark_editor_view.cc » ('j') | 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 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/importer.cc ('k') | chrome/browser/views/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698