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

Side by Side Diff: content/browser/gamepad/gamepad_service.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
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 <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 #include "base/memory/singleton.h" 11 #include "base/memory/singleton.h"
10 #include "content/browser/gamepad/gamepad_consumer.h" 12 #include "content/browser/gamepad/gamepad_consumer.h"
11 #include "content/browser/gamepad/gamepad_data_fetcher.h" 13 #include "content/browser/gamepad/gamepad_data_fetcher.h"
12 #include "content/browser/gamepad/gamepad_provider.h" 14 #include "content/browser/gamepad/gamepad_provider.h"
13 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
15 17
16 namespace content { 18 namespace content {
17 19
18 namespace { 20 namespace {
19 GamepadService* g_gamepad_service = 0; 21 GamepadService* g_gamepad_service = 0;
20 } 22 }
21 23
22 GamepadService::GamepadService() 24 GamepadService::GamepadService()
23 : num_active_consumers_(0), 25 : num_active_consumers_(0),
24 gesture_callback_pending_(false) { 26 gesture_callback_pending_(false) {
25 SetInstance(this); 27 SetInstance(this);
26 } 28 }
27 29
28 GamepadService::GamepadService(scoped_ptr<GamepadDataFetcher> fetcher) 30 GamepadService::GamepadService(scoped_ptr<GamepadDataFetcher> fetcher)
29 : provider_(new GamepadProvider(fetcher.Pass())), 31 : provider_(new GamepadProvider(std::move(fetcher))),
30 num_active_consumers_(0), 32 num_active_consumers_(0),
31 gesture_callback_pending_(false) { 33 gesture_callback_pending_(false) {
32 SetInstance(this); 34 SetInstance(this);
33 thread_checker_.DetachFromThread(); 35 thread_checker_.DetachFromThread();
34 } 36 }
35 37
36 GamepadService::~GamepadService() { 38 GamepadService::~GamepadService() {
37 SetInstance(NULL); 39 SetInstance(NULL);
38 } 40 }
39 41
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 for (unsigned i = 0; i < blink::WebGamepads::itemsLengthCap; ++i) { 153 for (unsigned i = 0; i < blink::WebGamepads::itemsLengthCap; ++i) {
152 const blink::WebGamepad& pad = gamepads.items[i]; 154 const blink::WebGamepad& pad = gamepads.items[i];
153 if (pad.connected) 155 if (pad.connected)
154 info.consumer->OnGamepadConnected(i, pad); 156 info.consumer->OnGamepadConnected(i, pad);
155 } 157 }
156 } 158 }
157 } 159 }
158 } 160 }
159 161
160 } // namespace content 162 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gamepad/gamepad_provider.cc ('k') | content/browser/geofencing/geofencing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698