commit | ff6ff85a93111903f5bf1b238c0428665f98ae55 | [log] [tgz] |
---|---|---|
author | Manish Jethani <m.jethani@eyeo.com> | Fri Feb 23 07:24:55 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 23 07:24:55 2018 |
tree | 0498b0487265c6403f850e74152c6cfbca98e56d | |
parent | 779a8e035025c76ee76bf11f8dc7aa95ebb56c9a [diff] |
Add injection key for programmatic CSS injections This builds on crrev.com/c/877663 For programmatic CSS injections via tabs.insertCSS, we calculate an "injection key" deterministically based on either the file URL or the code string. This enables us to later remove the injected CSS by the same parameters that were used to inject it. Changes: 1. ExtensionMsg_ExecuteCode_Params has a new member called injection_key of type base::Optional<std::string> 2. ScriptExecutor::ExecuteScript now calculates an injection key for CSS injections; this is a combination of the type (file or code), the host ID, and the hash digest (base::Hash) of either the file URL, if available, or the the code string 3. ScriptInjector has a new method called GetInjectionKey; UserScriptInjector always returns null, whereas ProgrammaticScriptInjector returns the value passed to it via ExtensionMsg_ExecuteCode_Params 4. ScriptInjection::InjectCss now passes the actual injection key to WebDocument::InsertStyleSheet BUG=608854 Change-Id: I91a3983682cc61d739d3c31a11e8f58dabb8e12c Reviewed-on: https://chromium-review.googlesource.com/913628 Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Manish Jethani <m.jethani@eyeo.com> Cr-Commit-Position: refs/heads/master@{#538722}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .