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

Unified Diff: extensions/renderer/script_context_set.h

Issue 327953002: Make MessagingBindings use ScriptContextSet::ForEach (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ForEach shortcuts Created 6 years, 6 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/script_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/script_context_set.h
diff --git a/extensions/renderer/script_context_set.h b/extensions/renderer/script_context_set.h
index a6be82dc4b2658f4cc8173982cd23190c527ec87..aa7b253d57742bbff456be1c06a024a87ce2dcbf 100644
--- a/extensions/renderer/script_context_set.h
+++ b/extensions/renderer/script_context_set.h
@@ -66,11 +66,22 @@ class ScriptContextSet {
// Synchronously runs |callback| with each ScriptContext that belongs to
// |extension_id| in |render_view|.
//
- // |extension_id| may be "" to match all extensions.
- // |render_view| may be NULL to match all render views.
+ // An empty |extension_id| will match all extensions, and a NULL |render_view|
+ // will match all render views, but try to use the inline variants of these
+ // methods instead.
void ForEach(const std::string& extension_id,
content::RenderView* render_view,
const base::Callback<void(ScriptContext*)>& callback) const;
+ // ForEach which matches all extensions.
+ void ForEach(content::RenderView* render_view,
+ const base::Callback<void(ScriptContext*)>& callback) const {
+ ForEach("", render_view, callback);
+ }
+ // ForEach which matches all render views.
+ void ForEach(const std::string& extension_id,
+ const base::Callback<void(ScriptContext*)>& callback) const {
+ ForEach(extension_id, NULL, callback);
+ }
// Cleans up contexts belonging to an unloaded extension.
//
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698