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

Side by Side Diff: Source/modules/mediasession/MediaSession.cpp

Issue 1259643002: NOT FOR LANDING Introduce and use WebMediaSession (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: hack until something works Created 5 years, 4 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 | Annotate | Revision Log
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 #include "config.h" 5 #include "config.h"
6 #include "modules/mediasession/MediaSession.h" 6 #include "modules/mediasession/MediaSession.h"
7 7
8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/frame/LocalDOMWindow.h"
10 #include "core/frame/LocalFrame.h"
11 #include "core/loader/FrameLoaderClient.h"
12
8 namespace blink { 13 namespace blink {
9 14
10 MediaSession* MediaSession::create() 15 MediaSession::MediaSession(PassOwnPtr<WebMediaSession> webMediaSession)
16 : m_webMediaSession(webMediaSession)
11 { 17 {
12 return new MediaSession; 18 ASSERT(m_webMediaSession);
19 }
20
21 MediaSession* MediaSession::create(ScriptState* scriptState)
22 {
23 LocalDOMWindow* domWindow = scriptState->domWindow();
24 LocalFrame* frame = domWindow->frame();
25 FrameLoaderClient* client = frame->loader().client();
26 return new MediaSession(client->createWebMediaSession());
27 }
28
29 MediaSession* MediaSession::createForTesting(PassOwnPtr<WebMediaSession> webMedi aSession)
30 {
31 return new MediaSession(webMediaSession);
13 } 32 }
14 33
15 void MediaSession::activate() 34 void MediaSession::activate()
16 { 35 {
36 m_webMediaSession->activate();
17 } 37 }
18 38
19 void MediaSession::deactivate() 39 void MediaSession::deactivate()
20 { 40 {
41 m_webMediaSession->deactivate();
21 } 42 }
22 43
23 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698