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

Side by Side Diff: chrome/browser/usb/usb_device_handle.cc

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/usb/usb_device_handle.h" 5 #include "chrome/browser/usb/usb_device_handle.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 int size = libusb_get_string_descriptor( 369 int size = libusb_get_string_descriptor(
370 handle_, 0, 0, 370 handle_, 0, 0,
371 reinterpret_cast<unsigned char*>(&langid[0]), sizeof(langid)); 371 reinterpret_cast<unsigned char*>(&langid[0]), sizeof(langid));
372 if (size < 0) 372 if (size < 0)
373 return false; 373 return false;
374 374
375 int language_count = (size - 2) / 2; 375 int language_count = (size - 2) / 2;
376 376
377 for (int i = 1; i <= language_count; ++i) { 377 for (int i = 1; i <= language_count; ++i) {
378 // Get the string using language ID. 378 // Get the string using language ID.
379 char16 text[256] = { 0 }; 379 base::char16 text[256] = { 0 };
380 size = libusb_get_string_descriptor( 380 size = libusb_get_string_descriptor(
381 handle_, desc.iSerialNumber, langid[i], 381 handle_, desc.iSerialNumber, langid[i],
382 reinterpret_cast<unsigned char*>(&text[0]), sizeof(text)); 382 reinterpret_cast<unsigned char*>(&text[0]), sizeof(text));
383 if (size <= 2) 383 if (size <= 2)
384 continue; 384 continue;
385 if ((text[0] >> 8) != LIBUSB_DT_STRING) 385 if ((text[0] >> 8) != LIBUSB_DT_STRING)
386 continue; 386 continue;
387 if ((text[0] & 255) > size) 387 if ((text[0] & 255) > size)
388 continue; 388 continue;
389 389
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 } 594 }
595 595
596 // Attempt-release all the interfaces. 596 // Attempt-release all the interfaces.
597 // It will be retained until the transfer cancellation is finished. 597 // It will be retained until the transfer cancellation is finished.
598 claimed_interfaces_.clear(); 598 claimed_interfaces_.clear();
599 599
600 // Cannot close device handle here. Need to wait for libusb_cancel_transfer to 600 // Cannot close device handle here. Need to wait for libusb_cancel_transfer to
601 // finish. 601 // finish.
602 device_ = NULL; 602 device_ = NULL;
603 } 603 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_result_view.cc ('k') | chrome/common/importer/ie_importer_utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698