From 4f5c725dde176e4d919255beb230da5a8445e732 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 13 Dec 2016 14:24:20 -0800 Subject: [PATCH] :art: Use enum for world ids --- atom/renderer/atom_renderer_client.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index 336ec7e6f87..9f6c4605b6c 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -76,15 +76,15 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver { void CreateIsolatedWorldContext() { blink::WebScriptSource source("void 0"); render_frame_->GetWebFrame()->executeScriptInIsolatedWorld( - kIsolatedWorldId, &source, 1, 1); + World::ISOLATED, &source, 1, 1); } bool IsMainWorld(int world_id) { - return world_id == kMainWorldId; + return world_id == World::MAIN; } bool IsIsolatedWorld(int world_id) { - return world_id == kIsolatedWorldId; + return world_id == World::ISOLATED; } void DidCreateScriptContext(v8::Handle context, @@ -116,8 +116,10 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver { bool isolated_world_; AtomRendererClient* renderer_client_; - const int kMainWorldId = 0; - const int kIsolatedWorldId = 999; + enum World { + MAIN = 0, + ISOLATED = 999 + }; DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver); };