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

Unified Diff: extensions/renderer/script_injection_manager.h

Issue 2134613002: Stop injection when injections are invalidated Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/script_injection_manager.h
diff --git a/extensions/renderer/script_injection_manager.h b/extensions/renderer/script_injection_manager.h
index aaad2c9d58f5edaa5fa145cad378bdd6b60daed2..d2283f07a3ae57223d80b9e1c70caabbe8dd3a3e 100644
--- a/extensions/renderer/script_injection_manager.h
+++ b/extensions/renderer/script_injection_manager.h
@@ -53,6 +53,7 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer {
// frames in order to notify the ScriptInjectionManager of different
// document load states and IPCs.
class RFOHelper;
+ class ScriptInjectionWatcher;
using FrameStatusMap =
std::map<content::RenderFrame*, UserScript::RunLocation>;
@@ -119,6 +120,10 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer {
// Running injections which are waiting for async callbacks from blink.
ScriptInjectionVector running_injections_;
+ // Tracks injections that are about to be injected. Injections are added
+ // right before injection, and removed immediately after.
+ std::vector<ScriptInjectionWatcher*> injection_watchers_;
+
// Whether or not dom activity should be logged for scripts injected.
bool activity_logging_enabled_ = false;

Powered by Google App Engine
This is Rietveld 408576698