0

Avoid shadowing UNKNOWN (defined in both quic and ftp)

If you include both net/ftp/ftp_directory_listing_parser.h and
net/quic/quic_chromium_client_session.h you get an error
about an UNKNOWN shadowing another UNKNOWN. I don't think this
is a new problem but something we got with a new clang version.

This renames the net::UNKNOWN to net::UNKNOWN_CAUSE so that
net::FtpDirectoryListingEntry::UNKNOWN and other unknown
UNKNOWNs can stay.

net/ftp/ftp_directory_listing_parser.h:21:5: error: declaration shadows a variable in namespace 'net' [-Werror,-Wshadow]
    UNKNOWN,
    ^
net/quic/quic_chromium_client_session.h:83:3: note: previous declaration is here
  UNKNOWN,
  ^
1 error generated.

TBR=zhongyi@chromium.org

Change-Id: I96c6c8ba3b923a691537debbfe468874c767b939
Reviewed-on: https://chromium-review.googlesource.com/c/1326494
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606509}
This commit is contained in:
Daniel Bratell
2018-11-08 17:22:54 +00:00
committed by Commit Bot
parent c20c1c5002
commit de285c3d66
2 changed files with 4 additions and 4 deletions

@ -164,7 +164,7 @@ void RecordHandshakeState(HandshakeState state) {
std::string ConnectionMigrationCauseToString(ConnectionMigrationCause cause) {
switch (cause) {
case UNKNOWN:
case UNKNOWN_CAUSE:
return "Unknown";
case ON_NETWORK_CONNECTED:
return "OnNetworkConnected";
@ -736,7 +736,7 @@ QuicChromiumClientSession::QuicChromiumClientSession(
bytes_pushed_and_unclaimed_count_(0),
probing_manager_(this, task_runner_),
retry_migrate_back_count_(0),
current_connection_migration_cause_(UNKNOWN),
current_connection_migration_cause_(UNKNOWN_CAUSE),
send_packet_after_migration_(false),
wait_for_new_network_(false),
ignore_read_error_(false),
@ -2551,7 +2551,7 @@ void QuicChromiumClientSession::LogConnectionMigrationResultToHistogram(
"Net.QuicSession.ConnectionMigration." +
ConnectionMigrationCauseToString(current_connection_migration_cause_);
base::UmaHistogramEnumeration(histogram_name, status, MIGRATION_STATUS_MAX);
current_connection_migration_cause_ = UNKNOWN;
current_connection_migration_cause_ = UNKNOWN_CAUSE;
}
void QuicChromiumClientSession::LogHandshakeStatusOnConnectionMigrationSignal()

@ -80,7 +80,7 @@ enum class ConnectionMigrationMode {
// Cause of connection migration.
enum ConnectionMigrationCause {
UNKNOWN,
UNKNOWN_CAUSE,
ON_NETWORK_CONNECTED, // No probing.
ON_NETWORK_DISCONNECTED, // No probing.
ON_WRITE_ERROR, // No probing.