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

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

Issue 871113003: Plugin Power Saver: Fix Flash JS usage UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | no next file » | 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 bb52461ca16543ef85a804233902b5e57a1ac27a..0ad75ff733c4684c651cdcfbcd6568eb1f05d74b 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -522,6 +522,7 @@ PepperPluginInstanceImpl::PepperPluginInstanceImpl(
is_deleted_(false),
last_input_number_(0),
is_tracking_latency_(false),
+ initialized_(false),
view_change_weak_ptr_factory_(this),
weak_factory_(this) {
pp_instance_ = HostGlobals::Get()->AddInstance(this);
@@ -845,6 +846,7 @@ bool PepperPluginInstanceImpl::Initialize(
if (message_channel_)
message_channel_->Start();
}
+ initialized_ = success;
return success;
}
@@ -3276,7 +3278,7 @@ void PepperPluginInstanceImpl::DidDataFromWebURLResponse(
}
void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() {
- if (!javascript_used_ && is_flash_plugin_) {
+ if (initialized_ && !javascript_used_ && is_flash_plugin_) {
javascript_used_ = true;
RenderThread::Get()->RecordAction(
base::UserMetricsAction("Flash.JavaScriptUsed"));
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698