OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cmath> | 5 #include <cmath> |
6 #include <set> | 6 #include <set> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
14 #include "content/browser/gamepad/data_fetcher.h" | 14 #include "content/browser/gamepad/data_fetcher.h" |
15 #include "content/browser/gamepad/gamepad_provider.h" | 15 #include "content/browser/gamepad/gamepad_provider.h" |
16 #include "content/browser/gamepad/platform_data_fetcher.h" | 16 #include "content/browser/gamepad/platform_data_fetcher.h" |
| 17 #include "content/common/gamepad_hardware_buffer.h" |
17 #include "content/common/gamepad_messages.h" | 18 #include "content/common/gamepad_messages.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 | 22 |
22 GamepadProvider::GamepadProvider(GamepadDataFetcher* fetcher) | 23 GamepadProvider::GamepadProvider(GamepadDataFetcher* fetcher) |
23 : is_paused_(false), | 24 : is_paused_(false), |
24 devices_changed_(true), | 25 devices_changed_(true), |
25 provided_fetcher_(fetcher), | 26 provided_fetcher_(fetcher), |
26 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { | 27 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs)); | 144 base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs)); |
144 } | 145 } |
145 | 146 |
146 GamepadHardwareBuffer* GamepadProvider::SharedMemoryAsHardwareBuffer() { | 147 GamepadHardwareBuffer* GamepadProvider::SharedMemoryAsHardwareBuffer() { |
147 void* mem = gamepad_shared_memory_.memory(); | 148 void* mem = gamepad_shared_memory_.memory(); |
148 DCHECK(mem); | 149 DCHECK(mem); |
149 return static_cast<GamepadHardwareBuffer*>(mem); | 150 return static_cast<GamepadHardwareBuffer*>(mem); |
150 } | 151 } |
151 | 152 |
152 } // namespace content | 153 } // namespace content |
OLD | NEW |