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

Side by Side Diff: content/browser/device_monitor_mac.mm

Issue 1354363002: Cleanup: Pass std::string as const reference from content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | content/browser/fileapi/file_system_dir_url_request_job_unittest.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 (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/device_monitor_mac.h" 5 #include "content/browser/device_monitor_mac.h"
6 6
7 #import <QTKit/QTKit.h> 7 #import <QTKit/QTKit.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 14 matching lines...) Expand all
25 class DeviceInfo { 25 class DeviceInfo {
26 public: 26 public:
27 enum DeviceType { 27 enum DeviceType {
28 kAudio, 28 kAudio,
29 kVideo, 29 kVideo,
30 kMuxed, 30 kMuxed,
31 kUnknown, 31 kUnknown,
32 kInvalid 32 kInvalid
33 }; 33 };
34 34
35 DeviceInfo(std::string unique_id, DeviceType type) 35 DeviceInfo(const std::string& unique_id, DeviceType type)
36 : unique_id_(unique_id), type_(type) {} 36 : unique_id_(unique_id), type_(type) {}
37 37
38 // Operator== is needed here to use this class in a std::find. A given 38 // Operator== is needed here to use this class in a std::find. A given
39 // |unique_id_| always has the same |type_| so for comparison purposes the 39 // |unique_id_| always has the same |type_| so for comparison purposes the
40 // latter can be safely ignored. 40 // latter can be safely ignored.
41 bool operator==(const DeviceInfo& device) const { 41 bool operator==(const DeviceInfo& device) const {
42 return unique_id_ == device.unique_id_; 42 return unique_id_ == device.unique_id_;
43 } 43 }
44 44
45 const std::string& unique_id() const { return unique_id_; } 45 const std::string& unique_id() const { return unique_id_; }
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 } 552 }
553 553
554 void DeviceMonitorMac::NotifyDeviceChanged( 554 void DeviceMonitorMac::NotifyDeviceChanged(
555 base::SystemMonitor::DeviceType type) { 555 base::SystemMonitor::DeviceType type) {
556 DCHECK(thread_checker_.CalledOnValidThread()); 556 DCHECK(thread_checker_.CalledOnValidThread());
557 // TODO(xians): Remove the global variable for SystemMonitor. 557 // TODO(xians): Remove the global variable for SystemMonitor.
558 base::SystemMonitor::Get()->ProcessDevicesChanged(type); 558 base::SystemMonitor::Get()->ProcessDevicesChanged(type);
559 } 559 }
560 560
561 } // namespace content 561 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/fileapi/file_system_dir_url_request_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698