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

Unified Diff: chrome/browser/plugins/plugin_info_message_filter.h

Issue 2768263003: Plugins: Add UKM Metrics to Flash loads (Closed)
Patch Set: format Created 3 years, 9 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: chrome/browser/plugins/plugin_info_message_filter.h
diff --git a/chrome/browser/plugins/plugin_info_message_filter.h b/chrome/browser/plugins/plugin_info_message_filter.h
index 67a851f5db54bd3c7af6d0dba6a2df4b4e7aa34e..42ab27d7400a94b3b3d532530ea79c2ef48adf44 100644
--- a/chrome/browser/plugins/plugin_info_message_filter.h
+++ b/chrome/browser/plugins/plugin_info_message_filter.h
@@ -14,6 +14,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
+#include "base/strings/string_piece.h"
#include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "components/content_settings/core/common/content_settings.h"
@@ -62,6 +63,8 @@ class PluginInfoMessageFilter : public content::BrowserMessageFilter {
~Context();
+ int render_process_id() { return render_process_id_; }
+
void DecidePluginStatus(
const GURL& url,
const url::Origin& main_frame_origin,
@@ -150,11 +153,23 @@ class PluginInfoMessageFilter : public content::BrowserMessageFilter {
std::vector<base::string16>* additional_param_values);
#endif
+ // Reports usage metrics to RAPPOR and UKM. This is static because metrics
+ // report on the main thread, and cross-thread weak pointers are problematic.
Bernhard Bauer 2017/03/27 11:04:43 "Problematic" sounds like a Haunted Graveyard (htt
tommycli 2017/03/28 17:20:49 Done. I couldn't use weak pointers because the wea
Bernhard Bauer 2017/03/31 09:47:26 Hm, I just realized that the WeakPtrFactory could
+ static void ReportMetrics(int render_process_id,
Bernhard Bauer 2017/03/27 11:04:43 Can you add a comment to explain why this needs to
tommycli 2017/03/28 17:20:49 Done.
+ int render_frame_id,
+ const base::StringPiece& mime_type,
+ const GURL& url,
+ const url::Origin& main_frame_origin,
+ int32_t ukm_source_id);
+
Context context_;
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
shutdown_notifier_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+
+ const int32_t ukm_source_id_;
+
base::WeakPtrFactory<PluginInfoMessageFilter> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PluginInfoMessageFilter);

Powered by Google App Engine
This is Rietveld 408576698