refactor: Chromium code style for enum classes (#26165)

This commit is contained in:
Milan Burda 2020-10-27 18:51:45 +01:00 committed by GitHub
parent dbf2931f0e
commit 1c99a9b425
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 300 additions and 295 deletions

View file

@ -27,11 +27,11 @@ void RegisterSchemesAsPrivileged(gin_helper::ErrorThrower thrower,
// Possible errors.
enum class ProtocolError {
OK, // no error
REGISTERED,
NOT_REGISTERED,
INTERCEPTED,
NOT_INTERCEPTED,
kOK, // no error
kRegistered,
kNotRegistered,
kIntercepted,
kNotIntercepted,
};
// Protocol implementation based on network services.
@ -78,7 +78,7 @@ class Protocol : public gin::Wrappable<Protocol> {
gin::Arguments* args) {
auto result = RegisterProtocol(type, scheme, handler);
HandleOptionalCallback(args, result);
return result == ProtocolError::OK;
return result == ProtocolError::kOK;
}
template <ProtocolType type>
bool InterceptProtocolFor(const std::string& scheme,
@ -86,7 +86,7 @@ class Protocol : public gin::Wrappable<Protocol> {
gin::Arguments* args) {
auto result = InterceptProtocol(type, scheme, handler);
HandleOptionalCallback(args, result);
return result == ProtocolError::OK;
return result == ProtocolError::kOK;
}
// Be compatible with old interface, which accepts optional callback.