Commit 6a85ba5a authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

Merge WebRTCDTMFSenderHandlerClient into RtcDtmfSenderHandler

... and remove rtc_dtmf_sender_handler_client.h altogether.

What is more, the CL also removes the use of WebString
from WebRTCDTMFSenderHandler::Client (in favor of WTF::String).

BUG=787254, 919392
R=guidou@chromium.org, haraken@chromium.org

Change-Id: I2f5216c24c29a271594a2f4225f55f585c579f72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899795
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713069}
parent 08747ea8
...@@ -267,7 +267,6 @@ source_set("blink_headers") { ...@@ -267,7 +267,6 @@ source_set("blink_headers") {
"platform/web_resource_timing_info.h", "platform/web_resource_timing_info.h",
"platform/web_rtc_api_name.h", "platform/web_rtc_api_name.h",
"platform/web_rtc_data_channel_init.h", "platform/web_rtc_data_channel_init.h",
"platform/web_rtc_dtmf_sender_handler_client.h",
"platform/web_rtc_ice_candidate.h", "platform/web_rtc_ice_candidate.h",
"platform/web_rtc_legacy_stats.h", "platform/web_rtc_legacy_stats.h",
"platform/web_rtc_peer_connection_handler.h", "platform/web_rtc_peer_connection_handler.h",
......
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_DTMF_SENDER_HANDLER_CLIENT_H_
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_DTMF_SENDER_HANDLER_CLIENT_H_
#include "third_party/blink/public/platform/web_common.h"
namespace blink {
class WebString;
class WebRTCDTMFSenderHandlerClient {
public:
virtual ~WebRTCDTMFSenderHandlerClient() = default;
virtual void DidPlayTone(const WebString& tone) = 0;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_RTC_DTMF_SENDER_HANDLER_CLIENT_H_
...@@ -156,7 +156,7 @@ void RTCDTMFSender::PlayoutTask() { ...@@ -156,7 +156,7 @@ void RTCDTMFSender::PlayoutTask() {
DispatchEvent(*event.Release()); DispatchEvent(*event.Release());
} }
void RTCDTMFSender::DidPlayTone(const WebString& tone) { void RTCDTMFSender::DidPlayTone(const String& tone) {
// We're using the DidPlayTone with an empty buffer to signal the // We're using the DidPlayTone with an empty buffer to signal the
// end of the tone. // end of the tone.
if (tone.IsEmpty()) { if (tone.IsEmpty()) {
......
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_DTMF_SENDER_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_DTMF_SENDER_H_
#include <memory> #include <memory>
#include "third_party/blink/public/platform/web_rtc_dtmf_sender_handler_client.h"
#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h" #include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
#include "third_party/blink/renderer/modules/event_target_modules.h" #include "third_party/blink/renderer/modules/event_target_modules.h"
#include "third_party/blink/renderer/platform/peerconnection/rtc_dtmf_sender_handler.h"
#include "third_party/blink/renderer/platform/timer.h" #include "third_party/blink/renderer/platform/timer.h"
namespace blink { namespace blink {
...@@ -38,7 +38,7 @@ class ExceptionState; ...@@ -38,7 +38,7 @@ class ExceptionState;
class RtcDtmfSenderHandler; class RtcDtmfSenderHandler;
class RTCDTMFSender final : public EventTargetWithInlineData, class RTCDTMFSender final : public EventTargetWithInlineData,
public WebRTCDTMFSenderHandlerClient, public RtcDtmfSenderHandler::Client,
public ContextLifecycleObserver { public ContextLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(RTCDTMFSender); USING_GARBAGE_COLLECTED_MIXIN(RTCDTMFSender);
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
...@@ -75,9 +75,9 @@ class RTCDTMFSender final : public EventTargetWithInlineData, ...@@ -75,9 +75,9 @@ class RTCDTMFSender final : public EventTargetWithInlineData,
private: private:
void Dispose(); void Dispose();
// WebRTCDTMFSenderHandlerClient // RtcDtmfSenderHandler::Client
void PlayoutTask(); void PlayoutTask();
void DidPlayTone(const WebString&) override; void DidPlayTone(const String&) override;
std::unique_ptr<RtcDtmfSenderHandler> handler_; std::unique_ptr<RtcDtmfSenderHandler> handler_;
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
...@@ -63,8 +62,7 @@ RtcDtmfSenderHandler::~RtcDtmfSenderHandler() { ...@@ -63,8 +62,7 @@ RtcDtmfSenderHandler::~RtcDtmfSenderHandler() {
observer_ = nullptr; observer_ = nullptr;
} }
void RtcDtmfSenderHandler::SetClient( void RtcDtmfSenderHandler::SetClient(RtcDtmfSenderHandler::Client* client) {
blink::WebRTCDTMFSenderHandlerClient* client) {
webkit_client_ = client; webkit_client_ = client;
} }
...@@ -85,11 +83,9 @@ bool RtcDtmfSenderHandler::InsertDTMF(const String& tones, ...@@ -85,11 +83,9 @@ bool RtcDtmfSenderHandler::InsertDTMF(const String& tones,
void RtcDtmfSenderHandler::OnToneChange(const String& tone) { void RtcDtmfSenderHandler::OnToneChange(const String& tone) {
if (!webkit_client_) { if (!webkit_client_) {
LOG(ERROR) << "WebRTCDTMFSenderHandlerClient not set."; LOG(ERROR) << "RtcDtmfSenderHandler::Client not set.";
return; return;
} }
// TODO(crbug.com/787254): Remove the respective web_string.h header inclusion
// when WebRtcDtmfSenderHandlerClient moves out of the Blink API.
webkit_client_->DidPlayTone(tone); webkit_client_->DidPlayTone(tone);
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h" #include "base/sequence_checker.h"
#include "third_party/blink/public/platform/web_rtc_dtmf_sender_handler_client.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/webrtc/api/dtmf_sender_interface.h" #include "third_party/webrtc/api/dtmf_sender_interface.h"
...@@ -33,11 +32,17 @@ namespace blink { ...@@ -33,11 +32,17 @@ namespace blink {
// occur on the main render thread. // occur on the main render thread.
class PLATFORM_EXPORT RtcDtmfSenderHandler final { class PLATFORM_EXPORT RtcDtmfSenderHandler final {
public: public:
class PLATFORM_EXPORT Client {
public:
virtual ~Client() = default;
virtual void DidPlayTone(const String& tone) = 0;
};
RtcDtmfSenderHandler(scoped_refptr<base::SingleThreadTaskRunner> main_thread, RtcDtmfSenderHandler(scoped_refptr<base::SingleThreadTaskRunner> main_thread,
webrtc::DtmfSenderInterface* dtmf_sender); webrtc::DtmfSenderInterface* dtmf_sender);
~RtcDtmfSenderHandler(); ~RtcDtmfSenderHandler();
void SetClient(blink::WebRTCDTMFSenderHandlerClient* client); void SetClient(RtcDtmfSenderHandler::Client* client);
String CurrentToneBuffer(); String CurrentToneBuffer();
bool CanInsertDTMF(); bool CanInsertDTMF();
bool InsertDTMF(const String& tones, int duration, int inter_tone_gap); bool InsertDTMF(const String& tones, int duration, int inter_tone_gap);
...@@ -46,7 +51,7 @@ class PLATFORM_EXPORT RtcDtmfSenderHandler final { ...@@ -46,7 +51,7 @@ class PLATFORM_EXPORT RtcDtmfSenderHandler final {
private: private:
scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender_; scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender_;
blink::WebRTCDTMFSenderHandlerClient* webkit_client_; RtcDtmfSenderHandler::Client* webkit_client_;
class Observer; class Observer;
scoped_refptr<Observer> observer_; scoped_refptr<Observer> observer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment