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

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

Issue 2857393005: [Media Router] Sync state when MR extension is (re)connected to MR. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | chrome/browser/media/router/mojo/media_router_mojo_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/router/mojo/media_router_mojo_impl.h
diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.h b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
index f3f9d3d7b190ab84cdb6c0fa62f51936b1f8d6e3..65c6725bf4bec0b4dab09eec3c8453656afa9eaf 100644
--- a/chrome/browser/media/router/mojo/media_router_mojo_impl.h
+++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
@@ -154,6 +154,8 @@ class MediaRouterMojoImpl : public MediaRouterBase,
AttemptedWakeupTooManyTimes);
FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoExtensionTest,
WakeupFailedDrainsQueue);
+ FRIEND_TEST_ALL_PREFIXES(MediaRouterMojoExtensionTest,
+ SyncStateToMediaRouteProvider);
// The max number of pending requests allowed. When number of pending requests
// exceeds this number, the oldest request will be dropped.
@@ -188,9 +190,6 @@ class MediaRouterMojoImpl : public MediaRouterBase,
MediaRoutesQuery();
~MediaRoutesQuery();
- // True if the query has been sent to the MRPM. False otherwise.
- bool is_active = false;
-
// Cached list of routes and joinable route IDs for the query.
base::Optional<std::vector<MediaRoute>> cached_route_list;
std::vector<std::string> joinable_route_ids;
@@ -292,6 +291,17 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// Error handler callback for |binding_| and |media_route_provider_|.
void OnConnectionError();
+ // Issues 0+ calls to |media_route_provider_| to ensure its state is in sync
+ // with MediaRouter on a best-effort basis. This method can be only called if
+ // |media_route_provider_| is a valid handle.
+ // The extension might have become out of sync with MediaRouter due to one
+ // of few reasons:
+ // (1) The extension crashed and lost unpersisted changes.
+ // (2) The extension was updated; temporary data is cleared.
+ // (3) The extension has an unforseen bug which causes temporary data to be
+ // persisted incorrectly on suspension.
+ void SyncStateToMediaRouteProvider();
+
// mojom::MediaRouter implementation.
void RegisterMediaRouteProvider(
mojom::MediaRouteProviderPtr media_route_provider_ptr,
« no previous file with comments | « no previous file | chrome/browser/media/router/mojo/media_router_mojo_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698