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

Side by Side Diff: device/test/test_device_client.cc

Issue 1484643002: Make //device pass "gn check" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « device/serial/serial_io_handler.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "device/test/test_device_client.h" 5 #include "device/test/test_device_client.h"
6 6
7 #include "device/hid/hid_service.h" 7 // This file unconditionally includes these headers despite conditionally
8 #include "device/usb/usb_service.h" 8 // depending on the corresponding targets. The code below needs the destructors
9 // of the classes defined even when the classes are never instantiated.
10 // TODO: This should probably be done more explicitly to avoid ambiguity.
11 #include "device/hid/hid_service.h" // nogncheck
12 #include "device/usb/usb_service.h" // nogncheck
9 13
10 namespace device { 14 namespace device {
11 15
12 TestDeviceClient::TestDeviceClient( 16 TestDeviceClient::TestDeviceClient(
13 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner) 17 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner)
14 : blocking_task_runner_(blocking_task_runner) {} 18 : blocking_task_runner_(blocking_task_runner) {}
15 19
16 TestDeviceClient::~TestDeviceClient() {} 20 TestDeviceClient::~TestDeviceClient() {}
17 21
18 HidService* TestDeviceClient::GetHidService() { 22 HidService* TestDeviceClient::GetHidService() {
19 #if !defined(OS_ANDROID) && !defined(OS_IOS) && \ 23 #if !defined(OS_ANDROID) && !defined(OS_IOS) && \
20 !(defined(OS_LINUX) && !defined(USE_UDEV)) 24 !(defined(OS_LINUX) && !defined(USE_UDEV))
21 if (!hid_service_) { 25 if (!hid_service_) {
22 hid_service_ = HidService::Create(blocking_task_runner_); 26 hid_service_ = HidService::Create(blocking_task_runner_);
23 } 27 }
24 #endif 28 #endif
25 return hid_service_.get(); 29 return hid_service_.get();
26 } 30 }
27 31
28 UsbService* TestDeviceClient::GetUsbService() { 32 UsbService* TestDeviceClient::GetUsbService() {
29 #if !defined(OS_ANDROID) && !defined(OS_IOS) 33 #if !defined(OS_ANDROID) && !defined(OS_IOS)
30 if (!usb_service_) { 34 if (!usb_service_) {
31 usb_service_ = UsbService::Create(blocking_task_runner_); 35 usb_service_ = UsbService::Create(blocking_task_runner_);
32 } 36 }
33 #endif 37 #endif
34 return usb_service_.get(); 38 return usb_service_.get();
35 } 39 }
36 40
37 } // namespace device 41 } // namespace device
OLDNEW
« no previous file with comments | « device/serial/serial_io_handler.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698