From 1ef803d2eae0ac3e54c2d5433405a1b7ab8fb5eb Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 21 Oct 2020 02:47:04 +0200 Subject: [PATCH] chore: make RenderProcessHostPrivilege enum class (#26050) --- shell/browser/electron_browser_client.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 08441507b8f4..b162378ad45e 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -236,11 +236,11 @@ const base::FilePath::StringPieceType kPathDelimiter = FILE_PATH_LITERAL(":"); // below. Extension, and isolated apps require different privileges to be // granted to their RenderProcessHosts. This classification allows us to make // sure URLs are served by hosts with the right set of privileges. -enum RenderProcessHostPrivilege { - PRIV_NORMAL, - PRIV_HOSTED, - PRIV_ISOLATED, - PRIV_EXTENSION, +enum class RenderProcessHostPrivilege { + Normal, + Hosted, + Isolated, + Extension, }; RenderProcessHostPrivilege GetPrivilegeRequiredByUrl( @@ -253,12 +253,12 @@ RenderProcessHostPrivilege GetPrivilegeRequiredByUrl( // than normal webrenderer, the navigation logic will correct us out of band // anyways. if (!url.is_valid()) - return PRIV_NORMAL; + return RenderProcessHostPrivilege::Normal; if (!url.SchemeIs(extensions::kExtensionScheme)) - return PRIV_NORMAL; + return RenderProcessHostPrivilege::Normal; - return PRIV_EXTENSION; + return RenderProcessHostPrivilege::Extension; } RenderProcessHostPrivilege GetProcessPrivilege( @@ -268,9 +268,9 @@ RenderProcessHostPrivilege GetProcessPrivilege( std::set extension_ids = process_map->GetExtensionsInProcess(process_host->GetID()); if (extension_ids.empty()) - return PRIV_NORMAL; + return RenderProcessHostPrivilege::Normal; - return PRIV_EXTENSION; + return RenderProcessHostPrivilege::Extension; } const extensions::Extension* GetEnabledExtensionFromEffectiveURL(