diff options
author | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 22:41:02 +0000 |
---|---|---|
committer | rdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-03 22:41:02 +0000 |
commit | 0d8d69767a1ff6becad7e25442ccdf94cac7290e (patch) | |
tree | bf080b49953ed8bf895e5bc9de306b64fb3dba37 /extensions/common/user_script.cc | |
parent | e8daf71e4ad7e36b52267316c7f33b754356a01c (diff) | |
download | chromium_src-0d8d69767a1ff6becad7e25442ccdf94cac7290e.zip chromium_src-0d8d69767a1ff6becad7e25442ccdf94cac7290e.tar.gz chromium_src-0d8d69767a1ff6becad7e25442ccdf94cac7290e.tar.bz2 |
Resubmit: Block content scripts from executing until user grants permission
Original CL: https://codereview.chromium.org/288053002/
Original Description:
Prevent extensions with <all_urls> from running content scripts without user
consent if the scripts-require-action switch is on.
-----------------------------------------------
This had a problem in that when user scripts are updated, the old versions
are invalidated (as they rely on StringPieces, which do not actually own
content). Fix is to update all user scripts, even if they didn't actually
change.
Also add in ActiveScriptController removing actions for unloaded extensions.
TBR=jschuh@chromium.org (for extension_messages.h, no change from original patch)
BUG=362353
Review URL: https://codereview.chromium.org/313453002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/common/user_script.cc')
-rw-r--r-- | extensions/common/user_script.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc index 4f51504..128ac55 100644 --- a/extensions/common/user_script.cc +++ b/extensions/common/user_script.cc @@ -70,6 +70,7 @@ UserScript::File::~File() {} UserScript::UserScript() : run_location_(DOCUMENT_IDLE), + user_script_id_(-1), emulate_greasemonkey_(false), match_all_frames_(false), match_about_blank_(false), @@ -127,6 +128,7 @@ void UserScript::Pickle(::Pickle* pickle) const { // Write the simple types to the pickle. pickle->WriteInt(run_location()); pickle->WriteString(extension_id()); + pickle->WriteInt64(user_script_id_); pickle->WriteBool(emulate_greasemonkey()); pickle->WriteBool(match_all_frames()); pickle->WriteBool(match_about_blank()); @@ -176,6 +178,7 @@ void UserScript::Unpickle(const ::Pickle& pickle, PickleIterator* iter) { run_location_ = static_cast<RunLocation>(run_location); CHECK(pickle.ReadString(iter, &extension_id_)); + CHECK(pickle.ReadInt64(iter, &user_script_id_)); CHECK(pickle.ReadBool(iter, &emulate_greasemonkey_)); CHECK(pickle.ReadBool(iter, &match_all_frames_)); CHECK(pickle.ReadBool(iter, &match_about_blank_)); |