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

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

Issue 2855473004: [Media Router] Sync state when MR extension is (re)connected to MR. (Closed)
Patch Set: Addressed Mark's comments Created 3 years, 8 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 8f311c9a84260ca91ba3c3d2472c90688953bbed..06f15de3c094173822085f149a93dacd55eae874 100644
--- a/chrome/browser/media/router/mojo/media_router_mojo_impl.h
+++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.h
@@ -165,6 +165,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.
@@ -199,9 +201,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;
@@ -309,6 +308,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