diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 20:41:34 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 20:41:34 +0000 |
commit | 08c98882b85f4d2256ad984caec1bae9c8d2f90b (patch) | |
tree | e5605488b4dc68c1d42ca5a74cd8f3721ed9a2ba /chrome/renderer/user_script_slave.cc | |
parent | c7bf140b32a1a6504e48716b90c6a13fd5c421d3 (diff) | |
download | chromium_src-08c98882b85f4d2256ad984caec1bae9c8d2f90b.zip chromium_src-08c98882b85f4d2256ad984caec1bae9c8d2f90b.tar.gz chromium_src-08c98882b85f4d2256ad984caec1bae9c8d2f90b.tar.bz2 |
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
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r-- | chrome/renderer/user_script_slave.cc | 13 |
1 files changed, 6 insertions, 7 deletions
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; |