forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsurfaces_service_application.h
55 lines (43 loc) · 1.86 KB
/
surfaces_service_application.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_
#define COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_
#include "base/macros.h"
#include "cc/surfaces/surface_manager.h"
#include "components/surfaces/public/interfaces/display.mojom.h"
#include "components/surfaces/public/interfaces/surfaces.mojom.h"
#include "mojo/common/tracing_impl.h"
#include "third_party/mojo/src/mojo/public/cpp/application/application_delegate.h"
#include "third_party/mojo/src/mojo/public/cpp/application/interface_factory.h"
namespace mojo {
class ApplicationConnection;
}
namespace surfaces {
class SurfacesScheduler;
class SurfacesServiceApplication
: public mojo::ApplicationDelegate,
public mojo::InterfaceFactory<mojo::DisplayFactory>,
public mojo::InterfaceFactory<mojo::Surface> {
public:
SurfacesServiceApplication();
~SurfacesServiceApplication() override;
// ApplicationDelegate implementation.
void Initialize(mojo::ApplicationImpl* app) override;
bool ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) override;
// InterfaceFactory<DisplayFactory> implementation.
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojo::DisplayFactory> request) override;
// InterfaceFactory<Surface> implementation.
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<mojo::Surface> request) override;
private:
cc::SurfaceManager manager_;
uint32_t next_id_namespace_;
scoped_ptr<SurfacesScheduler> scheduler_;
mojo::TracingImpl tracing_;
DISALLOW_COPY_AND_ASSIGN(SurfacesServiceApplication);
};
} // namespace surfaces
#endif // COMPONENTS_SURFACES_SURFACES_SERVICE_APPLICATION_H_