From 03b45c73bc4bf16300b353c6492b74055e198df7 Mon Sep 17 00:00:00 2001
From: "jochen@chromium.org"
 <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed, 22 Jan 2014 14:36:11 +0000
Subject: Only install extensions into the main world

BUG=none
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/144073006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246322 0039d316-1c4b-4281-b951-d872f2087c98
---
 content/renderer/render_view_impl.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'content/renderer/render_view_impl.cc')

diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 0dcfea8..013c2c0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3636,7 +3636,11 @@ void RenderViewImpl::didClearWindowObject(WebFrame* frame, int world_id) {
   FOR_EACH_OBSERVER(RenderViewObserver, observers_,
                     DidClearWindowObject(frame, world_id));
 
-  if ((enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION) && (world_id == 0))
+  // Only install controllers into the main world.
+  if (!world_id)
+    return;
+
+  if (enabled_bindings_ & BINDINGS_POLICY_DOM_AUTOMATION))
     DomAutomationController::Install(this, frame);
 
   if (enabled_bindings_ & BINDINGS_POLICY_STATS_COLLECTION)
-- 
cgit v1.1