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

Side by Side Diff: ui/ozone/platform/wayland/fake_server.h

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 5 #ifndef UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 6 #define UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
7 7
8 #include <wayland-server-core.h> 8 #include <wayland-server-core.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 MockSurface(wl_resource* resource); 58 MockSurface(wl_resource* resource);
59 ~MockSurface() override; 59 ~MockSurface() override;
60 60
61 static MockSurface* FromResource(wl_resource* resource); 61 static MockSurface* FromResource(wl_resource* resource);
62 62
63 MOCK_METHOD3(Attach, void(wl_resource* buffer, int32_t x, int32_t y)); 63 MOCK_METHOD3(Attach, void(wl_resource* buffer, int32_t x, int32_t y));
64 MOCK_METHOD4(Damage, 64 MOCK_METHOD4(Damage,
65 void(int32_t x, int32_t y, int32_t width, int32_t height)); 65 void(int32_t x, int32_t y, int32_t width, int32_t height));
66 MOCK_METHOD0(Commit, void()); 66 MOCK_METHOD0(Commit, void());
67 67
68 scoped_ptr<MockXdgSurface> xdg_surface; 68 std::unique_ptr<MockXdgSurface> xdg_surface;
69 69
70 private: 70 private:
71 DISALLOW_COPY_AND_ASSIGN(MockSurface); 71 DISALLOW_COPY_AND_ASSIGN(MockSurface);
72 }; 72 };
73 73
74 class MockPointer : public ServerObject { 74 class MockPointer : public ServerObject {
75 public: 75 public:
76 MockPointer(wl_resource* resource); 76 MockPointer(wl_resource* resource);
77 ~MockPointer() override; 77 ~MockPointer() override;
78 78
(...skipping 18 matching lines...) Expand all
97 // useful when testing a simple client. 97 // useful when testing a simple client.
98 wl_resource* resource() { return resource_; } 98 wl_resource* resource() { return resource_; }
99 99
100 static void Bind(wl_client* client, 100 static void Bind(wl_client* client,
101 void* data, 101 void* data,
102 uint32_t version, 102 uint32_t version,
103 uint32_t id); 103 uint32_t id);
104 static void OnResourceDestroyed(wl_resource* resource); 104 static void OnResourceDestroyed(wl_resource* resource);
105 105
106 private: 106 private:
107 scoped_ptr<wl_global, GlobalDeleter> global_; 107 std::unique_ptr<wl_global, GlobalDeleter> global_;
108 108
109 const wl_interface* interface_; 109 const wl_interface* interface_;
110 const void* implementation_; 110 const void* implementation_;
111 const uint32_t version_; 111 const uint32_t version_;
112 wl_resource* resource_ = nullptr; 112 wl_resource* resource_ = nullptr;
113 113
114 DISALLOW_COPY_AND_ASSIGN(Global); 114 DISALLOW_COPY_AND_ASSIGN(Global);
115 }; 115 };
116 116
117 class MockCompositor : public Global { 117 class MockCompositor : public Global {
118 public: 118 public:
119 MockCompositor(); 119 MockCompositor();
120 ~MockCompositor() override; 120 ~MockCompositor() override;
121 121
122 void AddSurface(scoped_ptr<MockSurface> surface); 122 void AddSurface(std::unique_ptr<MockSurface> surface);
123 123
124 private: 124 private:
125 std::vector<scoped_ptr<MockSurface>> surfaces_; 125 std::vector<std::unique_ptr<MockSurface>> surfaces_;
126 126
127 DISALLOW_COPY_AND_ASSIGN(MockCompositor); 127 DISALLOW_COPY_AND_ASSIGN(MockCompositor);
128 }; 128 };
129 129
130 class MockSeat : public Global { 130 class MockSeat : public Global {
131 public: 131 public:
132 MockSeat(); 132 MockSeat();
133 ~MockSeat() override; 133 ~MockSeat() override;
134 134
135 scoped_ptr<MockPointer> pointer; 135 std::unique_ptr<MockPointer> pointer;
136 136
137 private: 137 private:
138 DISALLOW_COPY_AND_ASSIGN(MockSeat); 138 DISALLOW_COPY_AND_ASSIGN(MockSeat);
139 }; 139 };
140 140
141 class MockXdgShell : public Global { 141 class MockXdgShell : public Global {
142 public: 142 public:
143 MockXdgShell(); 143 MockXdgShell();
144 ~MockXdgShell() override; 144 ~MockXdgShell() override;
145 145
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 wl_resource* resource = wl_client_get_object(client_, id); 177 wl_resource* resource = wl_client_get_object(client_, id);
178 return resource ? T::FromResource(resource) : nullptr; 178 return resource ? T::FromResource(resource) : nullptr;
179 } 179 }
180 180
181 MockSeat* seat() { return &seat_; } 181 MockSeat* seat() { return &seat_; }
182 MockXdgShell* xdg_shell() { return &xdg_shell_; } 182 MockXdgShell* xdg_shell() { return &xdg_shell_; }
183 183
184 private: 184 private:
185 void DoPause(); 185 void DoPause();
186 186
187 scoped_ptr<base::MessagePump> CreateMessagePump(); 187 std::unique_ptr<base::MessagePump> CreateMessagePump();
188 188
189 // base::MessagePumpLibevent::Watcher 189 // base::MessagePumpLibevent::Watcher
190 void OnFileCanReadWithoutBlocking(int fd) override; 190 void OnFileCanReadWithoutBlocking(int fd) override;
191 void OnFileCanWriteWithoutBlocking(int fd) override; 191 void OnFileCanWriteWithoutBlocking(int fd) override;
192 192
193 scoped_ptr<wl_display, DisplayDeleter> display_; 193 std::unique_ptr<wl_display, DisplayDeleter> display_;
194 wl_client* client_ = nullptr; 194 wl_client* client_ = nullptr;
195 wl_event_loop* event_loop_ = nullptr; 195 wl_event_loop* event_loop_ = nullptr;
196 196
197 base::WaitableEvent pause_event_; 197 base::WaitableEvent pause_event_;
198 base::WaitableEvent resume_event_; 198 base::WaitableEvent resume_event_;
199 bool paused_ = false; 199 bool paused_ = false;
200 200
201 MockCompositor compositor_; 201 MockCompositor compositor_;
202 MockSeat seat_; 202 MockSeat seat_;
203 MockXdgShell xdg_shell_; 203 MockXdgShell xdg_shell_;
204 204
205 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 205 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
206 206
207 DISALLOW_COPY_AND_ASSIGN(FakeServer); 207 DISALLOW_COPY_AND_ASSIGN(FakeServer);
208 }; 208 };
209 209
210 } // namespace wl 210 } // namespace wl
211 211
212 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_ 212 #endif // UI_OZONE_PLATFORM_WAYLAND_FAKE_SERVER_H_
OLDNEW
« no previous file with comments | « ui/ozone/platform/headless/ozone_platform_headless.cc ('k') | ui/ozone/platform/wayland/fake_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698