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

Unified Diff: chrome/renderer/extensions/user_script_idle_scheduler.h

Issue 9456037: Adding run_at to chrome.tabs.executeScript/insertCss. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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: chrome/renderer/extensions/user_script_idle_scheduler.h
diff --git a/chrome/renderer/extensions/user_script_idle_scheduler.h b/chrome/renderer/extensions/user_script_idle_scheduler.h
index 782ce86974ea446e93b2fb9afcf73a0383dfe212..1767674ff480b76a4761f821d670638f8762e452 100644
--- a/chrome/renderer/extensions/user_script_idle_scheduler.h
+++ b/chrome/renderer/extensions/user_script_idle_scheduler.h
@@ -38,11 +38,16 @@ class WebFrame;
// ExtensionDispatcher, which contains the mapping from WebFrame to us.
class UserScriptIdleScheduler {
Aaron Boodman 2012/03/03 00:59:10 Can you change the name of this class and rename t
eaugusti 2012/03/27 00:43:34 Done.
public:
+ typedef
Mihai Parparita -not on Chrome 2012/03/01 00:40:08 This typedef should be private.
eaugusti 2012/03/27 00:43:34 Done.
+ std::vector<std::queue<linked_ptr<ExtensionMsg_ExecuteCode_Params> > >
Mihai Parparita -not on Chrome 2012/03/01 00:40:08 Why not make this a map from RunLocation to the qu
eaugusti 2012/03/27 00:43:34 Done.
+ Schedule;
+
UserScriptIdleScheduler(WebKit::WebFrame* frame,
ExtensionDispatcher* extension_dispatcher);
~UserScriptIdleScheduler();
void ExecuteCode(const ExtensionMsg_ExecuteCode_Params& params);
+ void DidCreateDocumentElement();
void DidFinishDocumentLoad();
void DidFinishLoad();
void DidStartProvisionalLoad();
@@ -60,6 +65,9 @@ class UserScriptIdleScheduler {
bool GetAllChildFrames(WebKit::WebFrame* parent_frame,
std::vector<WebKit::WebFrame*>* frames_vector) const;
+ // Call to signify thet the idle timeout has expired.
+ void IdleTimeout();
+
base::WeakPtrFactory<UserScriptIdleScheduler> weak_factory_;
// The Frame we will run scripts in.
@@ -68,9 +76,13 @@ class UserScriptIdleScheduler {
// Whether we have already run scripts.
bool has_run_;
+ // The current location in the document lodaing process.
Mihai Parparita -not on Chrome 2012/03/01 00:40:08 Typo ("lodaing").
eaugusti 2012/03/27 00:43:34 Done.
+ // Will be -1 if it is before any scripts should be run.
+ // Otherwise it will be one of UserScript::RunLocation
+ int current_location_;
+
// This is only used if we're for the main frame.
- std::queue<linked_ptr<ExtensionMsg_ExecuteCode_Params> >
- pending_code_execution_queue_;
+ Schedule pending_code_execution_queue_;
ExtensionDispatcher* extension_dispatcher_;
};

Powered by Google App Engine
This is Rietveld 408576698