| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "components/exo/wayland/server.h" | 5 #include "components/exo/wayland/server.h" |
| 6 | 6 |
| 7 #include <alpha-compositing-unstable-v1-server-protocol.h> | 7 #include <alpha-compositing-unstable-v1-server-protocol.h> |
| 8 #include <gaming-input-unstable-v1-server-protocol.h> | 8 #include <gaming-input-unstable-v1-server-protocol.h> |
| 9 #include <gaming-input-unstable-v2-server-protocol.h> | 9 #include <gaming-input-unstable-v2-server-protocol.h> |
| 10 #include <grp.h> | 10 #include <grp.h> |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 //////////////////////////////////////////////////////////////////////////////// | 437 //////////////////////////////////////////////////////////////////////////////// |
| 438 // wl_shm_interface: | 438 // wl_shm_interface: |
| 439 | 439 |
| 440 void shm_create_pool(wl_client* client, | 440 void shm_create_pool(wl_client* client, |
| 441 wl_resource* resource, | 441 wl_resource* resource, |
| 442 uint32_t id, | 442 uint32_t id, |
| 443 int fd, | 443 int fd, |
| 444 int32_t size) { | 444 int32_t size) { |
| 445 std::unique_ptr<SharedMemory> shared_memory = | 445 std::unique_ptr<SharedMemory> shared_memory = |
| 446 GetUserDataAs<Display>(resource)->CreateSharedMemory( | 446 GetUserDataAs<Display>(resource)->CreateSharedMemory( |
| 447 base::SharedMemoryHandle::ImportHandle(fd), size); | 447 base::SharedMemoryHandle::ImportHandle(fd, size), size); |
| 448 if (!shared_memory) { | 448 if (!shared_memory) { |
| 449 wl_resource_post_no_memory(resource); | 449 wl_resource_post_no_memory(resource); |
| 450 return; | 450 return; |
| 451 } | 451 } |
| 452 | 452 |
| 453 wl_resource* shm_pool_resource = | 453 wl_resource* shm_pool_resource = |
| 454 wl_resource_create(client, &wl_shm_pool_interface, 1, id); | 454 wl_resource_create(client, &wl_shm_pool_interface, 1, id); |
| 455 | 455 |
| 456 SetImplementation(shm_pool_resource, &shm_pool_implementation, | 456 SetImplementation(shm_pool_resource, &shm_pool_implementation, |
| 457 std::move(shared_memory)); | 457 std::move(shared_memory)); |
| (...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3954 DCHECK(event_loop); | 3954 DCHECK(event_loop); |
| 3955 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); | 3955 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); |
| 3956 } | 3956 } |
| 3957 | 3957 |
| 3958 void Server::Flush() { | 3958 void Server::Flush() { |
| 3959 wl_display_flush_clients(wl_display_.get()); | 3959 wl_display_flush_clients(wl_display_.get()); |
| 3960 } | 3960 } |
| 3961 | 3961 |
| 3962 } // namespace wayland | 3962 } // namespace wayland |
| 3963 } // namespace exo | 3963 } // namespace exo |
| OLD | NEW |