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

Unified Diff: device/usb/usb_device_filter.h

Issue 2727633004: Change UsbDeviceFilter to use const references instead of (Closed)
Patch Set: Fix callsite missed earlier due to not building for CrOS Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/usb/mojo/device_manager_impl.cc ('k') | device/usb/usb_device_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_filter.h
diff --git a/device/usb/usb_device_filter.h b/device/usb/usb_device_filter.h
index 4f5942a920adf3dce315b5a3e276899aafe1b8bb..666f732bc996c309eac3bbb861b7e29ce2900fe7 100644
--- a/device/usb/usb_device_filter.h
+++ b/device/usb/usb_device_filter.h
@@ -8,9 +8,9 @@
#include <stdint.h>
#include <memory>
+#include <string>
#include <vector>
-#include "base/memory/ref_counted.h"
#include "base/optional.h"
namespace base {
@@ -26,10 +26,13 @@ struct UsbDeviceFilter {
UsbDeviceFilter(const UsbDeviceFilter& other);
~UsbDeviceFilter();
- bool Matches(scoped_refptr<UsbDevice> device) const;
+ // Returns true if |device| matches this filter.
+ bool Matches(const UsbDevice& device) const;
std::unique_ptr<base::Value> ToValue() const;
- static bool MatchesAny(scoped_refptr<UsbDevice> device,
+ // Returns true if device matches any filter in |filters|, or if |filters| is
+ // empty.
+ static bool MatchesAny(const UsbDevice& device,
const std::vector<UsbDeviceFilter>& filters);
base::Optional<uint16_t> vendor_id;
« no previous file with comments | « device/usb/mojo/device_manager_impl.cc ('k') | device/usb/usb_device_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698