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

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: Forward delays in RenderWidgetHostImpl properly. Created 7 years 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 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) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/synthetic_delay_configuration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698