OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/stl_util.h" | 18 #include "base/stl_util.h" |
19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
20 #include "base/sys_info.h" | 20 #include "base/sys_info.h" |
21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
22 #include "base/trace_event/trace_event_synthetic_delay.h" | 22 #include "base/trace_event/trace_event_synthetic_delay.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "cc/base/switches.h" | 24 #include "cc/base/switches.h" |
25 #include "cc/debug/benchmark_instrumentation.h" | 25 #include "cc/debug/benchmark_instrumentation.h" |
26 #include "cc/output/output_surface.h" | 26 #include "cc/output/output_surface.h" |
| 27 #include "cc/scheduler/begin_frame_source.h" |
27 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
28 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 29 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
29 #include "components/scheduler/renderer/renderer_scheduler.h" | 30 #include "components/scheduler/renderer/renderer_scheduler.h" |
30 #include "content/child/npapi/webplugin.h" | 31 #include "content/child/npapi/webplugin.h" |
31 #include "content/common/content_switches_internal.h" | 32 #include "content/common/content_switches_internal.h" |
32 #include "content/common/gpu/client/context_provider_command_buffer.h" | 33 #include "content/common/gpu/client/context_provider_command_buffer.h" |
33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
34 #include "content/common/gpu/gpu_process_launch_causes.h" | 35 #include "content/common/gpu/gpu_process_launch_causes.h" |
35 #include "content/common/input/synthetic_gesture_packet.h" | 36 #include "content/common/input/synthetic_gesture_packet.h" |
36 #include "content/common/input/web_input_event_traits.h" | 37 #include "content/common/input/web_input_event_traits.h" |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 | 957 |
957 void RenderWidget::OnRequestMoveAck() { | 958 void RenderWidget::OnRequestMoveAck() { |
958 DCHECK(pending_window_rect_count_); | 959 DCHECK(pending_window_rect_count_); |
959 pending_window_rect_count_--; | 960 pending_window_rect_count_--; |
960 } | 961 } |
961 | 962 |
962 GURL RenderWidget::GetURLForGraphicsContext3D() { | 963 GURL RenderWidget::GetURLForGraphicsContext3D() { |
963 return GURL(); | 964 return GURL(); |
964 } | 965 } |
965 | 966 |
| 967 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, |
| 968 const ui::LatencyInfo& latency_info) { |
| 969 if (!input_event) |
| 970 return; |
| 971 input_handler_->HandleInputEvent(*input_event, latency_info); |
| 972 } |
| 973 |
| 974 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { |
| 975 if (webwidget_) |
| 976 webwidget_->setCursorVisibilityState(is_visible); |
| 977 } |
| 978 |
| 979 void RenderWidget::OnMouseCaptureLost() { |
| 980 if (webwidget_) |
| 981 webwidget_->mouseCaptureLost(); |
| 982 } |
| 983 |
| 984 void RenderWidget::OnSetFocus(bool enable) { |
| 985 if (webwidget_) |
| 986 webwidget_->setFocus(enable); |
| 987 } |
| 988 |
| 989 /////////////////////////////////////////////////////////////////////////////// |
| 990 // RenderWidgetCompositorDelegate |
| 991 |
| 992 void RenderWidget::ApplyViewportDeltas( |
| 993 const gfx::Vector2dF& inner_delta, |
| 994 const gfx::Vector2dF& outer_delta, |
| 995 const gfx::Vector2dF& elastic_overscroll_delta, |
| 996 float page_scale, |
| 997 float top_controls_delta) { |
| 998 webwidget_->applyViewportDeltas(inner_delta, outer_delta, |
| 999 elastic_overscroll_delta, page_scale, |
| 1000 top_controls_delta); |
| 1001 } |
| 1002 |
| 1003 void RenderWidget::BeginMainFrame(double frame_time_sec) { |
| 1004 webwidget_->beginFrame(frame_time_sec); |
| 1005 } |
| 1006 |
966 scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { | 1007 scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { |
967 DCHECK(webwidget_); | 1008 DCHECK(webwidget_); |
968 // For widgets that are never visible, we don't start the compositor, so we | 1009 // For widgets that are never visible, we don't start the compositor, so we |
969 // never get a request for a cc::OutputSurface. | 1010 // never get a request for a cc::OutputSurface. |
970 DCHECK(!compositor_never_visible_); | 1011 DCHECK(!compositor_never_visible_); |
971 | 1012 |
972 const base::CommandLine& command_line = | 1013 const base::CommandLine& command_line = |
973 *base::CommandLine::ForCurrentProcess(); | 1014 *base::CommandLine::ForCurrentProcess(); |
974 bool use_software = fallback; | 1015 bool use_software = fallback; |
975 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1016 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 return make_scoped_ptr(new CompositorOutputSurface( | 1089 return make_scoped_ptr(new CompositorOutputSurface( |
1049 routing_id(), output_surface_id, nullptr, nullptr, | 1090 routing_id(), output_surface_id, nullptr, nullptr, |
1050 std::move(software_device), frame_swap_message_queue_, true)); | 1091 std::move(software_device), frame_swap_message_queue_, true)); |
1051 } | 1092 } |
1052 | 1093 |
1053 return make_scoped_ptr(new MailboxOutputSurface( | 1094 return make_scoped_ptr(new MailboxOutputSurface( |
1054 routing_id(), output_surface_id, context_provider, | 1095 routing_id(), output_surface_id, context_provider, |
1055 worker_context_provider, frame_swap_message_queue_, cc::RGBA_8888)); | 1096 worker_context_provider, frame_swap_message_queue_, cc::RGBA_8888)); |
1056 } | 1097 } |
1057 | 1098 |
| 1099 scoped_ptr<cc::BeginFrameSource> |
| 1100 RenderWidget::CreateExternalBeginFrameSource() { |
| 1101 return compositor_deps_->CreateExternalBeginFrameSource(routing_id_); |
| 1102 } |
| 1103 |
| 1104 void RenderWidget::DidCommitAndDrawCompositorFrame() { |
| 1105 // NOTE: Tests may break if this event is renamed or moved. See |
| 1106 // tab_capture_performancetest.cc. |
| 1107 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); |
| 1108 // Notify subclasses that we initiated the paint operation. |
| 1109 DidInitiatePaint(); |
| 1110 } |
| 1111 |
| 1112 void RenderWidget::DidCommitCompositorFrame() { |
| 1113 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, |
| 1114 DidCommitCompositorFrame()); |
| 1115 FOR_EACH_OBSERVER(RenderFrameProxy, render_frame_proxies_, |
| 1116 DidCommitCompositorFrame()); |
| 1117 #if defined(VIDEO_HOLE) |
| 1118 FOR_EACH_OBSERVER(RenderFrameImpl, video_hole_frames_, |
| 1119 DidCommitCompositorFrame()); |
| 1120 #endif // defined(VIDEO_HOLE) |
| 1121 input_handler_->FlushPendingInputEventAck(); |
| 1122 } |
| 1123 |
| 1124 void RenderWidget::DidCompletePageScaleAnimation() {} |
| 1125 |
| 1126 void RenderWidget::DidCompleteSwapBuffers() { |
| 1127 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers"); |
| 1128 |
| 1129 // Notify subclasses threaded composited rendering was flushed to the screen. |
| 1130 DidFlushPaint(); |
| 1131 |
| 1132 if (!next_paint_flags_ && !need_update_rect_for_auto_resize_ && |
| 1133 !plugin_window_moves_.size()) { |
| 1134 return; |
| 1135 } |
| 1136 |
| 1137 ViewHostMsg_UpdateRect_Params params; |
| 1138 params.view_size = size_; |
| 1139 params.plugin_window_moves.swap(plugin_window_moves_); |
| 1140 params.flags = next_paint_flags_; |
| 1141 |
| 1142 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); |
| 1143 next_paint_flags_ = 0; |
| 1144 need_update_rect_for_auto_resize_ = false; |
| 1145 } |
| 1146 |
| 1147 bool RenderWidget::ForOOPIF() const { |
| 1148 // TODO(simonhong): Remove this when we enable BeginFrame scheduling for |
| 1149 // OOPIF(crbug.com/471411). |
| 1150 return for_oopif_; |
| 1151 } |
| 1152 |
| 1153 void RenderWidget::ForwardCompositorProto(const std::vector<uint8_t>& proto) { |
| 1154 Send(new ViewHostMsg_ForwardCompositorProto(routing_id_, proto)); |
| 1155 } |
| 1156 |
| 1157 bool RenderWidget::IsClosing() const { |
| 1158 return host_closing_; |
| 1159 } |
| 1160 |
1058 void RenderWidget::OnSwapBuffersAborted() { | 1161 void RenderWidget::OnSwapBuffersAborted() { |
1059 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted"); | 1162 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersAborted"); |
1060 // Schedule another frame so the compositor learns about it. | 1163 // Schedule another frame so the compositor learns about it. |
1061 ScheduleComposite(); | 1164 ScheduleComposite(); |
1062 } | 1165 } |
1063 | 1166 |
1064 void RenderWidget::OnSwapBuffersPosted() { | |
1065 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersPosted"); | |
1066 } | |
1067 | |
1068 void RenderWidget::OnSwapBuffersComplete() { | 1167 void RenderWidget::OnSwapBuffersComplete() { |
1069 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersComplete"); | 1168 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersComplete"); |
1070 | 1169 |
1071 // Notify subclasses that composited rendering was flushed to the screen. | 1170 // Notify subclasses that composited rendering was flushed to the screen. |
1072 DidFlushPaint(); | 1171 DidFlushPaint(); |
1073 } | 1172 } |
1074 | 1173 |
1075 void RenderWidget::OnHandleInputEvent(const blink::WebInputEvent* input_event, | 1174 void RenderWidget::OnSwapBuffersPosted() { |
1076 const ui::LatencyInfo& latency_info) { | 1175 TRACE_EVENT0("renderer", "RenderWidget::OnSwapBuffersPosted"); |
1077 if (!input_event) | |
1078 return; | |
1079 input_handler_->HandleInputEvent(*input_event, latency_info); | |
1080 } | 1176 } |
1081 | 1177 |
1082 void RenderWidget::OnCursorVisibilityChange(bool is_visible) { | 1178 void RenderWidget::RecordFrameTimingEvents( |
1083 if (webwidget_) | 1179 scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events, |
1084 webwidget_->setCursorVisibilityState(is_visible); | 1180 scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 1181 for (const auto& composite_event : *composite_events) { |
| 1182 int64_t frameId = composite_event.first; |
| 1183 const std::vector<cc::FrameTimingTracker::CompositeTimingEvent>& events = |
| 1184 composite_event.second; |
| 1185 std::vector<blink::WebFrameTimingEvent> webEvents; |
| 1186 for (size_t i = 0; i < events.size(); ++i) { |
| 1187 webEvents.push_back(blink::WebFrameTimingEvent( |
| 1188 events[i].frame_id, |
| 1189 (events[i].timestamp - base::TimeTicks()).InSecondsF())); |
| 1190 } |
| 1191 webwidget_->recordFrameTimingEvent(blink::WebWidget::CompositeEvent, |
| 1192 frameId, webEvents); |
| 1193 } |
| 1194 for (const auto& main_frame_event : *main_frame_events) { |
| 1195 int64_t frameId = main_frame_event.first; |
| 1196 const std::vector<cc::FrameTimingTracker::MainFrameTimingEvent>& events = |
| 1197 main_frame_event.second; |
| 1198 std::vector<blink::WebFrameTimingEvent> webEvents; |
| 1199 for (size_t i = 0; i < events.size(); ++i) { |
| 1200 webEvents.push_back(blink::WebFrameTimingEvent( |
| 1201 events[i].frame_id, |
| 1202 (events[i].timestamp - base::TimeTicks()).InSecondsF(), |
| 1203 (events[i].end_time - base::TimeTicks()).InSecondsF())); |
| 1204 } |
| 1205 webwidget_->recordFrameTimingEvent(blink::WebWidget::RenderEvent, frameId, |
| 1206 webEvents); |
| 1207 } |
1085 } | 1208 } |
1086 | 1209 |
1087 void RenderWidget::OnMouseCaptureLost() { | 1210 void RenderWidget::ScheduleAnimation() { |
1088 if (webwidget_) | 1211 scheduleAnimation(); |
1089 webwidget_->mouseCaptureLost(); | |
1090 } | 1212 } |
1091 | 1213 |
1092 void RenderWidget::OnSetFocus(bool enable) { | 1214 void RenderWidget::UpdateVisualState() { |
1093 if (webwidget_) | 1215 webwidget_->updateAllLifecyclePhases(); |
1094 webwidget_->setFocus(enable); | 1216 } |
| 1217 |
| 1218 void RenderWidget::WillBeginCompositorFrame() { |
| 1219 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); |
| 1220 |
| 1221 // The UpdateTextInputState can result in further layout and possibly |
| 1222 // enable GPU acceleration so they need to be called before any painting |
| 1223 // is done. |
| 1224 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); |
| 1225 UpdateSelectionBounds(); |
1095 } | 1226 } |
1096 | 1227 |
1097 /////////////////////////////////////////////////////////////////////////////// | 1228 /////////////////////////////////////////////////////////////////////////////// |
1098 // RenderWidgetInputHandlerDelegate | 1229 // RenderWidgetInputHandlerDelegate |
1099 | 1230 |
1100 void RenderWidget::FocusChangeComplete() {} | 1231 void RenderWidget::FocusChangeComplete() {} |
1101 | 1232 |
1102 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 1233 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
1103 return true; | 1234 return true; |
1104 } | 1235 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 | 1372 |
1242 void RenderWidget::AutoResizeCompositor() { | 1373 void RenderWidget::AutoResizeCompositor() { |
1243 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); | 1374 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); |
1244 if (compositor_) | 1375 if (compositor_) |
1245 compositor_->setViewportSize(physical_backing_size_); | 1376 compositor_->setViewportSize(physical_backing_size_); |
1246 } | 1377 } |
1247 | 1378 |
1248 void RenderWidget::initializeLayerTreeView() { | 1379 void RenderWidget::initializeLayerTreeView() { |
1249 DCHECK(!host_closing_); | 1380 DCHECK(!host_closing_); |
1250 | 1381 |
1251 compositor_ = RenderWidgetCompositor::Create(this, compositor_deps_); | 1382 compositor_ = RenderWidgetCompositor::Create(this, device_scale_factor_, |
| 1383 compositor_deps_); |
1252 compositor_->setViewportSize(physical_backing_size_); | 1384 compositor_->setViewportSize(physical_backing_size_); |
1253 OnDeviceScaleFactorChanged(); | 1385 OnDeviceScaleFactorChanged(); |
1254 // For background pages and certain tests, we don't want to trigger | 1386 // For background pages and certain tests, we don't want to trigger |
1255 // OutputSurface creation. | 1387 // OutputSurface creation. |
1256 if (compositor_never_visible_ || !RenderThreadImpl::current()) | 1388 if (compositor_never_visible_ || !RenderThreadImpl::current()) |
1257 compositor_->SetNeverVisible(); | 1389 compositor_->SetNeverVisible(); |
1258 | 1390 |
1259 StartCompositor(); | 1391 StartCompositor(); |
1260 } | 1392 } |
1261 | 1393 |
(...skipping 17 matching lines...) Expand all Loading... |
1279 void RenderWidget::didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) { | 1411 void RenderWidget::didMeaningfulLayout(blink::WebMeaningfulLayout layout_type) { |
1280 if (layout_type == blink::WebMeaningfulLayout::VisuallyNonEmpty) { | 1412 if (layout_type == blink::WebMeaningfulLayout::VisuallyNonEmpty) { |
1281 QueueMessage(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_), | 1413 QueueMessage(new ViewHostMsg_DidFirstVisuallyNonEmptyPaint(routing_id_), |
1282 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); | 1414 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); |
1283 } | 1415 } |
1284 | 1416 |
1285 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, | 1417 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, |
1286 DidMeaningfulLayout(layout_type)); | 1418 DidMeaningfulLayout(layout_type)); |
1287 } | 1419 } |
1288 | 1420 |
1289 void RenderWidget::WillBeginCompositorFrame() { | |
1290 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); | |
1291 | |
1292 // The UpdateTextInputState can result in further layout and possibly | |
1293 // enable GPU acceleration so they need to be called before any painting | |
1294 // is done. | |
1295 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); | |
1296 UpdateSelectionBounds(); | |
1297 } | |
1298 | |
1299 void RenderWidget::DidCommitCompositorFrame() { | |
1300 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, | |
1301 DidCommitCompositorFrame()); | |
1302 FOR_EACH_OBSERVER(RenderFrameProxy, render_frame_proxies_, | |
1303 DidCommitCompositorFrame()); | |
1304 #if defined(VIDEO_HOLE) | |
1305 FOR_EACH_OBSERVER(RenderFrameImpl, video_hole_frames_, | |
1306 DidCommitCompositorFrame()); | |
1307 #endif // defined(VIDEO_HOLE) | |
1308 input_handler_->FlushPendingInputEventAck(); | |
1309 } | |
1310 | |
1311 void RenderWidget::DidCommitAndDrawCompositorFrame() { | |
1312 // NOTE: Tests may break if this event is renamed or moved. See | |
1313 // tab_capture_performancetest.cc. | |
1314 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); | |
1315 // Notify subclasses that we initiated the paint operation. | |
1316 DidInitiatePaint(); | |
1317 } | |
1318 | |
1319 void RenderWidget::DidCompleteSwapBuffers() { | |
1320 TRACE_EVENT0("renderer", "RenderWidget::DidCompleteSwapBuffers"); | |
1321 | |
1322 // Notify subclasses threaded composited rendering was flushed to the screen. | |
1323 DidFlushPaint(); | |
1324 | |
1325 if (!next_paint_flags_ && | |
1326 !need_update_rect_for_auto_resize_ && | |
1327 !plugin_window_moves_.size()) { | |
1328 return; | |
1329 } | |
1330 | |
1331 ViewHostMsg_UpdateRect_Params params; | |
1332 params.view_size = size_; | |
1333 params.plugin_window_moves.swap(plugin_window_moves_); | |
1334 params.flags = next_paint_flags_; | |
1335 | |
1336 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); | |
1337 next_paint_flags_ = 0; | |
1338 need_update_rect_for_auto_resize_ = false; | |
1339 } | |
1340 | |
1341 void RenderWidget::ScheduleComposite() { | 1421 void RenderWidget::ScheduleComposite() { |
1342 if (compositor_ && | 1422 if (compositor_ && |
1343 compositor_deps_->GetCompositorImplThreadTaskRunner().get()) { | 1423 compositor_deps_->GetCompositorImplThreadTaskRunner().get()) { |
1344 compositor_->setNeedsAnimate(); | 1424 compositor_->setNeedsAnimate(); |
1345 } | 1425 } |
1346 } | 1426 } |
1347 | 1427 |
1348 void RenderWidget::ScheduleCompositeWithForcedRedraw() { | 1428 void RenderWidget::ScheduleCompositeWithForcedRedraw() { |
1349 if (compositor_) { | 1429 if (compositor_) { |
1350 // Regardless of whether threaded compositing is enabled, always | 1430 // Regardless of whether threaded compositing is enabled, always |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 selection_focus_rect_ = params.focus_rect; | 1963 selection_focus_rect_ = params.focus_rect; |
1884 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 1964 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
1885 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 1965 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
1886 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 1966 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
1887 } | 1967 } |
1888 } | 1968 } |
1889 | 1969 |
1890 UpdateCompositionInfo(false); | 1970 UpdateCompositionInfo(false); |
1891 } | 1971 } |
1892 | 1972 |
1893 void RenderWidget::ForwardCompositorProto(const std::vector<uint8_t>& proto) { | |
1894 Send(new ViewHostMsg_ForwardCompositorProto(routing_id_, proto)); | |
1895 } | |
1896 | |
1897 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. | 1973 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. |
1898 #define STATIC_ASSERT_WTIT_ENUM_MATCH(a, b) \ | 1974 #define STATIC_ASSERT_WTIT_ENUM_MATCH(a, b) \ |
1899 static_assert(int(blink::WebTextInputType##a) \ | 1975 static_assert(int(blink::WebTextInputType##a) \ |
1900 == int(ui::TEXT_INPUT_TYPE_##b), \ | 1976 == int(ui::TEXT_INPUT_TYPE_##b), \ |
1901 "mismatching enums: " #a) | 1977 "mismatching enums: " #a) |
1902 | 1978 |
1903 STATIC_ASSERT_WTIT_ENUM_MATCH(None, NONE); | 1979 STATIC_ASSERT_WTIT_ENUM_MATCH(None, NONE); |
1904 STATIC_ASSERT_WTIT_ENUM_MATCH(Text, TEXT); | 1980 STATIC_ASSERT_WTIT_ENUM_MATCH(Text, TEXT); |
1905 STATIC_ASSERT_WTIT_ENUM_MATCH(Password, PASSWORD); | 1981 STATIC_ASSERT_WTIT_ENUM_MATCH(Password, PASSWORD); |
1906 STATIC_ASSERT_WTIT_ENUM_MATCH(Search, SEARCH); | 1982 STATIC_ASSERT_WTIT_ENUM_MATCH(Search, SEARCH); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2271 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2196 video_hole_frames_.AddObserver(frame); | 2272 video_hole_frames_.AddObserver(frame); |
2197 } | 2273 } |
2198 | 2274 |
2199 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2275 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2200 video_hole_frames_.RemoveObserver(frame); | 2276 video_hole_frames_.RemoveObserver(frame); |
2201 } | 2277 } |
2202 #endif // defined(VIDEO_HOLE) | 2278 #endif // defined(VIDEO_HOLE) |
2203 | 2279 |
2204 } // namespace content | 2280 } // namespace content |
OLD | NEW |