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

Unified Diff: chrome/browser/media/router/media_router_mojo_impl.h

Issue 1765143002: [Media Router] Add UMA histograms tracking component extension version/wakeups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to isherman@ comments Created 4 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/media/router/media_router_mojo_impl.h
diff --git a/chrome/browser/media/router/media_router_mojo_impl.h b/chrome/browser/media/router/media_router_mojo_impl.h
index 0cc2eafb186a527d76bc271afdaeaef5203c3513..fb32ea453406ca5e1f44cfa83801f2ff46407b64 100644
--- a/chrome/browser/media/router/media_router_mojo_impl.h
+++ b/chrome/browser/media/router/media_router_mojo_impl.h
@@ -34,6 +34,7 @@ class BrowserContext;
namespace extensions {
class EventPageTracker;
+class Extension;
}
namespace media_router {
@@ -49,15 +50,15 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// Sets up the MediaRouterMojoImpl instance owned by |context| to handle
// MediaRouterObserver requests from the component extension given by
- // |extension_id|. Creates the MediaRouterMojoImpl instance if it does not
+ // |extension|. Creates the MediaRouterMojoImpl instance if it does not
// exist.
// Called by the Mojo module registry.
- // |extension_id|: The ID of the component extension, used for querying
+ // |extension|: The component extension, used for querying
// suspension state.
// |context|: The BrowserContext which owns the extension process.
// |request|: The Mojo connection request used for binding.
static void BindToRequest(
- const std::string& extension_id,
+ const extensions::Extension* extension,
content::BrowserContext* context,
mojo::InterfaceRequest<interfaces::MediaRouter> request);
@@ -181,10 +182,10 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// Binds |this| to a Mojo interface request, so that clients can acquire a
// handle to a MediaRouterMojoImpl instance via the Mojo service connector.
- // Stores the |extension_id| of the component extension.
+ // Stores the ID of |extension| in |media_route_provider_extension_id_|.
void BindToMojoRequest(
mojo::InterfaceRequest<interfaces::MediaRouter> request,
- const std::string& extension_id);
+ const extensions::Extension& extension);
// Enqueues a closure for later execution by ExecutePendingRequests().
void EnqueueTask(const base::Closure& closure);
@@ -373,6 +374,10 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// MediaRouteProviderWakeReason::TOTAL_COUNT if there is no pending reason.
MediaRouteProviderWakeReason current_wake_reason_;
+ // A flag to ensure that we record the provider version once, during the
+ // initial event page wakeup attempt.
+ bool provider_version_recorded_;
Wez 2016/03/18 18:35:43 nit: Suggest was_provider_version_recorded_ or hav
mark a. foltz 2016/03/18 20:11:00 Done.
+
base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl);

Powered by Google App Engine
This is Rietveld 408576698