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

Unified Diff: content/renderer/pepper/plugin_instance_throttler_impl.cc

Issue 2416153005: Remove usage of FOR_EACH_OBSERVER macro in content/renderer (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/plugin_instance_throttler_impl.cc
diff --git a/content/renderer/pepper/plugin_instance_throttler_impl.cc b/content/renderer/pepper/plugin_instance_throttler_impl.cc
index 5b1f9eaf2f38faa670322effad92bca4f7fcbd35..b525309a6f06ff41906c0e420206def7fe8438bc 100644
--- a/content/renderer/pepper/plugin_instance_throttler_impl.cc
+++ b/content/renderer/pepper/plugin_instance_throttler_impl.cc
@@ -71,7 +71,8 @@ PluginInstanceThrottlerImpl::PluginInstanceThrottlerImpl(
weak_factory_(this) {}
PluginInstanceThrottlerImpl::~PluginInstanceThrottlerImpl() {
- FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottlerDestroyed());
+ for (auto& observer : observer_list_)
+ observer.OnThrottlerDestroyed();
if (state_ != THROTTLER_STATE_MARKED_ESSENTIAL)
RecordUnthrottleMethodMetric(UNTHROTTLE_METHOD_NEVER);
}
@@ -101,15 +102,19 @@ void PluginInstanceThrottlerImpl::MarkPluginEssential(
state_ = THROTTLER_STATE_MARKED_ESSENTIAL;
RecordUnthrottleMethodMetric(method);
- FOR_EACH_OBSERVER(Observer, observer_list_, OnPeripheralStateChange());
+ for (auto& observer : observer_list_)
+ observer.OnPeripheralStateChange();
- if (was_throttled)
- FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange());
+ if (was_throttled) {
+ for (auto& observer : observer_list_)
+ observer.OnThrottleStateChange();
+ }
}
void PluginInstanceThrottlerImpl::SetHiddenForPlaceholder(bool hidden) {
is_hidden_for_placeholder_ = hidden;
- FOR_EACH_OBSERVER(Observer, observer_list_, OnHiddenForPlaceholder(hidden));
+ for (auto& observer : observer_list_)
+ observer.OnHiddenForPlaceholder(hidden);
}
PepperWebPluginImpl* PluginInstanceThrottlerImpl::GetWebPlugin() const {
@@ -151,7 +156,8 @@ void PluginInstanceThrottlerImpl::Initialize(
if (status != RenderFrame::CONTENT_STATUS_PERIPHERAL) {
DCHECK_NE(THROTTLER_STATE_MARKED_ESSENTIAL, state_);
state_ = THROTTLER_STATE_MARKED_ESSENTIAL;
- FOR_EACH_OBSERVER(Observer, observer_list_, OnPeripheralStateChange());
+ for (auto& observer : observer_list_)
+ observer.OnPeripheralStateChange();
if (status == RenderFrame::CONTENT_STATUS_ESSENTIAL_CROSS_ORIGIN_BIG)
frame->WhitelistContentOrigin(content_origin);
@@ -213,15 +219,16 @@ void PluginInstanceThrottlerImpl::EngageThrottle() {
return;
if (!last_received_frame_.empty()) {
- FOR_EACH_OBSERVER(Observer, observer_list_,
- OnKeyframeExtracted(&last_received_frame_));
+ for (auto& observer : observer_list_)
+ observer.OnKeyframeExtracted(&last_received_frame_);
// Release our reference to the underlying pixel data.
last_received_frame_.reset();
}
state_ = THROTTLER_STATE_PLUGIN_THROTTLED;
- FOR_EACH_OBSERVER(Observer, observer_list_, OnThrottleStateChange());
+ for (auto& observer : observer_list_)
+ observer.OnThrottleStateChange();
}
} // namespace content
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698