mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: Chromium code style for enum classes (#26165)
This commit is contained in:
@@ -380,15 +380,15 @@ void ProxyingWebSocket::OnAuthRequiredComplete(AuthRequiredResponse rv) {
|
||||
CHECK(auth_required_callback_);
|
||||
ResumeIncomingMethodCallProcessing();
|
||||
switch (rv) {
|
||||
case AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_NO_ACTION:
|
||||
case AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_CANCEL_AUTH:
|
||||
case AuthRequiredResponse::kNoAction:
|
||||
case AuthRequiredResponse::kCancelAuth:
|
||||
std::move(auth_required_callback_).Run(base::nullopt);
|
||||
break;
|
||||
|
||||
case AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_SET_AUTH:
|
||||
case AuthRequiredResponse::kSetAuth:
|
||||
std::move(auth_required_callback_).Run(auth_credentials_);
|
||||
break;
|
||||
case AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_IO_PENDING:
|
||||
case AuthRequiredResponse::kIoPending:
|
||||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ void ProxyingWebSocket::OnHeadersReceivedCompleteForAuth(
|
||||
|
||||
auto continuation = base::BindRepeating(
|
||||
&ProxyingWebSocket::OnAuthRequiredComplete, weak_factory_.GetWeakPtr());
|
||||
auto auth_rv = AuthRequiredResponse::AUTH_REQUIRED_RESPONSE_IO_PENDING;
|
||||
auto auth_rv = AuthRequiredResponse::kIoPending;
|
||||
PauseIncomingMethodCallProcessing();
|
||||
|
||||
OnAuthRequiredComplete(auth_rv);
|
||||
|
||||
@@ -40,16 +40,16 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
|
||||
// AuthRequiredResponse indicates how an OnAuthRequired call is handled.
|
||||
enum class AuthRequiredResponse {
|
||||
// No credentials were provided.
|
||||
AUTH_REQUIRED_RESPONSE_NO_ACTION,
|
||||
kNoAction,
|
||||
// AuthCredentials is filled in with a username and password, which should
|
||||
// be used in a response to the provided auth challenge.
|
||||
AUTH_REQUIRED_RESPONSE_SET_AUTH,
|
||||
kSetAuth,
|
||||
// The request should be canceled.
|
||||
AUTH_REQUIRED_RESPONSE_CANCEL_AUTH,
|
||||
kCancelAuth,
|
||||
// The action will be decided asynchronously. |callback| will be invoked
|
||||
// when the decision is made, and one of the other AuthRequiredResponse
|
||||
// values will be passed in with the same semantics as described above.
|
||||
AUTH_REQUIRED_RESPONSE_IO_PENDING,
|
||||
kIoPending,
|
||||
};
|
||||
|
||||
ProxyingWebSocket(
|
||||
|
||||
Reference in New Issue
Block a user