blob: edbb127ab23925a742fd9cc638526f7fde4b6b25 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "web/AudioOutputDeviceClientImpl.h"
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
#include "public/web/WebFrameClient.h"
#include "web/WebLocalFrameImpl.h"
#include <memory>
namespace blink {
AudioOutputDeviceClientImpl::AudioOutputDeviceClientImpl(LocalFrame& frame)
: AudioOutputDeviceClient(frame) {}
AudioOutputDeviceClientImpl::~AudioOutputDeviceClientImpl() {}
void AudioOutputDeviceClientImpl::checkIfAudioSinkExistsAndIsAuthorized(
ExecutionContext* context,
const WebString& sinkId,
std::unique_ptr<WebSetSinkIdCallbacks> callbacks) {
DCHECK(context);
DCHECK(context->isDocument());
Document* document = toDocument(context);
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
webFrame->client()->checkIfAudioSinkExistsAndIsAuthorized(
sinkId, WebSecurityOrigin(context->getSecurityOrigin()),
callbacks.release());
}
} // namespace blink