Chromium Code Reviews| 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..c91501c2affc7c36d3e5c805501cba53c63d6c55 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. |
|
mark a. foltz
2017/05/03 17:37:08
Logically, this should be kicked off in RegisterMe
imcheng
2017/05/03 18:22:41
Correct. In other words, having a valid MRP 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 EnsureMediaRouteProviderStateSynced(); |
|
mark a. foltz
2017/05/03 17:37:08
Can this be a verb, i.e. SyncToMediaRouteProvider(
imcheng
2017/05/03 18:22:41
Renamed to SyncStateToMediaRouteProvider.
|
| + |
| // mojom::MediaRouter implementation. |
| void RegisterMediaRouteProvider( |
| mojom::MediaRouteProviderPtr media_route_provider_ptr, |