Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: extensions/renderer/programmatic_script_injector.h

Issue 2213603002: Prevent duplicate content script injection defined in manifest.json (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed patch 7 code review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/renderer/programmatic_script_injector.h
diff --git a/extensions/renderer/programmatic_script_injector.h b/extensions/renderer/programmatic_script_injector.h
index b408d58a34a1ed5ada9774e8e417facd925c9cd8..3246504bea63196627b458f90abd092afc5b4678 100644
--- a/extensions/renderer/programmatic_script_injector.h
+++ b/extensions/renderer/programmatic_script_injector.h
@@ -19,6 +19,7 @@ class RenderFrame;
}
namespace extensions {
+struct ScriptsRunInfo;
// A ScriptInjector to handle tabs.executeScript().
class ProgrammaticScriptInjector : public ScriptInjector {
@@ -33,18 +34,24 @@ class ProgrammaticScriptInjector : public ScriptInjector {
bool ShouldExecuteInMainWorld() const override;
bool IsUserGesture() const override;
bool ExpectsResults() const override;
- bool ShouldInjectJs(UserScript::RunLocation run_location) const override;
- bool ShouldInjectCss(UserScript::RunLocation run_location) const override;
+ bool ShouldInjectJs(UserScript::RunLocation run_location,
+ std::map<std::string, std::set<std::string>>&
Devlin 2016/09/06 17:21:13 Remember, chromium style discourages non-const ref
catmullings 2016/09/07 01:00:35 Done.
+ executing_scripts) const override;
+ bool ShouldInjectCss(UserScript::RunLocation run_location,
+ std::map<std::string, std::set<std::string>>&
+ executing_scripts) const override;
PermissionsData::AccessType CanExecuteOnFrame(
const InjectionHost* injection_host,
blink::WebLocalFrame* web_frame,
int tab_id) const override;
std::vector<blink::WebScriptSource> GetJsSources(
- UserScript::RunLocation run_location) const override;
+ UserScript::RunLocation run_location,
+ std::map<std::string, std::set<std::string>>* executing_scripts,
+ size_t* num_injected_js_scripts) const override;
std::vector<blink::WebString> GetCssSources(
- UserScript::RunLocation run_location) const override;
- void GetRunInfo(ScriptsRunInfo* scripts_run_info,
- UserScript::RunLocation run_location) const override;
+ UserScript::RunLocation run_location,
+ std::map<std::string, std::set<std::string>>* executing_scripts,
+ size_t* num_injected_css_scripts) const override;
void OnInjectionComplete(std::unique_ptr<base::Value> execution_result,
UserScript::RunLocation run_location,
content::RenderFrame* render_frame) override;

Powered by Google App Engine
This is Rietveld 408576698