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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, | 1271 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter, |
1272 bool commit_requested, | 1272 bool commit_requested, |
1273 int source_frame_number) { | 1273 int source_frame_number) { |
1274 if (policy == MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE && | 1274 if (policy == MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE && |
1275 // No need for lock: this gets changed only on this thread. | 1275 // No need for lock: this gets changed only on this thread. |
1276 !commit_requested && | 1276 !commit_requested && |
1277 // No need for lock: Messages are only enqueued from this thread, if we | 1277 // No need for lock: Messages are only enqueued from this thread, if we |
1278 // don't have any now, no other thread will add any. | 1278 // don't have any now, no other thread will add any. |
1279 frame_swap_message_queue->Empty()) { | 1279 frame_swap_message_queue->Empty()) { |
1280 sync_message_filter->Send(msg); | 1280 sync_message_filter->Send(msg); |
1281 return scoped_ptr<cc::SwapPromise>(); | 1281 return nullptr; |
1282 } | 1282 } |
1283 | 1283 |
1284 bool first_message_for_frame = false; | 1284 bool first_message_for_frame = false; |
1285 frame_swap_message_queue->QueueMessageForFrame(policy, | 1285 frame_swap_message_queue->QueueMessageForFrame(policy, |
1286 source_frame_number, | 1286 source_frame_number, |
1287 make_scoped_ptr(msg), | 1287 make_scoped_ptr(msg), |
1288 &first_message_for_frame); | 1288 &first_message_for_frame); |
1289 if (first_message_for_frame) { | 1289 if (first_message_for_frame) { |
1290 scoped_ptr<cc::SwapPromise> promise(new QueueMessageSwapPromise( | 1290 scoped_ptr<cc::SwapPromise> promise(new QueueMessageSwapPromise( |
1291 sync_message_filter, frame_swap_message_queue, source_frame_number)); | 1291 sync_message_filter, frame_swap_message_queue, source_frame_number)); |
1292 return promise.PassAs<cc::SwapPromise>(); | 1292 return promise; |
1293 } | 1293 } |
1294 return scoped_ptr<cc::SwapPromise>(); | 1294 return nullptr; |
1295 } | 1295 } |
1296 | 1296 |
1297 void RenderWidget::QueueMessage(IPC::Message* msg, | 1297 void RenderWidget::QueueMessage(IPC::Message* msg, |
1298 MessageDeliveryPolicy policy) { | 1298 MessageDeliveryPolicy policy) { |
1299 // RenderThreadImpl::current() is NULL in some tests. | 1299 // RenderThreadImpl::current() is NULL in some tests. |
1300 if (!compositor_ || !RenderThreadImpl::current()) { | 1300 if (!compositor_ || !RenderThreadImpl::current()) { |
1301 Send(msg); | 1301 Send(msg); |
1302 return; | 1302 return; |
1303 } | 1303 } |
1304 | 1304 |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2196 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2196 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2197 video_hole_frames_.AddObserver(frame); | 2197 video_hole_frames_.AddObserver(frame); |
2198 } | 2198 } |
2199 | 2199 |
2200 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2200 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2201 video_hole_frames_.RemoveObserver(frame); | 2201 video_hole_frames_.RemoveObserver(frame); |
2202 } | 2202 } |
2203 #endif // defined(VIDEO_HOLE) | 2203 #endif // defined(VIDEO_HOLE) |
2204 | 2204 |
2205 } // namespace content | 2205 } // namespace content |
OLD | NEW |