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

Unified Diff: content/public/browser/web_contents_observer.h

Issue 1478643002: Refactor media out of WebContentsImpl to MediaWebContentsObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove cruft. Created 5 years 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/public/browser/web_contents_observer.h
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index 92bf9773edcdeaeb28929fe6197d77393979fb8c..f11d476b43b527af0db4d2cbea32f4f7f56e37a9 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -424,11 +424,13 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener,
// Invoked when theme color is changed to |theme_color|.
virtual void DidChangeThemeColor(SkColor theme_color) {}
- // Invoked when media is playing.
- virtual void MediaStartedPlaying() {}
-
- // Invoked when media is paused.
- virtual void MediaPaused() {}
+ // Invoked when media is playing or paused. |id| is unique per player and per
+ // RenderFrameHost. There may be multiple players within a RenderFrameHost
+ // and subsequently within a WebContents. MediaStartedPlaying() will always
+ // be followed by MediaPaused() after player teardown.
+ using MediaPlayerId = std::pair<RenderFrameHost*, int64_t>;
+ virtual void MediaStartedPlaying(const MediaPlayerId& id) {}
ncarter (slow) 2015/12/02 17:49:31 If a frame is detached while media is playing, wha
DaleCurtis 2015/12/02 19:55:46 We could use uintptr_t if we want too; I don't thi
ncarter (slow) 2015/12/05 00:43:33 The uintptr_t vs. RFH* distinction wasn't what I w
DaleCurtis 2015/12/05 01:18:02 Sounds like a good idea. It doesn't technically me
+ virtual void MediaPaused(const MediaPlayerId& id) {}
// Invoked when media session has changed its state.
virtual void MediaSessionStateChanged(bool is_controllable,
« content/browser/web_contents/web_contents_impl.cc ('K') | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698