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

Unified Diff: extensions/renderer/user_script_slave.h

Issue 288053002: Block content scripts from executing until user grants permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ben's Created 6 years, 7 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/user_script_slave.h
diff --git a/extensions/renderer/user_script_slave.h b/extensions/renderer/user_script_slave.h
index 4dd1029c4bcee26c0e183c5bedd402a176309c90..70bfdb1fae02f43aaf0feee6a789bce3c8557cab 100644
--- a/extensions/renderer/user_script_slave.h
+++ b/extensions/renderer/user_script_slave.h
@@ -46,7 +46,11 @@ class UserScriptSlave {
const Extension* GetExtension(const std::string& extension_id);
// Update the parsed scripts from shared memory.
- bool UpdateScripts(base::SharedMemoryHandle shared_memory);
+ // If |changed_extensions| is not empty, only those extensions will be
+ // updated.
+ // Otherwise, all extensions will be updated.
+ bool UpdateScripts(base::SharedMemoryHandle shared_memory,
+ const std::set<std::string>& changed_extensions);
// Gets the isolated world ID to use for the given |extension| in the given
// |frame|. If no isolated world has been created for that extension,
@@ -66,6 +70,14 @@ class UserScriptSlave {
// testability.
void InjectScripts(blink::WebFrame* frame, UserScript::RunLocation location);
+ // Allow an extension to inject scripts that were previously delayed for user
+ // approval.
+ void OnContentScriptGrantedPermission(
+ content::RenderView* render_view, int request_id);
+
+ // Notify the UserScriptSlave that the |frame| is detached, and about to die.
+ void FrameDetached(blink::WebFrame* frame);
+
private:
// Log the data from scripts being run, including doing UMA and notifying the
// browser.

Powered by Google App Engine
This is Rietveld 408576698