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

Side by Side Diff: chromeos/dbus/services/surface_service_provider.h

Issue 1394573003: chromeos: Add SurfaceServiceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/dbus/services/surface_service_provider.cc » ('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 2015 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 #ifndef CHROMEOS_DBUS_SERVICES_SURFACE_SERVICE_PROVIDER_H_
6 #define CHROMEOS_DBUS_SERVICES_SURFACE_SERVICE_PROVIDER_H_
7
8 #include <string>
9
10 #include "base/files/scoped_file.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/services/cros_dbus_service.h"
15 #include "dbus/exported_object.h"
16
17 namespace chromeos {
18
19 class CHROMEOS_EXPORT SurfaceServiceProvider
20 : public CrosDBusService::ServiceProviderInterface {
21 public:
22 class Delegate {
23 public:
24 using CreateBufferCallback = base::Callback<void(bool success)>;
25
26 virtual ~Delegate() {}
27
28 // Functions for creating and destroying buffers.
29 virtual void CreatePrimeBuffer(uint32 id,
30 base::ScopedFD fd,
31 int32 width,
32 int32 height,
33 uint32 format,
34 int32 stride,
35 const CreateBufferCallback& callback) = 0;
36 virtual void DestroyBuffer(uint32 id) = 0;
37 virtual void AttachBufferToTestShellSurface(
38 uint32 buffer_id,
39 const base::Closure& released_callback);
Junichi Uekawa 2015/10/20 04:11:33 This is not defined anywhere, and should marked as
40 };
41
42 explicit SurfaceServiceProvider(scoped_ptr<Delegate> delegate);
43 ~SurfaceServiceProvider() override;
44
45 // CrosDBusService::ServiceProviderInterface overrides:
46 void Start(scoped_refptr<dbus::ExportedObject> exported_object) override;
47
48 private:
49 void CreatePrimeBuffer(dbus::MethodCall* method_call,
50 dbus::ExportedObject::ResponseSender response_sender);
51 void DestroyBuffer(dbus::MethodCall* method_call,
52 dbus::ExportedObject::ResponseSender response_sender);
53 void AttachBufferToTestShellSurface(
54 dbus::MethodCall* method_call,
55 dbus::ExportedObject::ResponseSender response_sender);
56 void ReleaseBuffer(uint32 id);
57
58 // This method is called when a dbus method is exported. If the export of the
59 // method is successful, |success| will be true. It will be false
60 // otherwise.
61 void OnExported(const std::string& interface_name,
62 const std::string& method_name,
63 bool success);
64
65 scoped_ptr<Delegate> delegate_;
66 scoped_refptr<dbus::ExportedObject> exported_object_;
67 base::WeakPtrFactory<SurfaceServiceProvider> weak_ptr_factory_;
68
69 DISALLOW_COPY_AND_ASSIGN(SurfaceServiceProvider);
70 };
71
72 } // namespace chromeos
73
74 #endif // CHROMEOS_DBUS_SERVICES_SURFACE_SERVICE_PROVIDER_H_
OLDNEW
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/dbus/services/surface_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698