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

Side by Side Diff: content/common/media/media_stream_options.cc

Issue 10830063: refactor EnumerateDevices to make it a persistent request. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 4 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 | Annotate | Revision Log
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/common/media/media_stream_options.h" 5 #include "content/common/media/media_stream_options.h"
6 6
7 namespace media_stream { 7 namespace media_stream {
8 8
9 // static 9 // static
10 const int StreamDeviceInfo::kNoId = -1; 10 const int StreamDeviceInfo::kNoId = -1;
11 11
12 StreamDeviceInfo::StreamDeviceInfo() 12 StreamDeviceInfo::StreamDeviceInfo()
13 : stream_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE), 13 : stream_type(content::MEDIA_STREAM_DEVICE_TYPE_NO_SERVICE),
14 in_use(false), 14 in_use(false),
15 session_id(kNoId) {} 15 session_id(kNoId) {}
16 16
17 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param, 17 StreamDeviceInfo::StreamDeviceInfo(MediaStreamType service_param,
18 const std::string& name_param, 18 const std::string& name_param,
19 const std::string& device_param, 19 const std::string& device_param,
20 bool opened) 20 bool opened)
21 : stream_type(service_param), 21 : stream_type(service_param),
22 name(name_param), 22 name(name_param),
23 device_id(device_param), 23 device_id(device_param),
24 in_use(opened), 24 in_use(opened),
25 session_id(kNoId) {} 25 session_id(kNoId) {}
26 26
27 bool StreamDeviceInfo::operator==(const StreamDeviceInfo& other) const {
tommi (sloooow) - chröme 2012/08/03 09:10:35 nit: Change this method to IsEqual() (we don't ove
wjia(left Chromium) 2012/08/03 21:53:45 This overloading is needed for StreamDeviceInfoArr
tommi (sloooow) - chröme 2012/08/04 09:27:08 You can use std::equal instead. See for example:
wjia(left Chromium) 2012/08/07 23:16:34 Done.
28 return stream_type == other.stream_type &&
29 name == other.name &&
30 device_id == other.device_id &&
31 in_use == other.in_use &&
32 session_id == other.session_id;
33 }
34
27 } // namespace media_stream 35 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698