From 08c98882b85f4d2256ad984caec1bae9c8d2f90b Mon Sep 17 00:00:00 2001 From: "mpcomplete@chromium.org" Date: Fri, 12 Feb 2010 20:41:34 +0000 Subject: Fix a CHECK when opening an incognito tab with user scripts installed. Review URL: http://codereview.chromium.org/606030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38933 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/renderer/user_script_slave.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'chrome/renderer') diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc index 0c0574b..33adfbd 100644 --- a/chrome/renderer/user_script_slave.cc +++ b/chrome/renderer/user_script_slave.cc @@ -102,13 +102,6 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory, UserScript* script = scripts_.back(); script->Unpickle(pickle, &iter); - if (only_inject_incognito && !script->is_incognito_enabled()) { - // This script shouldn't run in an incognito tab. - delete script; - scripts_.pop_back(); - continue; - } - // Note that this is a pointer into shared memory. We don't own it. It gets // cleared up when the last renderer or browser process drops their // reference to the shared memory. @@ -126,6 +119,12 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory, script->css_scripts()[j].set_external_content( base::StringPiece(body, body_length)); } + + if (only_inject_incognito && !script->is_incognito_enabled()) { + // This script shouldn't run in an incognito tab. + delete script; + scripts_.pop_back(); + } } return true; -- cgit v1.1