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

Unified Diff: content/browser/media/android/media_web_contents_observer_android.h

Issue 1580493004: Plumb audio focus support for spitzer clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate_hookup
Patch Set: Rebase. Created 4 years, 11 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
Index: content/browser/media/android/media_web_contents_observer_android.h
diff --git a/content/browser/media/android/media_web_contents_observer_android.h b/content/browser/media/android/media_web_contents_observer_android.h
index e60246817f7730774bf6bea536a45fbe406d2376..ba1db3c6bf6a119eb0fd1e4e479e38b5ad230896 100644
--- a/content/browser/media/android/media_web_contents_observer_android.h
+++ b/content/browser/media/android/media_web_contents_observer_android.h
@@ -7,6 +7,8 @@
#include <stdint.h>
+#include <list>
+
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -58,6 +60,10 @@ class CONTENT_EXPORT MediaWebContentsObserverAndroid
bool OnMessageReceived(const IPC::Message& message,
RenderFrameHost* render_frame_host) override;
+ protected:
+ 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
+ const base::Closure& focus_cb) override;
mlamouri (slow - plz ping) 2016/02/03 15:20:52 nit: `callback`
+
private:
// Handles messages from the WebMediaPlayerDelegate; does not modify the
// handled state since the superclass needs to handle these as well.
@@ -104,6 +110,11 @@ class CONTENT_EXPORT MediaWebContentsObserverAndroid
std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>;
MediaSessionMap media_session_map_;
mlamouri (slow - plz ping) 2016/02/03 15:20:52 I was confused by your change because `media_sessi
+ // List of focus callbacks awaiting fulfillment; each entry is a render frame
+ // id and callback. There may be multiple entries per render frame id.
+ using FocusWaiter = std::pair<int, base::Closure>;
mlamouri (slow - plz ping) 2016/02/03 15:20:52 nit: `using FocusCallback`? or `FocusCallbackWrapp
+ std::list<FocusWaiter> focus_waiters_;
mlamouri (slow - plz ping) 2016/02/03 15:20:52 nit: focus_callbacks_
+
DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698