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

Side by Side Diff: services/surfaces/surfaces_impl.cc

Issue 1397133002: Remove callers of mojo::Array<size_t> constructor in favor of ::New (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/surfaces/surfaces_impl.h" 5 #include "services/surfaces/surfaces_impl.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/resources/returned_resource.h" 9 #include "cc/resources/returned_resource.h"
10 #include "cc/surfaces/surface_id_allocator.h" 10 #include "cc/surfaces/surface_id_allocator.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 scheduler_->SetNeedsDraw(); 60 scheduler_->SetNeedsDraw();
61 } 61 }
62 62
63 void SurfacesImpl::DestroySurface(uint32_t local_id) { 63 void SurfacesImpl::DestroySurface(uint32_t local_id) {
64 factory_.Destroy(QualifyIdentifier(local_id)); 64 factory_.Destroy(QualifyIdentifier(local_id));
65 } 65 }
66 66
67 void SurfacesImpl::ReturnResources(const cc::ReturnedResourceArray& resources) { 67 void SurfacesImpl::ReturnResources(const cc::ReturnedResourceArray& resources) {
68 if (resources.empty() || !returner_) 68 if (resources.empty() || !returner_)
69 return; 69 return;
70 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); 70 auto ret = mojo::Array<mojo::ReturnedResourcePtr>::New(resources.size());
71 for (size_t i = 0; i < resources.size(); ++i) { 71 for (size_t i = 0; i < resources.size(); ++i) {
72 ret[i] = mojo::ReturnedResource::From(resources[i]); 72 ret[i] = mojo::ReturnedResource::From(resources[i]);
73 } 73 }
74 returner_->ReturnResources(ret.Pass()); 74 returner_->ReturnResources(ret.Pass());
75 } 75 }
76 76
77 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) { 77 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) {
78 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id); 78 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id);
79 } 79 }
80 80
81 } // namespace mojo 81 } // namespace mojo
OLDNEW
« no previous file with comments | « services/surfaces/display_impl.cc ('k') | services/url_response_disk_cache/url_response_disk_cache_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698