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

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

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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 | « components/surfaces/surfaces_impl.h ('k') | components/surfaces/surfaces_service_application.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/surfaces/surfaces_impl.h" 5 #include "components/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"
11 #include "components/surfaces/surfaces_scheduler.h" 11 #include "components/surfaces/surfaces_scheduler.h"
12 #include "components/surfaces/surfaces_service_application.h"
12 #include "mojo/converters/geometry/geometry_type_converters.h" 13 #include "mojo/converters/geometry/geometry_type_converters.h"
13 #include "mojo/converters/surfaces/surfaces_type_converters.h" 14 #include "mojo/converters/surfaces/surfaces_type_converters.h"
14 15
15 using mojo::SurfaceIdPtr; 16 using mojo::SurfaceIdPtr;
16 17
17 namespace surfaces { 18 namespace surfaces {
18 19
19 namespace { 20 namespace {
20 void CallCallback(const mojo::Closure& callback, cc::SurfaceDrawStatus status) { 21 void CallCallback(const mojo::Closure& callback, cc::SurfaceDrawStatus status) {
21 callback.Run(); 22 callback.Run();
22 } 23 }
23 } 24 }
24 25
25 SurfacesImpl::SurfacesImpl(cc::SurfaceManager* manager, 26 SurfacesImpl::SurfacesImpl(SurfacesServiceApplication* application,
27 cc::SurfaceManager* manager,
26 uint32_t id_namespace, 28 uint32_t id_namespace,
27 SurfacesScheduler* scheduler, 29 SurfacesScheduler* scheduler,
28 mojo::InterfaceRequest<mojo::Surface> request) 30 mojo::InterfaceRequest<mojo::Surface> request)
29 : manager_(manager), 31 : application_(application),
32 manager_(manager),
30 factory_(manager, this), 33 factory_(manager, this),
31 id_namespace_(id_namespace), 34 id_namespace_(id_namespace),
32 scheduler_(scheduler), 35 scheduler_(scheduler),
33 binding_(this, request.Pass()) { 36 binding_(this, request.Pass()) {
34 } 37 }
35 38
36 SurfacesImpl::~SurfacesImpl() { 39 SurfacesImpl::~SurfacesImpl() {
40 application_->SurfaceDestroyed(this);
37 factory_.DestroyAll(); 41 factory_.DestroyAll();
38 } 42 }
39 43
40 void SurfacesImpl::GetIdNamespace( 44 void SurfacesImpl::GetIdNamespace(
41 const Surface::GetIdNamespaceCallback& callback) { 45 const Surface::GetIdNamespaceCallback& callback) {
42 callback.Run(id_namespace_); 46 callback.Run(id_namespace_);
43 } 47 }
44 48
45 void SurfacesImpl::SetResourceReturner(mojo::ResourceReturnerPtr returner) { 49 void SurfacesImpl::SetResourceReturner(mojo::ResourceReturnerPtr returner) {
46 returner_ = returner.Pass(); 50 returner_ = returner.Pass();
(...skipping 25 matching lines...) Expand all
72 ret[i] = mojo::ReturnedResource::From(resources[i]); 76 ret[i] = mojo::ReturnedResource::From(resources[i]);
73 } 77 }
74 returner_->ReturnResources(ret.Pass()); 78 returner_->ReturnResources(ret.Pass());
75 } 79 }
76 80
77 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) { 81 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) {
78 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id); 82 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id);
79 } 83 }
80 84
81 } // namespace mojo 85 } // namespace mojo
OLDNEW
« no previous file with comments | « components/surfaces/surfaces_impl.h ('k') | components/surfaces/surfaces_service_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698