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

Side by Side Diff: services/ui/display/screen_manager_forwarding.h

Issue 2835933005: Make ForwardingDisplayDelegate initially sync. (Closed)
Patch Set: Add comment explaining sync usage. Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ 5 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_
6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <vector> 10 #include <vector>
(...skipping 25 matching lines...) Expand all
36 void AddInterfaces(service_manager::BinderRegistry* registry) override; 36 void AddInterfaces(service_manager::BinderRegistry* registry) override;
37 void Init(ScreenManagerDelegate* delegate) override; 37 void Init(ScreenManagerDelegate* delegate) override;
38 void RequestCloseDisplay(int64_t display_id) override; 38 void RequestCloseDisplay(int64_t display_id) override;
39 display::ScreenBase* GetScreen() override; 39 display::ScreenBase* GetScreen() override;
40 40
41 // NativeDisplayObserver: 41 // NativeDisplayObserver:
42 void OnConfigurationChanged() override; 42 void OnConfigurationChanged() override;
43 void OnDisplaySnapshotsInvalidated() override; 43 void OnDisplaySnapshotsInvalidated() override;
44 44
45 // mojom::NativeDisplayDelegate: 45 // mojom::NativeDisplayDelegate:
46 void Initialize(mojom::NativeDisplayObserverPtr observer) override; 46 void Initialize(mojom::NativeDisplayObserverPtr observer,
47 const InitializeCallback& callback) override;
47 void TakeDisplayControl(const TakeDisplayControlCallback& callback) override; 48 void TakeDisplayControl(const TakeDisplayControlCallback& callback) override;
48 void RelinquishDisplayControl( 49 void RelinquishDisplayControl(
49 const RelinquishDisplayControlCallback& callback) override; 50 const RelinquishDisplayControlCallback& callback) override;
50 void GetDisplays(const GetDisplaysCallback& callback) override; 51 void GetDisplays(const GetDisplaysCallback& callback) override;
51 void Configure(int64_t display_id, 52 void Configure(int64_t display_id,
52 std::unique_ptr<display::DisplayMode> mode, 53 std::unique_ptr<display::DisplayMode> mode,
53 const gfx::Point& origin, 54 const gfx::Point& origin,
54 const ConfigureCallback& callback) override; 55 const ConfigureCallback& callback) override;
55 void GetHDCPState(int64_t display_id, 56 void GetHDCPState(int64_t display_id,
56 const GetHDCPStateCallback& callback) override; 57 const GetHDCPStateCallback& callback) override;
57 void SetHDCPState(int64_t display_id, 58 void SetHDCPState(int64_t display_id,
58 display::HDCPState state, 59 display::HDCPState state,
59 const SetHDCPStateCallback& callback) override; 60 const SetHDCPStateCallback& callback) override;
60 void SetColorCorrection( 61 void SetColorCorrection(
61 int64_t display_id, 62 int64_t display_id,
62 const std::vector<display::GammaRampRGBEntry>& degamma_lut, 63 const std::vector<display::GammaRampRGBEntry>& degamma_lut,
63 const std::vector<display::GammaRampRGBEntry>& gamma_lut, 64 const std::vector<display::GammaRampRGBEntry>& gamma_lut,
64 const std::vector<float>& correction_matrix) override; 65 const std::vector<float>& correction_matrix) override;
65 66
66 // service_manager::InterfaceFactory<mojom::NativeDisplayDelegate>: 67 // service_manager::InterfaceFactory<mojom::NativeDisplayDelegate>:
67 void Create(const service_manager::Identity& remote_identity, 68 void Create(const service_manager::Identity& remote_identity,
68 mojom::NativeDisplayDelegateRequest request) override; 69 mojom::NativeDisplayDelegateRequest request) override;
69 70
70 private: 71 private:
71 // Forwards results from GetDisplays() back with |callback|. 72 // Forwards results from GetDisplays() back with |callback|.
72 void ForwardGetDisplays( 73 void ForwardGetDisplays(const GetDisplaysCallback& callback,
73 const mojom::NativeDisplayDelegate::GetDisplaysCallback& callback, 74 const std::vector<DisplaySnapshot*>& displays);
74 const std::vector<DisplaySnapshot*>& displays);
75 75
76 // Forwards results from call to Configure() back with |callback|. 76 // Forwards results from call to Configure() back with |callback|.
77 void ForwardConfigure( 77 void ForwardConfigure(
78 DisplaySnapshot* snapshot, 78 DisplaySnapshot* snapshot,
79 const DisplayMode* mode, 79 const DisplayMode* mode,
80 const gfx::Point& origin, 80 const gfx::Point& origin,
81 const mojom::NativeDisplayDelegate::ConfigureCallback& callback, 81 const mojom::NativeDisplayDelegate::ConfigureCallback& callback,
82 bool status); 82 bool status);
83 83
84 std::unique_ptr<display::ScreenBase> screen_; 84 std::unique_ptr<display::ScreenBase> screen_;
85 mojo::Binding<mojom::NativeDisplayDelegate> binding_; 85 mojo::Binding<mojom::NativeDisplayDelegate> binding_;
86 mojom::NativeDisplayObserverPtr observer_; 86 mojom::NativeDisplayObserverPtr observer_;
87 87
88 std::unique_ptr<display::NativeDisplayDelegate> native_display_delegate_; 88 std::unique_ptr<display::NativeDisplayDelegate> native_display_delegate_;
89 89
90 // Cached pointers to snapshots owned by the |native_display_delegate_|. 90 // Cached pointers to snapshots owned by the |native_display_delegate_|.
91 std::unordered_map<int64_t, DisplaySnapshot*> snapshot_map_; 91 std::unordered_map<int64_t, DisplaySnapshot*> snapshot_map_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(ScreenManagerForwarding); 93 DISALLOW_COPY_AND_ASSIGN(ScreenManagerForwarding);
94 }; 94 };
95 95
96 } // namespace display 96 } // namespace display
97 97
98 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_ 98 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_FORWARDING_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/sync_call_restrictions.h ('k') | services/ui/display/screen_manager_forwarding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698