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

Side by Side Diff: content/browser/media/session/pepper_playback_observer.h

Issue 2060933002: Let Flash join and be controlled by media session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pepper_to_contents
Patch Set: addressed dcheng's comments Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/media/session/pepper_playback_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_PEPPER_PLAYBACK_OBSERVER_H_
6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_
7
8 #include <stdint.h>
9 #include <map>
10 #include <memory>
11
12 #include "base/macros.h"
13
14 namespace content {
15
16 class PepperPlayerDelegate;
17 class WebContentsImpl;
18
19 // Class observing Pepper playback changes from WebContents, and update
20 // MediaSession accordingly. Can only be a member of WebContentsImpl and must be
21 // destroyed in ~WebContentsImpl().
22 class PepperPlaybackObserver {
23 public:
24 explicit PepperPlaybackObserver(WebContentsImpl* contents);
25 virtual ~PepperPlaybackObserver();
26
27 void PepperInstanceCreated(int32_t pp_instance);
28 void PepperInstanceDeleted(int32_t pp_instance);
29 void PepperStartsPlayback(int32_t pp_instance);
30 void PepperStopsPlayback(int32_t pp_instance);
31
32 private:
33 // Owning PepperPlayerDelegates.
34 using PlayersMap =
35 std::map<int32_t, std::unique_ptr<PepperPlayerDelegate>>;
36 PlayersMap players_map_;
37
38 // Weak reference to WebContents.
39 WebContentsImpl* contents_;
40
41 DISALLOW_COPY_AND_ASSIGN(PepperPlaybackObserver);
42 };
43
44 } // namespace content
45
46 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/session/pepper_playback_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698