diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-01 23:35:25 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-01 23:35:25 +0000 |
commit | 7664ab3d9d921bc769977c2921ecb4e5ea0cc793 (patch) | |
tree | ab884002c040253f951d05ef7b3e5033d35d1c99 /chrome/browser | |
parent | 22258c851d500a42113c833ac06d244cf4d4236b (diff) | |
download | chromium_src-7664ab3d9d921bc769977c2921ecb4e5ea0cc793.zip chromium_src-7664ab3d9d921bc769977c2921ecb4e5ea0cc793.tar.gz chromium_src-7664ab3d9d921bc769977c2921ecb4e5ea0cc793.tar.bz2 |
Added command line switches and UI (controlled via a build option)
to make it easier to use the sampling profiler.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/6250070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 5 | ||||
-rw-r--r-- | chrome/browser/ui/toolbar/wrench_menu_model.cc | 8 |
4 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 880502f..c6573b6 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -85,6 +85,7 @@ #include "chrome/common/main_function_params.h" #include "chrome/common/net/net_resource_provider.h" #include "chrome/common/pref_names.h" +#include "chrome/common/profiling.h" #include "chrome/common/result_codes.h" #include "chrome/installer/util/google_update_settings.h" #include "gfx/gfx_module.h" @@ -506,6 +507,7 @@ void BrowserMainParts::MainMessageLoopStart() { InitializeMainThread(); PostMainMessageLoopStart(); + Profiling::MainMessageLoopStarted(); } void BrowserMainParts::InitializeMainThread() { diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 51a5071..5d488cf 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -715,6 +715,9 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kNoSandbox, switches::kPlaybackMode, switches::kPpapiOutOfProcess, + switches::kProfilingAtStart, + switches::kProfilingFile, + switches::kProfilingFlush, switches::kRecordMode, switches::kRegisterPepperPlugins, switches::kRemoteShellPort, diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 05fd143..0d16526 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -98,6 +98,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/page_transition_types.h" #include "chrome/common/pref_names.h" +#include "chrome/common/profiling.h" #include "chrome/common/url_constants.h" #include "chrome/common/web_apps.h" #include "grit/chromium_strings.h" @@ -1157,6 +1158,9 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) { command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); command_updater_.UpdateCommandEnabled(IDC_TOGGLE_VERTICAL_TABS, show_main_ui); +#if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) + command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); +#endif } /////////////////////////////////////////////////////////////////////////////// @@ -2261,6 +2265,7 @@ void Browser::ExecuteCommandWithDisposition( case IDC_FEEDBACK: OpenBugReportDialog(); break; case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; + case IDC_PROFILING_ENABLED: Profiling::Toggle(); break; case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; case IDC_SHOW_APP_MENU: ShowAppMenu(); break; diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index a1151df..dd4591a 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -30,6 +30,7 @@ #include "chrome/common/notification_source.h" #include "chrome/common/notification_type.h" #include "chrome/common/pref_names.h" +#include "chrome/common/profiling.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -184,6 +185,11 @@ void ToolsMenuModel::Build(Browser* browser) { AddItemWithStringId(IDC_DEV_TOOLS, IDS_DEV_TOOLS); AddItemWithStringId(IDC_DEV_TOOLS_CONSOLE, IDS_DEV_TOOLS_CONSOLE); } + +#if defined(ENABLE_PROFILING) && !defined(NO_TCMALLOC) + AddSeparator(); + AddCheckItemWithStringId(IDC_PROFILING_ENABLED, IDS_PROFILING_ENABLED); +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -258,6 +264,8 @@ void WrenchMenuModel::ExecuteCommand(int command_id) { bool WrenchMenuModel::IsCommandIdChecked(int command_id) const { if (command_id == IDC_SHOW_BOOKMARK_BAR) { return browser_->profile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); + } else if (command_id == IDC_PROFILING_ENABLED) { + return Profiling::BeingProfiled(); } return false; |