Commit cfb4c383 authored by erikchen's avatar erikchen Committed by Commit Bot

Add experiment to turn on responsiveness calculator.

The logic is implemented for Windows, macOS and Linux. It may add non-neglible
overhead, since it adds calls to base::TimeTicks::Now() to every posted task. It
will be turned on behind an experiment so that we can measure the impact.

Bug: 859155
Change-Id: I47c2a4629470d892dcb416a3b2121ef37b87ac8c
Reviewed-on: https://chromium-review.googlesource.com/1172913Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582697}
parent cf7367f3
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#include "content/browser/net/browser_online_state_observer.h" #include "content/browser/net/browser_online_state_observer.h"
#include "content/browser/renderer_host/media/media_stream_manager.h" #include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/scheduler/responsiveness/watcher.h"
#include "content/browser/service_manager/service_manager_context.h" #include "content/browser/service_manager/service_manager_context.h"
#include "content/browser/speech/speech_recognition_manager_impl.h" #include "content/browser/speech/speech_recognition_manager_impl.h"
#include "content/browser/startup_data_impl.h" #include "content/browser/startup_data_impl.h"
...@@ -437,6 +438,9 @@ void SetFileUrlPathAliasForIpcFuzzer() { ...@@ -437,6 +438,9 @@ void SetFileUrlPathAliasForIpcFuzzer() {
} }
#endif #endif
const base::Feature kBrowserResponsivenessCalculator{
"BrowserResponsivenessCalculator", base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace } // namespace
#if defined(USE_X11) #if defined(USE_X11)
...@@ -1472,6 +1476,11 @@ int BrowserMainLoop::BrowserThreadsStarted() { ...@@ -1472,6 +1476,11 @@ int BrowserMainLoop::BrowserThreadsStarted() {
SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys(); SystemHotkeyHelperMac::GetInstance()->DeferredLoadSystemHotkeys();
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
if (base::FeatureList::IsEnabled(kBrowserResponsivenessCalculator)) {
responsiveness_watcher_ = new responsiveness::Watcher;
responsiveness_watcher_->SetUp();
}
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
media::SetMediaDrmBridgeClient(GetContentClient()->GetMediaDrmBridgeClient()); media::SetMediaDrmBridgeClient(GetContentClient()->GetMediaDrmBridgeClient());
#endif #endif
......
...@@ -102,6 +102,10 @@ class SwapMetricsDriver; ...@@ -102,6 +102,10 @@ class SwapMetricsDriver;
class TracingControllerImpl; class TracingControllerImpl;
struct MainFunctionParams; struct MainFunctionParams;
namespace responsiveness {
class Watcher;
} // namespace responsiveness
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
class ScreenOrientationDelegate; class ScreenOrientationDelegate;
#endif #endif
...@@ -370,6 +374,7 @@ class CONTENT_EXPORT BrowserMainLoop { ...@@ -370,6 +374,7 @@ class CONTENT_EXPORT BrowserMainLoop {
discardable_shared_memory_manager_; discardable_shared_memory_manager_;
scoped_refptr<SaveFileManager> save_file_manager_; scoped_refptr<SaveFileManager> save_file_manager_;
std::unique_ptr<content::TracingControllerImpl> tracing_controller_; std::unique_ptr<content::TracingControllerImpl> tracing_controller_;
scoped_refptr<responsiveness::Watcher> responsiveness_watcher_;
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
// A SharedBitmapManager used to sharing and mapping IDs to shared memory // A SharedBitmapManager used to sharing and mapping IDs to shared memory
// between processes for software compositing. When the display compositor is // between processes for software compositing. When the display compositor is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment