| 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" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 { | 134 { |
| 135 base::AutoLock lock(is_paused_lock_); | 135 base::AutoLock lock(is_paused_lock_); |
| 136 if (is_paused_) | 136 if (is_paused_) |
| 137 return; | 137 return; |
| 138 } | 138 } |
| 139 | 139 |
| 140 MessageLoop::current()->PostDelayedTask( | 140 MessageLoop::current()->PostDelayedTask( |
| 141 FROM_HERE, | 141 FROM_HERE, |
| 142 base::Bind(&GamepadProvider::DoPoll, weak_factory_.GetWeakPtr()), | 142 base::Bind(&GamepadProvider::DoPoll, weak_factory_.GetWeakPtr()), |
| 143 kDesiredSamplingIntervalMs); | 143 base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 GamepadHardwareBuffer* GamepadProvider::SharedMemoryAsHardwareBuffer() { | 146 GamepadHardwareBuffer* GamepadProvider::SharedMemoryAsHardwareBuffer() { |
| 147 void* mem = gamepad_shared_memory_.memory(); | 147 void* mem = gamepad_shared_memory_.memory(); |
| 148 DCHECK(mem); | 148 DCHECK(mem); |
| 149 return static_cast<GamepadHardwareBuffer*>(mem); | 149 return static_cast<GamepadHardwareBuffer*>(mem); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace content | 152 } // namespace content |
| OLD | NEW |