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

Unified Diff: extensions/renderer/script_injection_manager.h

Issue 878513005: Extensions: suspend extension's scripts when V8 is paused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 08cf1e13189e9c4def928112bf107dd844d577a8..8fe8e10737cf39061baa2398fe932915dc0423eb 100644
--- a/extensions/renderer/script_injection_manager.h
+++ b/extensions/renderer/script_injection_manager.h
@@ -48,6 +48,9 @@ class ScriptInjectionManager : public UserScriptSetManager::Observer {
// Removes pending injections of the unloaded extension.
void OnExtensionUnloaded(const std::string& extension_id);
+ // Notifies that an injection has been finished.
+ void OnInjectionFinished(ScriptInjection* injection);
+
private:
// A RenderViewObserver implementation which watches the various render views
// in order to notify the ScriptInjectionManager of different document load
@@ -66,9 +69,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);
@@ -77,6 +77,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);
@@ -101,13 +106,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_;
@@ -115,6 +113,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_;

Powered by Google App Engine
This is Rietveld 408576698