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

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/HTMLMediaElementMediaSession.h

Issue 1420223002: Disallow assigning a MediaSession after the resource has been selected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pull expected file from the bots Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 HTMLMediaElementMediaSession_h 5 #ifndef HTMLMediaElementMediaSession_h
6 #define HTMLMediaElementMediaSession_h 6 #define HTMLMediaElementMediaSession_h
7 7
8 #include "core/html/HTMLMediaElement.h" 8 #include "core/html/HTMLMediaElement.h"
9 #include "modules/ModulesExport.h" 9 #include "modules/ModulesExport.h"
10 #include "modules/mediasession/MediaSession.h" 10 #include "modules/mediasession/MediaSession.h"
11 #include "platform/Supplementable.h" 11 #include "platform/Supplementable.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 // A supplement to HTMLMediaElement responsible for the integration of 16 // A supplement to HTMLMediaElement responsible for the integration of
17 // MediaSession with HTMLMediaElement. 17 // MediaSession with HTMLMediaElement.
18 class HTMLMediaElementMediaSession final : public NoBaseWillBeGarbageCollected<H TMLMediaElementMediaSession>, public WillBeHeapSupplement<HTMLMediaElement> { 18 class HTMLMediaElementMediaSession final : public NoBaseWillBeGarbageCollected<H TMLMediaElementMediaSession>, public WillBeHeapSupplement<HTMLMediaElement> {
19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementMediaSession); 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementMediaSession);
20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLMediaElementMediaSession); 20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLMediaElementMediaSession);
21 public: 21 public:
22 static MediaSession* session(HTMLMediaElement&); 22 static MediaSession* session(HTMLMediaElement&);
23 static void setSession(HTMLMediaElement&, MediaSession*); 23 static void setSession(HTMLMediaElement&, MediaSession*, ExceptionState&);
24 24
25 DECLARE_VIRTUAL_TRACE(); 25 DECLARE_VIRTUAL_TRACE();
26 26
27 private: 27 private:
28 static HTMLMediaElementMediaSession& from(HTMLMediaElement&); 28 static HTMLMediaElementMediaSession& from(HTMLMediaElement&);
29 static HTMLMediaElementMediaSession* fromIfExists(HTMLMediaElement&); 29 static HTMLMediaElementMediaSession* fromIfExists(HTMLMediaElement&);
30 static const char* supplementName(); 30 static const char* supplementName();
31 31
32 PersistentWillBeMember<MediaSession> m_session; 32 PersistentWillBeMember<MediaSession> m_session;
33 }; 33 };
34 34
35 } // namespace blink 35 } // namespace blink
36 36
37 #endif // HTMLMediaElementMediaSession_h 37 #endif // HTMLMediaElementMediaSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698