Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | |
| 11 | |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 12 #include "base/containers/scoped_ptr_hash_map.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/browser/media/media_web_contents_observer.h" | 15 #include "content/browser/media/media_web_contents_observer.h" |
| 14 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 15 | 17 |
| 16 namespace content { | 18 namespace content { |
| 17 | 19 |
| 18 class BrowserCdmManager; | 20 class BrowserCdmManager; |
| 19 class BrowserMediaPlayerManager; | 21 class BrowserMediaPlayerManager; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 | 53 |
| 52 #if defined(VIDEO_HOLE) | 54 #if defined(VIDEO_HOLE) |
| 53 void OnFrameInfoUpdated(); | 55 void OnFrameInfoUpdated(); |
| 54 #endif // defined(VIDEO_HOLE) | 56 #endif // defined(VIDEO_HOLE) |
| 55 | 57 |
| 56 // MediaWebContentsObserverAndroid overrides. | 58 // MediaWebContentsObserverAndroid overrides. |
| 57 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; | 59 void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| 58 bool OnMessageReceived(const IPC::Message& message, | 60 bool OnMessageReceived(const IPC::Message& message, |
| 59 RenderFrameHost* render_frame_host) override; | 61 RenderFrameHost* render_frame_host) override; |
| 60 | 62 |
| 63 protected: | |
| 64 void WaitForAudioFocusAsyncInternal(int render_frame_id, | |
|
mlamouri (slow - plz ping)
2016/02/03 15:20:52
Add comment saying that `callback` may never be ca
| |
| 65 const base::Closure& focus_cb) override; | |
|
mlamouri (slow - plz ping)
2016/02/03 15:20:52
nit: `callback`
| |
| 66 | |
| 61 private: | 67 private: |
| 62 // Handles messages from the WebMediaPlayerDelegate; does not modify the | 68 // Handles messages from the WebMediaPlayerDelegate; does not modify the |
| 63 // handled state since the superclass needs to handle these as well. | 69 // handled state since the superclass needs to handle these as well. |
| 64 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg, | 70 void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg, |
| 65 RenderFrameHost* render_frame_host); | 71 RenderFrameHost* render_frame_host); |
| 66 void OnMediaDestroyed(RenderFrameHost* render_frame_host, int delegate_id); | 72 void OnMediaDestroyed(RenderFrameHost* render_frame_host, int delegate_id); |
| 67 void OnMediaPaused(RenderFrameHost* render_frame_host, | 73 void OnMediaPaused(RenderFrameHost* render_frame_host, |
| 68 int delegate_id, | 74 int delegate_id, |
| 69 bool reached_end_of_stream); | 75 bool reached_end_of_stream); |
| 70 void OnMediaPlaying(RenderFrameHost* render_frame_host, | 76 void OnMediaPlaying(RenderFrameHost* render_frame_host, |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 95 | 101 |
| 96 // Map from RenderFrameHost* to BrowserMediaSessionManager. | 102 // Map from RenderFrameHost* to BrowserMediaSessionManager. |
| 97 using MediaSessionManagerMap = | 103 using MediaSessionManagerMap = |
| 98 base::ScopedPtrHashMap<RenderFrameHost*, | 104 base::ScopedPtrHashMap<RenderFrameHost*, |
| 99 scoped_ptr<BrowserMediaSessionManager>>; | 105 scoped_ptr<BrowserMediaSessionManager>>; |
| 100 MediaSessionManagerMap media_session_managers_; | 106 MediaSessionManagerMap media_session_managers_; |
| 101 | 107 |
| 102 // Map of renderer process media players to session controllers. | 108 // Map of renderer process media players to session controllers. |
| 103 using MediaSessionMap = | 109 using MediaSessionMap = |
| 104 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>; | 110 std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>; |
| 105 MediaSessionMap media_session_map_; | 111 MediaSessionMap media_session_map_; |
|
mlamouri (slow - plz ping)
2016/02/03 15:20:52
I was confused by your change because `media_sessi
| |
| 106 | 112 |
| 113 // List of focus callbacks awaiting fulfillment; each entry is a render frame | |
| 114 // id and callback. There may be multiple entries per render frame id. | |
| 115 using FocusWaiter = std::pair<int, base::Closure>; | |
|
mlamouri (slow - plz ping)
2016/02/03 15:20:52
nit: `using FocusCallback`? or `FocusCallbackWrapp
| |
| 116 std::list<FocusWaiter> focus_waiters_; | |
|
mlamouri (slow - plz ping)
2016/02/03 15:20:52
nit: focus_callbacks_
| |
| 117 | |
| 107 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid); | 118 DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid); |
| 108 }; | 119 }; |
| 109 | 120 |
| 110 } // namespace content | 121 } // namespace content |
| 111 | 122 |
| 112 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 123 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_WEB_CONTENTS_OBSERVER_ANDROID_H_ |
| OLD | NEW |