OLD | NEW |
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 "web/AudioOutputDeviceClientImpl.h" | 5 #include "web/AudioOutputDeviceClientImpl.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 9 #include "core/frame/LocalFrame.h" |
9 #include "public/web/WebFrameClient.h" | 10 #include "public/web/WebFrameClient.h" |
10 #include "web/WebLocalFrameImpl.h" | 11 #include "web/WebLocalFrameImpl.h" |
11 #include <memory> | 12 #include <memory> |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 AudioOutputDeviceClientImpl* AudioOutputDeviceClientImpl::create() | 16 AudioOutputDeviceClientImpl* AudioOutputDeviceClientImpl::create(LocalFrame& fra
me) |
16 { | 17 { |
17 return new AudioOutputDeviceClientImpl(); | 18 return new AudioOutputDeviceClientImpl(frame); |
18 } | 19 } |
19 | 20 |
20 AudioOutputDeviceClientImpl::AudioOutputDeviceClientImpl() | 21 AudioOutputDeviceClientImpl::AudioOutputDeviceClientImpl(LocalFrame& frame) |
| 22 : AudioOutputDeviceClient(frame) |
21 { | 23 { |
22 } | 24 } |
23 | 25 |
24 AudioOutputDeviceClientImpl::~AudioOutputDeviceClientImpl() | 26 AudioOutputDeviceClientImpl::~AudioOutputDeviceClientImpl() |
25 { | 27 { |
26 } | 28 } |
27 | 29 |
28 void AudioOutputDeviceClientImpl::checkIfAudioSinkExistsAndIsAuthorized(Executio
nContext* context, const WebString& sinkId, std::unique_ptr<WebSetSinkIdCallback
s> callbacks) | 30 void AudioOutputDeviceClientImpl::checkIfAudioSinkExistsAndIsAuthorized(Executio
nContext* context, const WebString& sinkId, std::unique_ptr<WebSetSinkIdCallback
s> callbacks) |
29 { | 31 { |
30 DCHECK(context); | 32 DCHECK(context); |
31 DCHECK(context->isDocument()); | 33 DCHECK(context->isDocument()); |
32 Document* document = toDocument(context); | 34 Document* document = toDocument(context); |
33 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()
); | 35 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()
); |
34 webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(sinkId, WebSecurit
yOrigin(context->getSecurityOrigin()), callbacks.release()); | 36 webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(sinkId, WebSecurit
yOrigin(context->getSecurityOrigin()), callbacks.release()); |
35 } | 37 } |
36 | 38 |
37 } // namespace blink | 39 } // namespace blink |
OLD | NEW |