Chromium Code Reviews| Index: media/base/overlay_info.h |
| diff --git a/media/base/overlay_info.h b/media/base/overlay_info.h |
| index da0c387dcbcfcc65e3c96ea27cbb733fbeca478c..6ac35d2f052ae602ac52958b92600d7593bf8c9f 100644 |
| --- a/media/base/overlay_info.h |
| +++ b/media/base/overlay_info.h |
| @@ -9,13 +9,53 @@ |
| #include "base/macros.h" |
| #include "base/optional.h" |
| #include "base/unguessable_token.h" |
| +#include "media/base/media_export.h" |
| +#include "media/base/surface_manager.h" |
| namespace media { |
| +struct MEDIA_EXPORT OverlayInfo { |
| + OverlayInfo(); |
| + OverlayInfo(const OverlayInfo&); |
| + |
| + static OverlayInfo SurfaceChange(int surface_id); |
| + static OverlayInfo RoutingTokenChange( |
| + base::Optional<base::UnguessableToken> token); |
| + static OverlayInfo FullscreenChange(bool is_fullscreen); |
| + |
| + // Copy all values specified in |other| into |this|, and leave unchanged any |
| + // that |other| doesn't specify. |
|
tguilbert
2017/05/24 19:14:54
NIT: I am not sure that I like this shorthand oper
liberato (no reviews please)
2017/05/24 21:21:07
| is commutative, but this is |= .
still, it's a
|
| + OverlayInfo& operator|=(const OverlayInfo& other); |
| + |
| + // An unset routing token indicates "do not use any routing token". A null |
| + // routing token isn't serializable, else we'd probably use that instead. |
| + using RoutingToken = base::Optional<base::UnguessableToken>; |
| + |
| + // If any of these are not provided, then the intention is that this message |
| + // does not make any claims about them. For example, one might receive an |
| + // OverlayInfo with |routing_token| supplied, then a later one with |
| + // |is_fullscreen| supplied. The first message makes no claims about whether |
| + // one is in fullscreen or not. The second one does not provide any update |
| + // to the routing token. |
| + |
| + // Of course, one message may specify more than one of these. |
| + |
| + // If provided, this is the SurfaceManager surface id, or |
| + // SurfaceManager:;kNoSurfaceID to indicate that no surface should be used. |
| + base::Optional<int> surface_id; |
| + |
| + // If provided, the mojo AndroidOverlay routing token or "use no token" if |
| + // !(*routing_token). Note the extra indirection; |routing_token| is, itself, |
| + // a base::Optional. |
| + base::Optional<RoutingToken> routing_token; |
| + |
| + // If provided, indicates whether we're in fullscreen mode or not. |
| + base::Optional<bool> is_fullscreen; |
| +}; |
| + |
| // Request information to construct an overlay. This can be either a surface_id |
| // or an AndroidOverlay routing token. |
| -using ProvideOverlayInfoCB = |
| - base::Callback<void(int, const base::Optional<base::UnguessableToken>&)>; |
| +using ProvideOverlayInfoCB = base::Callback<void(const OverlayInfo&)>; |
| using RequestOverlayInfoCB = |
| base::Callback<void(bool, const ProvideOverlayInfoCB&)>; |