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

Side by Side Diff: device/usb/webusb_descriptors.cc

Issue 2230083003: device: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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
« no previous file with comments | « device/usb/usb_service_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "device/usb/webusb_descriptors.h" 5 #include "device/usb/webusb_descriptors.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <iterator> 9 #include <iterator>
10 #include <map> 10 #include <map>
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 kControlTransferTimeout, 573 kControlTransferTimeout,
574 base::Bind(&OnReadBosDescriptorHeader, device_handle, callback)); 574 base::Bind(&OnReadBosDescriptorHeader, device_handle, callback));
575 } 575 }
576 576
577 bool FindInWebUsbAllowedOrigins( 577 bool FindInWebUsbAllowedOrigins(
578 const device::WebUsbAllowedOrigins* allowed_origins, 578 const device::WebUsbAllowedOrigins* allowed_origins,
579 const GURL& origin) { 579 const GURL& origin) {
580 if (!allowed_origins) 580 if (!allowed_origins)
581 return false; 581 return false;
582 582
583 if (ContainsValue(allowed_origins->origins, origin)) 583 if (base::ContainsValue(allowed_origins->origins, origin))
584 return true; 584 return true;
585 585
586 for (const auto& config : allowed_origins->configurations) { 586 for (const auto& config : allowed_origins->configurations) {
587 if (ContainsValue(config.origins, origin)) 587 if (base::ContainsValue(config.origins, origin))
588 return true; 588 return true;
589 589
590 for (const auto& function : config.functions) { 590 for (const auto& function : config.functions) {
591 if (ContainsValue(function.origins, origin)) 591 if (base::ContainsValue(function.origins, origin))
592 return true; 592 return true;
593 } 593 }
594 } 594 }
595 595
596 return false; 596 return false;
597 } 597 }
598 598
599 } // namespace device 599 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_service_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698