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

Unified Diff: content/browser/ppapi_plugin_process_host.cc

Issue 929483004: Plugin Power Saver: Throttled Plugins should block TCPSocket reads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: content/browser/ppapi_plugin_process_host.cc
diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
index 608d6c9fd0378cdcd9e09619977f8d922fd8bf57..480296fd03134ab1800ebb5ec6cac3f8640dd3e4 100644
--- a/content/browser/ppapi_plugin_process_host.cc
+++ b/content/browser/ppapi_plugin_process_host.cc
@@ -199,6 +199,24 @@ void PpapiPluginProcessHost::DidDeleteOutOfProcessInstance(
}
// static
+void PpapiPluginProcessHost::OnPluginInstanceThrottleStateChange(
+ int plugin_process_id,
+ int32 pp_instance,
+ bool is_throttled) {
+ for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) {
+ if (iter->process_.get() &&
+ iter->process_->GetData().id == plugin_process_id) {
+ // Found the plugin.
+ iter->host_impl_->OnThrottleStateChanged(pp_instance, is_throttled);
+ return;
+ }
+ }
+ // Note: It's possible that the plugin process has already been deleted by
+ // the time this message is received. For example, it could have crashed.
+ // That's OK, we can just ignore this message.
+}
+
+// static
void PpapiPluginProcessHost::FindByName(
const base::string16& name,
std::vector<PpapiPluginProcessHost*>* hosts) {

Powered by Google App Engine
This is Rietveld 408576698