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

Side by Side Diff: components/exo/wayland/server.cc

Issue 2159283002: exo: Fix crash in out-of-order destruction of Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« components/exo/gamepad.h ('K') | « components/exo/gamepad_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <grp.h> 7 #include <grp.h>
8 #include <linux/input.h> 8 #include <linux/input.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2863 uint32_t id, 2863 uint32_t id,
2864 wl_resource* seat) { 2864 wl_resource* seat) {
2865 wl_resource* gamepad_resource = wl_resource_create( 2865 wl_resource* gamepad_resource = wl_resource_create(
2866 client, &zwp_gamepad_v1_interface, wl_resource_get_version(resource), id); 2866 client, &zwp_gamepad_v1_interface, wl_resource_get_version(resource), id);
2867 2867
2868 base::Thread* gaming_input_thread = GetUserDataAs<base::Thread>(resource); 2868 base::Thread* gaming_input_thread = GetUserDataAs<base::Thread>(resource);
2869 2869
2870 SetImplementation( 2870 SetImplementation(
2871 gamepad_resource, &gamepad_implementation, 2871 gamepad_resource, &gamepad_implementation,
2872 base::WrapUnique(new Gamepad(new WaylandGamepadDelegate(gamepad_resource), 2872 base::WrapUnique(new Gamepad(new WaylandGamepadDelegate(gamepad_resource),
2873 gaming_input_thread->task_runner().get()))); 2873 gaming_input_thread->task_runner())));
2874 } 2874 }
2875 2875
2876 const struct zwp_gaming_input_v1_interface gaming_input_implementation = { 2876 const struct zwp_gaming_input_v1_interface gaming_input_implementation = {
2877 gaming_input_get_gamepad}; 2877 gaming_input_get_gamepad};
2878 2878
2879 void bind_gaming_input(wl_client* client, 2879 void bind_gaming_input(wl_client* client,
2880 void* data, 2880 void* data,
2881 uint32_t version, 2881 uint32_t version,
2882 uint32_t id) { 2882 uint32_t id) {
2883 wl_resource* resource = 2883 wl_resource* resource =
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 DCHECK(event_loop); 2996 DCHECK(event_loop);
2997 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds()); 2997 wl_event_loop_dispatch(event_loop, timeout.InMilliseconds());
2998 } 2998 }
2999 2999
3000 void Server::Flush() { 3000 void Server::Flush() {
3001 wl_display_flush_clients(wl_display_.get()); 3001 wl_display_flush_clients(wl_display_.get());
3002 } 3002 }
3003 3003
3004 } // namespace wayland 3004 } // namespace wayland
3005 } // namespace exo 3005 } // namespace exo
OLDNEW
« components/exo/gamepad.h ('K') | « components/exo/gamepad_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698