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

Side by Side Diff: extensions/renderer/user_script_set_manager.cc

Issue 2424593002: Reduce FOR_EACH_OBSERVER usage in extensions (Closed)
Patch Set: script_observers_ Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/user_script_set.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/renderer/user_script_set_manager.h" 5 #include "extensions/renderer/user_script_set_manager.h"
6 6
7 #include "components/crx_file/id_util.h" 7 #include "components/crx_file/id_util.h"
8 #include "content/public/renderer/render_thread.h" 8 #include "content/public/renderer/render_thread.h"
9 #include "extensions/common/extension_messages.h" 9 #include "extensions/common/extension_messages.h"
10 #include "extensions/renderer/dispatcher.h" 10 #include "extensions/renderer/dispatcher.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 all_hosts.insert(HostID(HostID::EXTENSIONS, extension_id)); 144 all_hosts.insert(HostID(HostID::EXTENSIONS, extension_id));
145 } else { 145 } else {
146 all_hosts.insert(host_id); 146 all_hosts.insert(host_id);
147 } 147 }
148 effective_hosts = &all_hosts; 148 effective_hosts = &all_hosts;
149 } 149 }
150 150
151 if (scripts->UpdateUserScripts(shared_memory, 151 if (scripts->UpdateUserScripts(shared_memory,
152 *effective_hosts, 152 *effective_hosts,
153 whitelisted_only)) { 153 whitelisted_only)) {
154 FOR_EACH_OBSERVER(Observer, observers_, 154 for (auto& observer : observers_)
155 OnUserScriptsUpdated(*effective_hosts)); 155 observer.OnUserScriptsUpdated(*effective_hosts);
156 } 156 }
157 } 157 }
158 158
159 } // namespace extensions 159 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/user_script_set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698