Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_SERVICE_ROUTER_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_SESSION_SERVICE_ROUTER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 namespace mojom { | |
| 14 enum class MediaSessionAction; | |
| 15 } // namespace mojom | |
| 16 } // namespace blink; | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 class MediaSessionImpl; | |
| 21 class MediaSessionServiceImpl; | |
| 22 class RenderFrameHost; | |
| 23 | |
| 24 class MediaSessionServiceRouter final { | |
| 25 public: | |
| 26 MediaSessionServiceRouter(MediaSessionImpl* session); | |
| 27 ~MediaSessionServiceRouter(); | |
| 28 | |
| 29 void OnServiceCreated(MediaSessionServiceImpl* service); | |
|
whywhat
2016/11/22 23:13:16
nit: document public methods and the class.
Zhiqiang Zhang (Slow)
2016/11/25 14:50:41
Done.
| |
| 30 void OnServiceDestroyed(MediaSessionServiceImpl* service); | |
| 31 | |
| 32 void OnMediaSessionMetadataChanged(MediaSessionServiceImpl* service); | |
| 33 void OnMediaSessionActionsChanged(MediaSessionServiceImpl* service); | |
| 34 | |
| 35 void DidReceiveAction(blink::mojom::MediaSessionAction action); | |
| 36 | |
| 37 void MostMeaningfulPlayerObserverMayHaveChanged(); | |
| 38 | |
| 39 private: | |
| 40 void UpdateRoutedService(MediaSessionServiceImpl* service); | |
| 41 bool IsServiceActiveForRenderFrameHost(RenderFrameHost* rfh); | |
| 42 | |
| 43 using ServicesMap = std::map<RenderFrameHost*, MediaSessionServiceImpl*>; | |
| 44 | |
| 45 ServicesMap services_; | |
| 46 MediaSessionServiceImpl* routed_service_; | |
|
whywhat
2016/11/22 23:13:16
What's the life scope of these pointers? session_
Zhiqiang Zhang (Slow)
2016/11/25 14:50:41
Documented on the ownership.
| |
| 47 MediaSessionImpl* session_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(MediaSessionServiceRouter); | |
| 50 }; | |
| 51 | |
| 52 } // namespace content | |
| 53 | |
| 54 #endif // CONTENT_BROWSER_MEDIA_SESSION_SERVICE_ROUTER_H_ | |
| OLD | NEW |