Index: extensions/renderer/script_injection_manager.h |
diff --git a/extensions/renderer/script_injection_manager.h b/extensions/renderer/script_injection_manager.h |
index 8ec3d94ed142896f08fbe6f4f3d8c33f05f5e08b..12094a5a3fb1ee5d63aa15b2c0673d9c218931ae 100644 |
--- a/extensions/renderer/script_injection_manager.h |
+++ b/extensions/renderer/script_injection_manager.h |
@@ -45,6 +45,9 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer { |
// Notifies that a new render view has been created. |
void OnRenderViewCreated(content::RenderView* render_view); |
+ // Notifies that an injection has been finished |
Devlin
2015/03/03 00:34:10
nit: needs a period (same for below)
kozy
2015/03/03 13:50:20
Done.
|
+ void OnInjectionFinished(ScriptInjection* injection); |
+ |
private: |
// A RenderViewObserver implementation which watches the various render views |
// in order to notify the ScriptInjectionManager of different document load |
@@ -63,9 +66,6 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer { |
// Invalidate any pending tasks associated with |frame|. |
void InvalidateForFrame(blink::WebFrame* frame); |
- // Returns true if the given |frame| is still valid. |
- bool IsFrameValid(blink::WebFrame* frame) const; |
- |
// Starts the process to inject appropriate scripts into |frame|. |
void StartInjectScripts(blink::WebFrame* frame, |
UserScript::RunLocation run_location); |
@@ -74,6 +74,11 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer { |
void InjectScripts(blink::WebFrame* frame, |
UserScript::RunLocation run_location); |
+ // Try to inject and store injection if it has not finished |
+ void TryToInject(scoped_ptr<ScriptInjection> injection, |
+ UserScript::RunLocation run_location, |
+ ScriptsRunInfo* scripts_run_info); |
+ |
// Handle the ExecuteCode extension message. |
void HandleExecuteCode(const ExtensionMsg_ExecuteCode_Params& params, |
content::RenderView* render_view); |
@@ -98,13 +103,6 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer { |
// The collection of RVOHelpers. |
ScopedVector<RVOHelper> rvo_helpers_; |
- // True when the manager is actively injecting scripts into a web frame. |
- bool injecting_scripts_; |
- |
- // The set of extensions that have been updated (and thus any injections have |
- // been invalidated) while the manager was |injecting_scripts_|. |
- std::set<std::string> invalidated_while_injecting_; |
- |
// The set of UserScripts associated with extensions. Owned by the Dispatcher. |
UserScriptSetManager* user_script_set_manager_; |
@@ -112,6 +110,9 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer { |
// user consent. |
ScopedVector<ScriptInjection> pending_injections_; |
+ // Running injections which are waiting for async callbacks from blink |
+ ScopedVector<ScriptInjection> running_injections_; |
+ |
ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> |
user_script_set_manager_observer_; |