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

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

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "base/strings/sys_string_conversions.h" 32 #include "base/strings/sys_string_conversions.h"
33 #include "base/strings/utf_string_conversions.h" 33 #include "base/strings/utf_string_conversions.h"
34 #include "base/sys_info.h" 34 #include "base/sys_info.h"
35 #include "base/threading/platform_thread.h" 35 #include "base/threading/platform_thread.h"
36 #include "base/time/time.h" 36 #include "base/time/time.h"
37 #include "base/trace_event/trace_event.h" 37 #include "base/trace_event/trace_event.h"
38 #include "base/values.h" 38 #include "base/values.h"
39 #include "build/build_config.h" 39 #include "build/build_config.h"
40 #include "cc/base/switches.h" 40 #include "cc/base/switches.h"
41 #include "chrome/browser/about_flags.h" 41 #include "chrome/browser/about_flags.h"
42 #include "chrome/browser/after_startup_task.h"
42 #include "chrome/browser/browser_process.h" 43 #include "chrome/browser/browser_process.h"
43 #include "chrome/browser/browser_process_impl.h" 44 #include "chrome/browser/browser_process_impl.h"
44 #include "chrome/browser/browser_process_platform_part.h" 45 #include "chrome/browser/browser_process_platform_part.h"
45 #include "chrome/browser/browser_shutdown.h" 46 #include "chrome/browser/browser_shutdown.h"
46 #include "chrome/browser/chrome_browser_main_extra_parts.h" 47 #include "chrome/browser/chrome_browser_main_extra_parts.h"
47 #include "chrome/browser/component_updater/cld_component_installer.h" 48 #include "chrome/browser/component_updater/cld_component_installer.h"
48 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" 49 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h"
49 #include "chrome/browser/component_updater/flash_component_installer.h" 50 #include "chrome/browser/component_updater/flash_component_installer.h"
50 #include "chrome/browser/component_updater/recovery_component_installer.h" 51 #include "chrome/browser/component_updater/recovery_component_installer.h"
51 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h " 52 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h "
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 #endif // !defined(OS_ANDROID) 1105 #endif // !defined(OS_ANDROID)
1105 #if defined(ENABLE_WEBRTC) 1106 #if defined(ENABLE_WEBRTC)
1106 // Set up a task to delete old WebRTC log files for all profiles. Use a delay 1107 // Set up a task to delete old WebRTC log files for all profiles. Use a delay
1107 // to reduce the impact on startup time. 1108 // to reduce the impact on startup time.
1108 BrowserThread::PostDelayedTask( 1109 BrowserThread::PostDelayedTask(
1109 BrowserThread::UI, 1110 BrowserThread::UI,
1110 FROM_HERE, 1111 FROM_HERE,
1111 base::Bind(&WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles), 1112 base::Bind(&WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles),
1112 base::TimeDelta::FromMinutes(1)); 1113 base::TimeDelta::FromMinutes(1));
1113 #endif // defined(ENABLE_WEBRTC) 1114 #endif // defined(ENABLE_WEBRTC)
1115
1116 StartMonitoringStartup();
1114 } 1117 }
1115 1118
1116 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { 1119 int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
1117 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl"); 1120 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopRunImpl");
1118 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime"); 1121 SCOPED_UMA_HISTOGRAM_LONG_TIMER("Startup.PreMainMessageLoopRunImplLongTime");
1119 const base::TimeTicks start_time_step1 = base::TimeTicks::Now(); 1122 const base::TimeTicks start_time_step1 = base::TimeTicks::Now();
1120 // Android updates the metrics service dynamically depending on whether the 1123 // Android updates the metrics service dynamically depending on whether the
1121 // application is in the foreground or not. Do not start here. 1124 // application is in the foreground or not. Do not start here.
1122 #if !defined(OS_ANDROID) 1125 #if !defined(OS_ANDROID)
1123 // Now that the file thread has been started, start recording. 1126 // Now that the file thread has been started, start recording.
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 chromeos::CrosSettings::Shutdown(); 1733 chromeos::CrosSettings::Shutdown();
1731 #endif // defined(OS_CHROMEOS) 1734 #endif // defined(OS_CHROMEOS)
1732 #endif // defined(OS_ANDROID) 1735 #endif // defined(OS_ANDROID)
1733 } 1736 }
1734 1737
1735 // Public members: 1738 // Public members:
1736 1739
1737 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1740 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1738 chrome_extra_parts_.push_back(parts); 1741 chrome_extra_parts_.push_back(parts);
1739 } 1742 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698