diff options
author | vmpstr <vmpstr@chromium.org> | 2015-11-18 13:05:54 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-18 21:07:23 +0000 |
commit | 4fc2590aa54c0a556df66e5fd541a66cd429a223 (patch) | |
tree | 38ec174e33cf1e44fd9e593dd4690875f13ef53c /cc/surfaces/surface.cc | |
parent | 2571678733bc6b8643cff305b2cf601f77d871c6 (diff) | |
download | chromium_src-4fc2590aa54c0a556df66e5fd541a66cd429a223.zip chromium_src-4fc2590aa54c0a556df66e5fd541a66cd429a223.tar.gz chromium_src-4fc2590aa54c0a556df66e5fd541a66cd429a223.tar.bz2 |
cc: Use scoped_ptrs in surface multimaps.
Instead of managing raw pointers, use scoped ptrs now that we can!
BUG=557388
R=danakj@chromium.org, jbauman@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1455843005
Cr-Commit-Position: refs/heads/master@{#360412}
Diffstat (limited to 'cc/surfaces/surface.cc')
-rw-r--r-- | cc/surfaces/surface.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc index f5649b1..8faff98 100644 --- a/cc/surfaces/surface.cc +++ b/cc/surfaces/surface.cc @@ -110,19 +110,16 @@ void Surface::RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> copy_request) { } void Surface::TakeCopyOutputRequests( - std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests) { + std::multimap<RenderPassId, scoped_ptr<CopyOutputRequest>>* copy_requests) { DCHECK(copy_requests->empty()); if (current_frame_) { for (const auto& render_pass : current_frame_->delegated_frame_data->render_pass_list) { - while (!render_pass->copy_requests.empty()) { - scoped_ptr<CopyOutputRequest> request = - PopBack(&render_pass->copy_requests); - // TODO(vmpstr): |copy_requests| should store scoped_ptrs. - // crbug.com/557388. + for (auto& request : render_pass->copy_requests) { copy_requests->insert( - std::make_pair(render_pass->id, request.release())); + std::make_pair(render_pass->id, std::move(request))); } + render_pass->copy_requests.clear(); } } } |