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

Unified Diff: extensions/renderer/extension_frame_helper.h

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: comments addressed Created 3 years, 9 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
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/renderer/extension_frame_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/extension_frame_helper.h
diff --git a/extensions/renderer/extension_frame_helper.h b/extensions/renderer/extension_frame_helper.h
index 518e9ca48510fd5edeab686658f27449acf1ec90..d4fc8d6ad21e885f6c9ce21f9c48597acdaa8bad 100644
--- a/extensions/renderer/extension_frame_helper.h
+++ b/extensions/renderer/extension_frame_helper.h
@@ -73,6 +73,9 @@ class ExtensionFrameHelper
// Called after the DOMContentLoaded event has fired.
void RunScriptsAtDocumentEnd();
+ // Called before the window.onload event is fired.
+ void RunScriptsAtDocumentIdle();
+
// Schedule a callback, to be run at the next RunScriptsAtDocumentStart
// notification. Only call this when you are certain that there will be such a
// notification, e.g. from RenderFrameObserver::DidCreateDocumentElement.
@@ -83,6 +86,9 @@ class ExtensionFrameHelper
// Schedule a callback, to be run at the next RunScriptsAtDocumentEnd call.
void ScheduleAtDocumentEnd(const base::Closure& callback);
+ // Schedule a callback, to be run at the next RunScriptsAtDocumentIdle call.
+ void ScheduleAtDocumentIdle(const base::Closure& callback);
+
private:
// RenderFrameObserver implementation.
void DidCreateDocumentElement() override;
@@ -142,6 +148,9 @@ class ExtensionFrameHelper
// Callbacks to be run at the next RunScriptsAtDocumentEnd notification.
std::vector<base::Closure> document_load_finished_callbacks_;
+ // Callbacks to be run at the next RunScriptsAtDocumentIdle notification.
+ std::vector<base::Closure> document_idle_callbacks_;
+
bool delayed_main_world_script_initialization_ = false;
base::WeakPtrFactory<ExtensionFrameHelper> weak_ptr_factory_;
« no previous file with comments | « extensions/renderer/dispatcher.cc ('k') | extensions/renderer/extension_frame_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698