| 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 67b3b1f22844cb16cf2282da6a2dd40c59bca25f..272b95a083eac9e1b94bc680561c7c2945cf8af0 100644
|
| --- a/content/browser/renderer_host/render_widget_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
| @@ -39,6 +39,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"
|
| @@ -49,6 +50,7 @@
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/notification_types.h"
|
| #include "content/public/browser/render_widget_host_iterator.h"
|
| +#include "content/public/browser/tracing_synthetic_delay_configuration.h"
|
| #include "content/public/browser/user_metrics.h"
|
| #include "content/public/common/content_constants.h"
|
| #include "content/public/common/content_switches.h"
|
| @@ -469,6 +471,8 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
|
| + IPC_MESSAGE_HANDLER(ViewHostMsg_ConfigureSyntheticDelays,
|
| + OnConfigureSyntheticDelays)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
|
| @@ -1730,6 +1734,24 @@ void RenderWidgetHostImpl::OnQueueSyntheticGesture(
|
| SyntheticGesture::Create(*gesture_packet.gesture_params()));
|
| }
|
|
|
| +void RenderWidgetHostImpl::OnConfigureSyntheticDelays(
|
| + const std::vector<content::SyntheticDelayConfiguration>& delays) {
|
| + std::vector<content::TracingSyntheticDelayConfiguration> tracing_delays;
|
| + for (size_t i = 0; i < delays.size(); i++) {
|
| + content::TracingSyntheticDelayConfiguration delay;
|
| + delay.name = delays[i].name;
|
| + delay.target_duration = delays[i].target_duration;
|
| + delay.mode =
|
| + static_cast<base::debug::TraceEventSyntheticDelay::Mode>(
|
| + delays[i].mode);
|
| + tracing_delays.push_back(delay);
|
| + }
|
| + TracingControllerImpl::GetInstance()->ConfigureSyntheticDelays(
|
| + tracing_delays,
|
| + base::Bind(&RenderWidgetHostImpl::DidConfigureSyntheticDelays,
|
| + weak_factory_.GetWeakPtr()));
|
| +}
|
| +
|
| void RenderWidgetHostImpl::OnFocus() {
|
| // Only RenderViewHost can deal with that message.
|
| RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
|
| @@ -2464,6 +2486,10 @@ void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) {
|
| GetRoutingID(), snapshot_id, gfx::Size(), png));
|
| }
|
|
|
| +void RenderWidgetHostImpl::DidConfigureSyntheticDelays() {
|
| + Send(new ViewMsg_ConfigureSyntheticDelaysAck(GetRoutingID()));
|
| +}
|
| +
|
| // static
|
| void RenderWidgetHostImpl::CompositorFrameDrawn(
|
| const ui::LatencyInfo& latency_info) {
|
|
|