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

Side by Side Diff: components/exo/gamepad.cc

Issue 2179173002: exo: Fix crash in out-of-order destruction of Gamepad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
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
« no previous file with comments | « no previous file | 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 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 "components/exo/gamepad.h" 5 #include "components/exo/gamepad.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 SchedulePollOnPollingThread(); 134 SchedulePollOnPollingThread();
135 } 135 }
136 136
137 // Callback to ProcessGamepadChanges using weak reference to Gamepad. 137 // Callback to ProcessGamepadChanges using weak reference to Gamepad.
138 ProcessGamepadChangesCallback process_gamepad_changes_; 138 ProcessGamepadChangesCallback process_gamepad_changes_;
139 139
140 // Callback method to create a gamepad data fetcher. 140 // Callback method to create a gamepad data fetcher.
141 CreateGamepadDataFetcherCallback create_fetcher_callback_; 141 CreateGamepadDataFetcherCallback create_fetcher_callback_;
142 142
143 // Reference to task runner on polling thread. 143 // Reference to task runner on polling thread.
144 base::SingleThreadTaskRunner* polling_task_runner_; 144 scoped_refptr<base::SingleThreadTaskRunner> polling_task_runner_;
145 145
146 // Reference to task runner on origin thread. 146 // Reference to task runner on origin thread.
147 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; 147 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_;
148 148
149 // Gamepad data fetcher used for querying gamepad devices. 149 // Gamepad data fetcher used for querying gamepad devices.
150 std::unique_ptr<device::GamepadDataFetcher> fetcher_; 150 std::unique_ptr<device::GamepadDataFetcher> fetcher_;
151 151
152 // The current state of all gamepads. 152 // The current state of all gamepads.
153 blink::WebGamepads state_; 153 blink::WebGamepads state_;
154 154
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 delegate_->OnButton(button_id, new_button.pressed, new_button.value); 256 delegate_->OnButton(button_id, new_button.pressed, new_button.value);
257 } 257 }
258 } 258 }
259 if (send_frame) 259 if (send_frame)
260 delegate_->OnFrame(); 260 delegate_->OnFrame();
261 261
262 pad_state_ = new_pad; 262 pad_state_ = new_pad;
263 } 263 }
264 264
265 } // namespace exo 265 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698