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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 21302005: Add CurrentProcessInfo::CreationTime() for Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 7 years, 4 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 | « base/process/process_metrics_linux.cc ('k') | chrome/browser/chrome_process_finder_win.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) 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 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #if defined(TOOLKIT_GTK) 7 #if defined(TOOLKIT_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 #endif // defined(GOOGLE_CHROME_BUILD) 682 #endif // defined(GOOGLE_CHROME_BUILD)
683 return enabled; 683 return enabled;
684 } 684 }
685 685
686 void ChromeBrowserMainParts::RecordBrowserStartupTime(bool is_first_run) { 686 void ChromeBrowserMainParts::RecordBrowserStartupTime(bool is_first_run) {
687 // Don't record any metrics if UI was displayed before this point e.g. 687 // Don't record any metrics if UI was displayed before this point e.g.
688 // warning dialogs. 688 // warning dialogs.
689 if (startup_metric_utils::WasNonBrowserUIDisplayed()) 689 if (startup_metric_utils::WasNonBrowserUIDisplayed())
690 return; 690 return;
691 691
692 // CurrentProcessInfo::CreationTime() is currently only implemented on Mac and 692 // CurrentProcessInfo::CreationTime() is currently only implemented on some
693 // Windows. 693 // platforms.
694 #if defined(OS_MACOSX) || defined(OS_WIN) 694 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
695 const base::Time* process_creation_time = 695 const base::Time process_creation_time =
696 base::CurrentProcessInfo::CreationTime(); 696 base::CurrentProcessInfo::CreationTime();
697 697
698 if (!is_first_run && process_creation_time) { 698 if (!is_first_run && !process_creation_time.is_null()) {
699 RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime", 699 RecordPreReadExperimentTime("Startup.BrowserMessageLoopStartTime",
700 base::Time::Now() - *process_creation_time); 700 base::Time::Now() - process_creation_time);
701 } 701 }
702 #endif // defined(OS_MACOSX) || defined(OS_WIN) 702 #endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX)
703 703
704 // Record collected startup metrics. 704 // Record collected startup metrics.
705 startup_metric_utils::OnBrowserStartupComplete(is_first_run); 705 startup_metric_utils::OnBrowserStartupComplete(is_first_run);
706 706
707 // Deletes self. 707 // Deletes self.
708 new LoadCompleteListener(); 708 new LoadCompleteListener();
709 } 709 }
710 710
711 // This code is specific to the Windows-only PreReadExperiment field-trial. 711 // This code is specific to the Windows-only PreReadExperiment field-trial.
712 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name, 712 void ChromeBrowserMainParts::RecordPreReadExperimentTime(const char* name,
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1725 chromeos::CrosSettings::Shutdown(); 1725 chromeos::CrosSettings::Shutdown();
1726 #endif 1726 #endif
1727 #endif 1727 #endif
1728 } 1728 }
1729 1729
1730 // Public members: 1730 // Public members:
1731 1731
1732 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1732 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1733 chrome_extra_parts_.push_back(parts); 1733 chrome_extra_parts_.push_back(parts);
1734 } 1734 }
OLDNEW
« no previous file with comments | « base/process/process_metrics_linux.cc ('k') | chrome/browser/chrome_process_finder_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698