 Chromium Code Reviews
 Chromium Code Reviews Issue 10332190:
  Add SystemMonitor::GetMediaDevices()  (Closed) 
  Base URL: svn://chrome-svn/chrome/trunk/src/
    
  
    Issue 10332190:
  Add SystemMonitor::GetMediaDevices()  (Closed) 
  Base URL: svn://chrome-svn/chrome/trunk/src/| Index: base/system_monitor/system_monitor.h | 
| =================================================================== | 
| --- base/system_monitor/system_monitor.h (revision 137731) | 
| +++ base/system_monitor/system_monitor.h (working copy) | 
| @@ -6,10 +6,13 @@ | 
| #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ | 
| #pragma once | 
| +#include <map> | 
| #include <string> | 
| +#include <vector> | 
| #include "base/base_export.h" | 
| #include "base/basictypes.h" | 
| +#include "base/tuple.h" | 
| #include "build/build_config.h" | 
| // Windows HiRes timers drain the battery faster so we need to know the battery | 
| @@ -47,6 +50,8 @@ | 
| }; | 
| typedef unsigned int DeviceIdType; | 
| + // (Media device id, Media device name, Media device path) | 
| + typedef Tuple3<DeviceIdType, std::string, FilePath> MediaDeviceInfo; | 
| // Create SystemMonitor. Only one SystemMonitor instance per application | 
| // is allowed. | 
| @@ -145,7 +150,12 @@ | 
| const FilePath& path); | 
| void ProcessMediaDeviceDetached(const DeviceIdType& id); | 
| + // Appends info for attached media devices to |results|. | 
| 
willchan no longer on Chromium
2012/05/21 05:32:36
Is there a reason you don't just return std::vecto
 
Lei Zhang
2012/05/21 19:42:06
Done.
A lot of our code in our code base does it
 
willchan no longer on Chromium
2012/05/21 20:24:34
You're right that our existing code generally uses
 | 
| + void GetAttachedMediaDevices(std::vector<MediaDeviceInfo>* results); | 
| + | 
| private: | 
| + typedef std::map<base::SystemMonitor::DeviceIdType, | 
| + MediaDeviceInfo> MediaDeviceMap; | 
| #if defined(OS_MACOSX) | 
| void PlatformInit(); | 
| void PlatformDestroy(); | 
| @@ -180,6 +190,8 @@ | 
| base::OneShotTimer<SystemMonitor> delayed_battery_check_; | 
| #endif | 
| + MediaDeviceMap media_device_map_; | 
| + | 
| DISALLOW_COPY_AND_ASSIGN(SystemMonitor); | 
| }; |