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 "content/browser/gamepad/gamepad_service.h" | 5 #include "content/browser/gamepad/gamepad_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "content/browser/gamepad/gamepad_data_fetcher.h" | 10 #include "content/browser/gamepad/gamepad_data_fetcher.h" |
11 #include "content/browser/gamepad/gamepad_provider.h" | 11 #include "content/browser/gamepad/gamepad_provider.h" |
12 #include "content/public/browser/browser_thread.h" | |
13 #include "content/public/browser/render_process_host.h" | 12 #include "content/public/browser/render_process_host.h" |
14 | 13 |
15 namespace content { | 14 namespace content { |
16 | 15 |
17 GamepadService::GamepadService() : num_readers_(0) { | 16 GamepadService::GamepadService() : num_readers_(0) { |
18 } | 17 } |
19 | 18 |
20 GamepadService::GamepadService(scoped_ptr<GamepadDataFetcher> fetcher) | 19 GamepadService::GamepadService(scoped_ptr<GamepadDataFetcher> fetcher) |
21 : num_readers_(0), | 20 : num_readers_(0), |
22 provider_(new GamepadProvider(fetcher.Pass())) { | 21 provider_(new GamepadProvider(fetcher.Pass())) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 provider_.reset(); | 60 provider_.reset(); |
62 } | 61 } |
63 | 62 |
64 base::SharedMemoryHandle GamepadService::GetSharedMemoryHandleForProcess( | 63 base::SharedMemoryHandle GamepadService::GetSharedMemoryHandleForProcess( |
65 base::ProcessHandle handle) { | 64 base::ProcessHandle handle) { |
66 DCHECK(thread_checker_.CalledOnValidThread()); | 65 DCHECK(thread_checker_.CalledOnValidThread()); |
67 return provider_->GetSharedMemoryHandleForProcess(handle); | 66 return provider_->GetSharedMemoryHandleForProcess(handle); |
68 } | 67 } |
69 | 68 |
70 } // namespace content | 69 } // namespace content |
OLD | NEW |