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

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

Issue 1150093003: Move GLES2, GPU & Surfaces into the ViewManager directory. This does not merge the applications, th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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_service_application.h ('k') | components/view_manager/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/surfaces/surfaces_service_application.h"
6
7 #include "base/stl_util.h"
8 #include "components/surfaces/display_factory_impl.h"
9 #include "components/surfaces/surfaces_impl.h"
10 #include "components/surfaces/surfaces_scheduler.h"
11
12 namespace surfaces {
13
14 SurfacesServiceApplication::SurfacesServiceApplication()
15 : next_id_namespace_(1u) {
16 }
17
18 SurfacesServiceApplication::~SurfacesServiceApplication() {
19 // Make a copy of the sets before deleting them because their destructor will
20 // call back into this class to remove them from the set.
21 auto displays = displays_;
22 STLDeleteElements(&displays);
23 auto surfaces = surfaces_;
24 STLDeleteElements(&surfaces);
25 }
26
27 void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) {
28 tracing_.Initialize(app);
29 scheduler_.reset(new SurfacesScheduler);
30 }
31
32 bool SurfacesServiceApplication::ConfigureIncomingConnection(
33 mojo::ApplicationConnection* connection) {
34 connection->AddService<mojo::DisplayFactory>(this);
35 connection->AddService<mojo::Surface>(this);
36 return true;
37 }
38
39 void SurfacesServiceApplication::Create(
40 mojo::ApplicationConnection* connection,
41 mojo::InterfaceRequest<mojo::DisplayFactory> request) {
42 new DisplayFactoryImpl(this, &manager_, next_id_namespace_++,
43 scheduler_.get(), request.Pass());
44 }
45
46 void SurfacesServiceApplication::Create(
47 mojo::ApplicationConnection* connection,
48 mojo::InterfaceRequest<mojo::Surface> request) {
49 surfaces_.insert(
50 new SurfacesImpl(this, &manager_, next_id_namespace_++, scheduler_.get(),
51 request.Pass()));
52 }
53
54 void SurfacesServiceApplication::DisplayCreated(DisplayImpl* display) {
55 displays_.insert(display);
56 }
57
58 void SurfacesServiceApplication::DisplayDestroyed(DisplayImpl* display) {
59 displays_.erase(display);
60 }
61
62 void SurfacesServiceApplication::SurfaceDestroyed(SurfacesImpl* surface) {
63 surfaces_.erase(surface);
64 }
65
66 } // namespace surfaces
OLDNEW
« no previous file with comments | « components/surfaces/surfaces_service_application.h ('k') | components/view_manager/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698