| OLD | NEW |
| 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 #include "ui/ozone/platform/wayland/fake_server.h" | 5 #include "ui/ozone/platform/wayland/fake_server.h" |
| 6 | 6 |
| 7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
| 8 #include <wayland-server.h> | 8 #include <wayland-server.h> |
| 9 #include <xdg-shell-unstable-v5-server-protocol.h> | 9 #include <xdg-shell-unstable-v5-server-protocol.h> |
| 10 | 10 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 : Global(&xdg_shell_interface, &xdg_shell_impl, kXdgShellVersion) {} | 304 : Global(&xdg_shell_interface, &xdg_shell_impl, kXdgShellVersion) {} |
| 305 | 305 |
| 306 MockXdgShell::~MockXdgShell() {} | 306 MockXdgShell::~MockXdgShell() {} |
| 307 | 307 |
| 308 void DisplayDeleter::operator()(wl_display* display) { | 308 void DisplayDeleter::operator()(wl_display* display) { |
| 309 wl_display_destroy(display); | 309 wl_display_destroy(display); |
| 310 } | 310 } |
| 311 | 311 |
| 312 FakeServer::FakeServer() | 312 FakeServer::FakeServer() |
| 313 : Thread("fake_wayland_server"), | 313 : Thread("fake_wayland_server"), |
| 314 pause_event_(false, false), | 314 pause_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 315 resume_event_(false, false) {} | 315 base::WaitableEvent::InitialState::NOT_SIGNALED), |
| 316 resume_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 317 base::WaitableEvent::InitialState::NOT_SIGNALED) {} |
| 316 | 318 |
| 317 FakeServer::~FakeServer() { | 319 FakeServer::~FakeServer() { |
| 318 Resume(); | 320 Resume(); |
| 319 Stop(); | 321 Stop(); |
| 320 } | 322 } |
| 321 | 323 |
| 322 bool FakeServer::Start() { | 324 bool FakeServer::Start() { |
| 323 display_.reset(wl_display_create()); | 325 display_.reset(wl_display_create()); |
| 324 if (!display_) | 326 if (!display_) |
| 325 return false; | 327 return false; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 385 } |
| 384 | 386 |
| 385 void FakeServer::OnFileCanReadWithoutBlocking(int fd) { | 387 void FakeServer::OnFileCanReadWithoutBlocking(int fd) { |
| 386 wl_event_loop_dispatch(event_loop_, 0); | 388 wl_event_loop_dispatch(event_loop_, 0); |
| 387 wl_display_flush_clients(display_.get()); | 389 wl_display_flush_clients(display_.get()); |
| 388 } | 390 } |
| 389 | 391 |
| 390 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {} | 392 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {} |
| 391 | 393 |
| 392 } // namespace wl | 394 } // namespace wl |
| OLD | NEW |