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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 83483007: Expose synthetic delays through the GPU benchmarking extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 9e606f4d5ca2f56a1508a717aa31c1493a75988e..b363364b9d4cadad1c437ed7501a6381d6938a5d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -13,6 +13,7 @@
#include "base/command_line.h"
#include "base/containers/hash_tables.h"
#include "base/debug/trace_event.h"
+#include "base/debug/trace_event.h"
#include "base/i18n/rtl.h"
#include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h"
@@ -36,6 +37,7 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
+#include "content/browser/tracing/tracing_controller_impl.h"
#include "content/common/accessibility_messages.h"
#include "content/common/content_constants_internal.h"
#include "content/common/gpu/gpu_messages.h"
@@ -467,6 +469,8 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll)
IPC_MESSAGE_HANDLER(ViewHostMsg_BeginPinch, OnBeginPinch)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_ConfigureSyntheticDelay,
+ OnConfigureSyntheticDelay)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
@@ -1726,6 +1730,15 @@ void RenderWidgetHostImpl::OnBeginPinch(
synthetic_gesture_controller_.BeginPinch(view_, params);
}
+void RenderWidgetHostImpl::OnConfigureSyntheticDelay(
+ const ViewHostMsg_ConfigureSyntheticDelay_Params& params) {
+ TracingControllerImpl::GetInstance()->ConfigureSyntheticDelay(
+ params.name, params.target_duration,
+ static_cast<base::debug::TraceEventSyntheticDelay::Mode>(params.mode),
+ base::Bind(&RenderWidgetHostImpl::DidConfigureSyntheticDelay,
+ weak_factory_.GetWeakPtr()));
+}
+
void RenderWidgetHostImpl::OnFocus() {
// Only RenderViewHost can deal with that message.
RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
@@ -2457,6 +2470,10 @@ void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) {
GetRoutingID(), snapshot_id, gfx::Size(), png));
}
+void RenderWidgetHostImpl::DidConfigureSyntheticDelay() {
+ Send(new ViewMsg_ConfigureSyntheticDelayAck(GetRoutingID()));
+}
+
// static
void RenderWidgetHostImpl::CompositorFrameDrawn(
const ui::LatencyInfo& latency_info) {

Powered by Google App Engine
This is Rietveld 408576698