OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/system/udev_info_provider.h" | 5 #include "chrome/browser/chromeos/system/udev_info_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual bool QueryDeviceProperty(const std::string& sys_path, | 37 virtual bool QueryDeviceProperty(const std::string& sys_path, |
38 const std::string& property_name, | 38 const std::string& property_name, |
39 std::string* result) const OVERRIDE; | 39 std::string* result) const OVERRIDE; |
40 | 40 |
41 static UdevInfoProvider* GetInstance(); | 41 static UdevInfoProvider* GetInstance(); |
42 | 42 |
43 private: | 43 private: |
44 DISALLOW_COPY_AND_ASSIGN(UdevInfoProviderImpl); | 44 DISALLOW_COPY_AND_ASSIGN(UdevInfoProviderImpl); |
45 }; | 45 }; |
46 | 46 |
47 base::LazyInstance<UdevInfoProviderImpl> g_udev_info_provider( | 47 base::LazyInstance<UdevInfoProviderImpl> g_udev_info_provider = |
48 base::LINKER_INITIALIZED); | 48 LAZY_INSTANCE_INITIALIZER; |
49 | 49 |
50 bool UdevInfoProviderImpl::QueryDeviceProperty(const std::string& sys_path, | 50 bool UdevInfoProviderImpl::QueryDeviceProperty(const std::string& sys_path, |
51 const std::string& property_name, | 51 const std::string& property_name, |
52 std::string* result) const { | 52 std::string* result) const { |
53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
54 | 54 |
55 FilePath udevadm_path(kUdevadmToolPath); | 55 FilePath udevadm_path(kUdevadmToolPath); |
56 CommandLine cmd_line(udevadm_path); | 56 CommandLine cmd_line(udevadm_path); |
57 | 57 |
58 // TODO(ivankr): manually appending switches with AppendArg is a workaround | 58 // TODO(ivankr): manually appending switches with AppendArg is a workaround |
(...skipping 28 matching lines...) Expand all Loading... |
87 UdevInfoProvider* UdevInfoProviderImpl::GetInstance() { | 87 UdevInfoProvider* UdevInfoProviderImpl::GetInstance() { |
88 return &g_udev_info_provider.Get(); | 88 return &g_udev_info_provider.Get(); |
89 } | 89 } |
90 | 90 |
91 UdevInfoProvider* UdevInfoProvider::GetInstance() { | 91 UdevInfoProvider* UdevInfoProvider::GetInstance() { |
92 return UdevInfoProviderImpl::GetInstance(); | 92 return UdevInfoProviderImpl::GetInstance(); |
93 } | 93 } |
94 | 94 |
95 } // namespace system | 95 } // namespace system |
96 } // namespace chromeos | 96 } // namespace chromeos |
OLD | NEW |