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

Unified Diff: chrome/browser/devtools/device/usb/android_usb_browsertest.cc

Issue 1542413002: Switch to standard integer types in chrome/browser/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: chrome/browser/devtools/device/usb/android_usb_browsertest.cc
diff --git a/chrome/browser/devtools/device/usb/android_usb_browsertest.cc b/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
index a01b9acbc128da9b22aeadbaa5a21798f293f4c3..e01a875d82277402ae806f41df3c782c9ffee5ee 100644
--- a/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
+++ b/chrome/browser/devtools/device/usb/android_usb_browsertest.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <stddef.h>
+#include <stdint.h>
+
#include <algorithm>
#include "base/containers/scoped_ptr_hash_map.h"
@@ -71,8 +74,8 @@ struct BreakingAndroidTraits {
static const bool kConfigured = true;
};
-const uint32 kMaxPayload = 4096;
-const uint32 kVersion = 0x01000000;
+const uint32_t kMaxPayload = 4096;
+const uint32_t kVersion = 0x01000000;
const char kDeviceManufacturer[] = "Test Manufacturer";
const char kDeviceModel[] = "Nexus 6";
@@ -168,7 +171,7 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
NOTIMPLEMENTED();
}
- void ClearHalt(uint8 endpoint, const ResultCallback& callback) override {
+ void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override {
NOTIMPLEMENTED();
}
@@ -176,28 +179,28 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
void ControlTransfer(UsbEndpointDirection direction,
TransferRequestType request_type,
TransferRecipient recipient,
- uint8 request,
- uint16 value,
- uint16 index,
+ uint8_t request,
+ uint16_t value,
+ uint16_t index,
scoped_refptr<net::IOBuffer> buffer,
size_t length,
unsigned int timeout,
const TransferCallback& callback) override {}
void GenericTransfer(UsbEndpointDirection direction,
- uint8 endpoint,
+ uint8_t endpoint,
scoped_refptr<net::IOBuffer> buffer,
size_t length,
unsigned int timeout,
const TransferCallback& callback) override {
if (direction == device::USB_DIRECTION_OUTBOUND) {
if (remaining_body_length_ == 0) {
- std::vector<uint32> header(6);
+ std::vector<uint32_t> header(6);
memcpy(&header[0], buffer->data(), length);
current_message_.reset(
new AdbMessage(header[0], header[1], header[2], std::string()));
remaining_body_length_ = header[3];
- uint32 magic = header[5];
+ uint32_t magic = header[5];
if ((current_message_->command ^ 0xffffffff) != magic) {
DCHECK(false) << "Header checksum error";
return;
@@ -237,10 +240,10 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
}
// Copied from AndroidUsbDevice::Checksum
- uint32 Checksum(const std::string& data) {
+ uint32_t Checksum(const std::string& data) {
unsigned char* x = (unsigned char*)data.data();
int count = data.length();
- uint32 sum = 0;
+ uint32_t sum = 0;
while (count-- > 0)
sum += *x++;
return sum;
@@ -314,7 +317,7 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
append(arg0);
append(arg1);
bool add_zero = !body.empty() && (command != AdbMessage::kCommandWRTE);
- append(static_cast<uint32>(body.size() + (add_zero ? 1 : 0)));
+ append(static_cast<uint32_t>(body.size() + (add_zero ? 1 : 0)));
append(Checksum(body));
append(command ^ 0xffffffff);
std::copy(body.begin(), body.end(), std::back_inserter(output_buffer_));
@@ -349,7 +352,7 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
}
void IsochronousTransfer(UsbEndpointDirection direction,
- uint8 endpoint,
+ uint8_t endpoint,
scoped_refptr<net::IOBuffer> buffer,
size_t length,
unsigned int packets,
@@ -372,7 +375,7 @@ class MockUsbDeviceHandle : public UsbDeviceHandle {
};
scoped_refptr<MockUsbDevice<T> > device_;
- uint32 remaining_body_length_;
+ uint32_t remaining_body_length_;
scoped_ptr<AdbMessage> current_message_;
std::vector<char> output_buffer_;
std::queue<Query> queries_;
« no previous file with comments | « chrome/browser/devtools/device/usb/android_rsa.cc ('k') | chrome/browser/devtools/device/usb/android_usb_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698