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

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

Issue 687273004: Measure the number of frame loads with Flash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 1 month 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 | « content/browser/frame_host/navigator_impl.cc ('k') | 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/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index c96e5f7e3ea4b165dd883c2a0fa1ca4b9bfab894..7cdda79ded3e579a64a7bb53c1a5044599e42790 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -390,6 +390,10 @@ void InitLatencyInfo(ui::LatencyInfo* new_latency,
}
}
+bool IsFlashPlugin(PluginModule* module) {
+ return module->name() == kFlashPluginName;
+}
+
} // namespace
// static
@@ -586,7 +590,7 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
power_saver_enabled_ =
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePluginPowerSaver) &&
- module_->name() == kFlashPluginName &&
+ IsFlashPlugin(module_.get()) &&
power_saver_helper->ShouldThrottleContent(
content_origin, bounds.width, bounds.height, &cross_origin);
@@ -610,6 +614,11 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
if (GetContentClient()->renderer() && // NULL in unit tests.
GetContentClient()->renderer()->IsExternalPepperPlugin(module->name()))
external_document_load_ = true;
+
+ if (IsFlashPlugin(module_.get())) {
+ RenderThread::Get()->RecordAction(
+ base::UserMetricsAction("Flash.PluginInstanceCreated"));
+ }
}
PepperPluginInstanceImpl::~PepperPluginInstanceImpl() {
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698