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

Side by Side Diff: content/renderer/render_widget.cc

Issue 657763002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698