New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 838425 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

mojom::NetworkUsage should use unsigned value for total_bytes_received/sent

Project Member Reported by chongz@chromium.org, Apr 30 2018

Issue description

They are signed now because both data sources:
* |URLRequest::GetTotalReceivedBytes()| - w/ Network Service,
* |ChromeNetworkDelegate::OnNetworkBytesReceived| - w/o Network Service

the consumer:
* |task_manager::BytesTransferredParam|

and the entire //net code are using signed values for bytes transferred.

We should consider flipping them to unsigned if that's the suggested pattern.

See tsepez@'s comments:
https://chromium-review.googlesource.com/c/chromium/src/+/1008969/16/services/network/public/mojom/network_service.mojom#165

 
Google style guide actually suggests signed should be preferred.  "You should not use the unsigned integer types such as uint32_t, unless there is a valid reason such as representing a bit pattern rather than a number, or you need defined overflow modulo 2^N. In particular, do not use unsigned types to say a number will never be negative. Instead, use assertions for this."
Re #c1: Thanks for the comments, that's really helpful!

tsepez@ Do you have comments regarding the style guide, or are we using a different one for mojo?
https://google.github.io/styleguide/cppguide.html#Integer_Types

Status: WontFix (was: Assigned)
WontFix according to #c1. tsepez@ Please reopen if you have other concerns.
Thanks!

Sign in to add a comment