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

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

Issue 2646383002: Use a new Supplement constructor for (Worker)Navigator supplements (Closed)
Patch Set: temp Created 3 years, 10 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
OLDNEW
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 NavigatorMediaSession_h 5 #ifndef NavigatorMediaSession_h
6 #define NavigatorMediaSession_h 6 #define NavigatorMediaSession_h
7 7
8 #include "core/frame/Navigator.h" 8 #include "core/frame/Navigator.h"
9 #include "modules/mediasession/MediaSession.h" 9 #include "modules/mediasession/MediaSession.h"
10 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class Navigator; 14 class Navigator;
15 class ScriptState; 15 class ScriptState;
16 16
17 // Provides MediaSession as a supplement of Navigator as an attribute. 17 // Provides MediaSession as a supplement of Navigator as an attribute.
18 class NavigatorMediaSession final 18 class NavigatorMediaSession final
19 : public GarbageCollected<NavigatorMediaSession>, 19 : public GarbageCollected<NavigatorMediaSession>,
20 public Supplement<Navigator> { 20 public Supplement<Navigator> {
21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorMediaSession); 21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorMediaSession);
22 22
23 public: 23 public:
24 static NavigatorMediaSession& from(Navigator&); 24 static NavigatorMediaSession& from(Navigator&);
25 static MediaSession* mediaSession(ScriptState*, Navigator&); 25 static MediaSession* mediaSession(ScriptState*, Navigator&);
26 26
27 DECLARE_TRACE(); 27 DECLARE_TRACE();
28 28
29 private: 29 private:
30 NavigatorMediaSession(Navigator&); 30 explicit NavigatorMediaSession(Navigator&);
31 static const char* supplementName(); 31 static const char* supplementName();
32 32
33 // The MediaSession instance of this Navigator. 33 // The MediaSession instance of this Navigator.
34 Member<MediaSession> m_session; 34 Member<MediaSession> m_session;
35 }; 35 };
36 36
37 } // namespace blink 37 } // namespace blink
38 38
39 #endif // NavigatorMediaSession_h 39 #endif // NavigatorMediaSession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698