| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 void CreateSurface(wl_client* client, wl_resource* resource, uint32_t id) { | 30 void CreateSurface(wl_client* client, wl_resource* resource, uint32_t id) { |
| 31 auto compositor = | 31 auto compositor = |
| 32 static_cast<MockCompositor*>(wl_resource_get_user_data(resource)); | 32 static_cast<MockCompositor*>(wl_resource_get_user_data(resource)); |
| 33 wl_resource* surface_resource = wl_resource_create( | 33 wl_resource* surface_resource = wl_resource_create( |
| 34 client, &wl_surface_interface, wl_resource_get_version(resource), id); | 34 client, &wl_surface_interface, wl_resource_get_version(resource), id); |
| 35 if (!surface_resource) { | 35 if (!surface_resource) { |
| 36 wl_client_post_no_memory(client); | 36 wl_client_post_no_memory(client); |
| 37 return; | 37 return; |
| 38 } | 38 } |
| 39 compositor->AddSurface(base::WrapUnique(new MockSurface(surface_resource))); | 39 compositor->AddSurface(base::MakeUnique<MockSurface>(surface_resource)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 const struct wl_compositor_interface compositor_impl = { | 42 const struct wl_compositor_interface compositor_impl = { |
| 43 &CreateSurface, // create_surface | 43 &CreateSurface, // create_surface |
| 44 nullptr, // create_region | 44 nullptr, // create_region |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // wl_surface | 47 // wl_surface |
| 48 | 48 |
| 49 void Attach(wl_client* client, | 49 void Attach(wl_client* client, |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 385 } |
| 386 | 386 |
| 387 void FakeServer::OnFileCanReadWithoutBlocking(int fd) { | 387 void FakeServer::OnFileCanReadWithoutBlocking(int fd) { |
| 388 wl_event_loop_dispatch(event_loop_, 0); | 388 wl_event_loop_dispatch(event_loop_, 0); |
| 389 wl_display_flush_clients(display_.get()); | 389 wl_display_flush_clients(display_.get()); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {} | 392 void FakeServer::OnFileCanWriteWithoutBlocking(int fd) {} |
| 393 | 393 |
| 394 } // namespace wl | 394 } // namespace wl |
| OLD | NEW |