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

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

Issue 2815313002: Reland of Move ScriptState::GetExecutionContext (Part 5) (Closed)
Patch Set: Created 3 years, 8 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 #include "modules/mediasession/NavigatorMediaSession.h" 5 #include "modules/mediasession/NavigatorMediaSession.h"
6 6
7 #include "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/ExecutionContext.h"
8 #include "modules/mediasession/MediaSession.h" 9 #include "modules/mediasession/MediaSession.h"
9 #include "platform/Supplementable.h" 10 #include "platform/Supplementable.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 NavigatorMediaSession::NavigatorMediaSession(Navigator& navigator) 14 NavigatorMediaSession::NavigatorMediaSession(Navigator& navigator)
14 : Supplement<Navigator>(navigator) {} 15 : Supplement<Navigator>(navigator) {}
15 16
16 DEFINE_TRACE(NavigatorMediaSession) { 17 DEFINE_TRACE(NavigatorMediaSession) {
17 visitor->Trace(session_); 18 visitor->Trace(session_);
(...skipping 11 matching lines...) Expand all
29 supplement = new NavigatorMediaSession(navigator); 30 supplement = new NavigatorMediaSession(navigator);
30 ProvideTo(navigator, SupplementName(), supplement); 31 ProvideTo(navigator, SupplementName(), supplement);
31 } 32 }
32 return *supplement; 33 return *supplement;
33 } 34 }
34 35
35 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* script_state, 36 MediaSession* NavigatorMediaSession::mediaSession(ScriptState* script_state,
36 Navigator& navigator) { 37 Navigator& navigator) {
37 NavigatorMediaSession& self = NavigatorMediaSession::From(navigator); 38 NavigatorMediaSession& self = NavigatorMediaSession::From(navigator);
38 if (!self.session_) 39 if (!self.session_)
39 self.session_ = MediaSession::Create(script_state->GetExecutionContext()); 40 self.session_ = MediaSession::Create(ExecutionContext::From(script_state));
40 return self.session_.Get(); 41 return self.session_.Get();
41 } 42 }
42 43
43 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698