Diff
Modified: trunk/Source/WebCore/ChangeLog (203339 => 203340)
--- trunk/Source/WebCore/ChangeLog 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/ChangeLog 2016-07-18 06:13:28 UTC (rev 203340)
@@ -1,3 +1,51 @@
+2016-07-17 Gyuyoung Kim <gyuyoung....@webkit.org>
+
+ Clean up PassRefPtr uses in Modules/encryptedmedia, Modules/speech, and Modules/quota
+ https://bugs.webkit.org/show_bug.cgi?id=159701
+
+ Reviewed by Alex Christensen.
+
+ No new tests, no behavior changes.
+
+ * Modules/encryptedmedia/CDM.h:
+ * Modules/encryptedmedia/MediaKeySession.h:
+ * Modules/encryptedmedia/MediaKeys.h:
+ * Modules/quota/DOMWindowQuota.cpp:
+ * Modules/quota/StorageErrorCallback.cpp:
+ (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
+ * Modules/quota/StorageErrorCallback.h:
+ * Modules/quota/StorageInfo.h:
+ * Modules/quota/StorageQuota.h:
+ * Modules/speech/DOMWindowSpeechSynthesis.cpp:
+ * Modules/speech/SpeechSynthesis.cpp:
+ (WebCore::SpeechSynthesis::getVoices):
+ (WebCore::SpeechSynthesis::startSpeakingImmediately):
+ (WebCore::SpeechSynthesis::speak):
+ (WebCore::SpeechSynthesis::cancel):
+ (WebCore::SpeechSynthesis::handleSpeakingCompleted):
+ (WebCore::SpeechSynthesis::boundaryEventOccurred):
+ (WebCore::SpeechSynthesis::didStartSpeaking):
+ (WebCore::SpeechSynthesis::didPauseSpeaking):
+ (WebCore::SpeechSynthesis::didResumeSpeaking):
+ (WebCore::SpeechSynthesis::didFinishSpeaking):
+ (WebCore::SpeechSynthesis::speakingErrorOccurred):
+ * Modules/speech/SpeechSynthesis.h:
+ * Modules/speech/SpeechSynthesisEvent.h:
+ * Modules/speech/SpeechSynthesisUtterance.h:
+ * Modules/speech/SpeechSynthesisVoice.cpp:
+ (WebCore::SpeechSynthesisVoice::create):
+ (WebCore::SpeechSynthesisVoice::SpeechSynthesisVoice):
+ * Modules/speech/SpeechSynthesisVoice.h:
+ * platform/PlatformSpeechSynthesizer.h:
+ * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
+ (WebCore::PlatformSpeechSynthesisProviderEfl::fireSpeechEvent):
+ * platform/mock/PlatformSpeechSynthesizerMock.cpp:
+ (WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
+ (WebCore::PlatformSpeechSynthesizerMock::speak):
+ (WebCore::PlatformSpeechSynthesizerMock::cancel):
+ (WebCore::PlatformSpeechSynthesizerMock::pause):
+ (WebCore::PlatformSpeechSynthesizerMock::resume):
+
2016-07-16 Sam Weinig <s...@webkit.org>
[WebKit API] Add SPI to track multiple navigations caused by a single user gesture
Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -31,7 +31,6 @@
#include "CDMSession.h"
#include <runtime/Uint8Array.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -36,7 +36,6 @@
#include "Timer.h"
#include <runtime/Uint8Array.h>
#include <wtf/Deque.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -71,7 +70,7 @@
using RefCounted<MediaKeySession>::ref;
using RefCounted<MediaKeySession>::deref;
- void enqueueEvent(PassRefPtr<Event>);
+ void enqueueEvent(RefPtr<Event>&&);
EventTargetInterface eventTargetInterface() const override { return MediaKeySessionEventTargetInterfaceType; }
ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -32,7 +32,6 @@
#include "EventTarget.h"
#include "ExceptionCode.h"
#include <runtime/Uint8Array.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebCore/Modules/quota/DOMWindowQuota.cpp (203339 => 203340)
--- trunk/Source/WebCore/Modules/quota/DOMWindowQuota.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/quota/DOMWindowQuota.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -37,7 +37,6 @@
#include "Document.h"
#include "Frame.h"
#include "StorageInfo.h"
-#include <wtf/PassRefPtr.h>
namespace WebCore {
Modified: trunk/Source/WebCore/Modules/quota/StorageErrorCallback.cpp (203339 => 203340)
--- trunk/Source/WebCore/Modules/quota/StorageErrorCallback.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/quota/StorageErrorCallback.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -39,7 +39,7 @@
namespace WebCore {
-StorageErrorCallback::CallbackTask::CallbackTask(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
+StorageErrorCallback::CallbackTask::CallbackTask(RefPtr<StorageErrorCallback>&& callback, ExceptionCode ec)
: ScriptExecutionContext::Task([callback, ec] (ScriptExecutionContext*) {
if (callback)
callback->handleEvent(DOMCoreException::create(ExceptionCodeDescription(ec)).get());
Modified: trunk/Source/WebCore/Modules/quota/StorageErrorCallback.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/quota/StorageErrorCallback.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/quota/StorageErrorCallback.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -49,7 +49,7 @@
class CallbackTask : public ScriptExecutionContext::Task {
public:
- CallbackTask(PassRefPtr<StorageErrorCallback>, ExceptionCode);
+ CallbackTask(StorageErrorCallback*, ExceptionCode);
private:
RefPtr<StorageErrorCallback> m_callback;
Modified: trunk/Source/WebCore/Modules/quota/StorageInfo.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/quota/StorageInfo.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/quota/StorageInfo.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -33,7 +33,6 @@
#if ENABLE(QUOTA)
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
Modified: trunk/Source/WebCore/Modules/quota/StorageQuota.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/quota/StorageQuota.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/quota/StorageQuota.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -33,7 +33,6 @@
#if ENABLE(QUOTA)
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
Modified: trunk/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -34,10 +34,9 @@
#if ENABLE(SPEECH_SYNTHESIS)
#include "DOMWindow.h"
-#include <wtf/PassRefPtr.h>
namespace WebCore {
-
+
DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis(DOMWindow* window)
: DOMWindowProperty(window->frame())
{
@@ -76,7 +75,7 @@
m_speechSynthesis = SpeechSynthesis::create();
return m_speechSynthesis.get();
}
-
+
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -38,12 +38,12 @@
#include <wtf/NeverDestroyed.h>
namespace WebCore {
-
+
Ref<SpeechSynthesis> SpeechSynthesis::create()
{
return adoptRef(*new SpeechSynthesis);
}
-
+
SpeechSynthesis::SpeechSynthesis()
: m_currentSpeechUtterance(nullptr)
, m_isPaused(false)
@@ -52,7 +52,7 @@
#endif
{
}
-
+
void SpeechSynthesis::setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynthesizer> synthesizer)
{
m_platformSpeechSynthesizer = WTFMove(synthesizer);
@@ -61,13 +61,13 @@
m_utteranceQueue.clear();
m_isPaused = false;
}
-
+
void SpeechSynthesis::voicesDidChange()
{
m_voiceList.clear();
}
-
-const Vector<RefPtr<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices()
+
+const Vector<Ref<SpeechSynthesisVoice>>& SpeechSynthesis::getVoices()
{
if (m_voiceList.size())
return m_voiceList;
@@ -77,7 +77,7 @@
// If the voiceList is empty, that's the cue to get the voices from the platform again.
for (auto& voice : m_platformSpeechSynthesizer->voiceList())
- m_voiceList.append(SpeechSynthesisVoice::create(voice));
+ m_voiceList.append(SpeechSynthesisVoice::create(*voice));
return m_voiceList;
}
@@ -107,13 +107,13 @@
utterance.setStartTime(monotonicallyIncreasingTime());
m_currentSpeechUtterance = &utterance;
m_isPaused = false;
-
+
// Zero lengthed strings should immediately notify that the event is complete.
if (utterance.text().isEmpty()) {
handleSpeakingCompleted(utterance, false);
return;
}
-
+
if (!m_platformSpeechSynthesizer)
m_platformSpeechSynthesizer = std::make_unique<PlatformSpeechSynthesizer>(this);
m_platformSpeechSynthesizer->speak(utterance.platformUtterance());
@@ -128,9 +128,9 @@
else if (userGestureRequiredForSpeechStart())
return;
#endif
-
+
m_utteranceQueue.append(utterance);
-
+
// If the queue was empty, speak this immediately and add it to the queue.
if (m_utteranceQueue.size() == 1)
startSpeakingImmediately(m_utteranceQueue.first());
@@ -145,7 +145,7 @@
if (m_platformSpeechSynthesizer)
m_platformSpeechSynthesizer->cancel();
current = nullptr;
-
+
// The platform should have called back immediately and cleared the current utterance.
ASSERT(!m_currentSpeechUtterance);
}
@@ -166,12 +166,12 @@
{
utterance.dispatchEvent(SpeechSynthesisEvent::create(type, charIndex, (monotonicallyIncreasingTime() - utterance.startTime()), name));
}
-
+
void SpeechSynthesis::handleSpeakingCompleted(SpeechSynthesisUtterance& utterance, bool errorOccurred)
{
ASSERT(m_currentSpeechUtterance);
Ref<SpeechSynthesisUtterance> protect(utterance);
-
+
m_currentSpeechUtterance = nullptr;
fireEvent(errorOccurred ? eventNames().errorEvent : eventNames().endEvent, utterance, 0, String());
@@ -185,21 +185,20 @@
startSpeakingImmediately(m_utteranceQueue.first());
}
}
-
-void SpeechSynthesis::boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance, SpeechBoundary boundary, unsigned charIndex)
+
+void SpeechSynthesis::boundaryEventOccurred(PlatformSpeechSynthesisUtterance& utterance, SpeechBoundary boundary, unsigned charIndex)
{
static NeverDestroyed<const String> wordBoundaryString(ASCIILiteral("word"));
static NeverDestroyed<const String> sentenceBoundaryString(ASCIILiteral("sentence"));
- ASSERT(utterance);
- ASSERT(utterance->client());
+ ASSERT(utterance.client());
switch (boundary) {
case SpeechWordBoundary:
- fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance->client()), charIndex, wordBoundaryString);
+ fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, wordBoundaryString);
break;
case SpeechSentenceBoundary:
- fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance->client()), charIndex, sentenceBoundaryString);
+ fireEvent(eventNames().boundaryEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), charIndex, sentenceBoundaryString);
break;
default:
ASSERT_NOT_REACHED();
@@ -206,36 +205,36 @@
}
}
-void SpeechSynthesis::didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+void SpeechSynthesis::didStartSpeaking(PlatformSpeechSynthesisUtterance& utterance)
{
- if (utterance->client())
- fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance->client()), 0, String());
+ if (utterance.client())
+ fireEvent(eventNames().startEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());
}
-
-void SpeechSynthesis::didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+
+void SpeechSynthesis::didPauseSpeaking(PlatformSpeechSynthesisUtterance& utterance)
{
m_isPaused = true;
- if (utterance->client())
- fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance->client()), 0, String());
+ if (utterance.client())
+ fireEvent(eventNames().pauseEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());
}
-void SpeechSynthesis::didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+void SpeechSynthesis::didResumeSpeaking(PlatformSpeechSynthesisUtterance& utterance)
{
m_isPaused = false;
- if (utterance->client())
- fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance->client()), 0, String());
+ if (utterance.client())
+ fireEvent(eventNames().resumeEvent, static_cast<SpeechSynthesisUtterance&>(*utterance.client()), 0, String());
}
-void SpeechSynthesis::didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+void SpeechSynthesis::didFinishSpeaking(PlatformSpeechSynthesisUtterance& utterance)
{
- if (utterance->client())
- handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance&>(*utterance->client()), false);
+ if (utterance.client())
+ handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance&>(*utterance.client()), false);
}
-
-void SpeechSynthesis::speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+
+void SpeechSynthesis::speakingErrorOccurred(PlatformSpeechSynthesisUtterance& utterance)
{
- if (utterance->client())
- handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance&>(*utterance->client()), true);
+ if (utterance.client())
+ handleSpeakingCompleted(static_cast<SpeechSynthesisUtterance&>(*utterance.client()), true);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -34,49 +34,48 @@
#include "SpeechSynthesisUtterance.h"
#include "SpeechSynthesisVoice.h"
#include <wtf/Deque.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace WebCore {
-
+
class PlatformSpeechSynthesizerClient;
class SpeechSynthesisVoice;
-
+
class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public RefCounted<SpeechSynthesis> {
public:
static Ref<SpeechSynthesis> create();
-
+
bool pending() const;
bool speaking() const;
bool paused() const;
-
+
void speak(SpeechSynthesisUtterance&);
void cancel();
void pause();
void resume();
-
- const Vector<RefPtr<SpeechSynthesisVoice>>& getVoices();
-
+
+ const Vector<Ref<SpeechSynthesisVoice>>& getVoices();
+
// Used in testing to use a mock platform synthesizer
WEBCORE_EXPORT void setPlatformSynthesizer(std::unique_ptr<PlatformSpeechSynthesizer>);
-
+
private:
SpeechSynthesis();
-
+
// PlatformSpeechSynthesizerClient override methods.
void voicesDidChange() override;
- void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) override;
- void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) override;
- void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) override;
- void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) override;
- void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>) override;
- void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>, SpeechBoundary, unsigned charIndex) override;
+ void didStartSpeaking(PlatformSpeechSynthesisUtterance&) override;
+ void didPauseSpeaking(PlatformSpeechSynthesisUtterance&) override;
+ void didResumeSpeaking(PlatformSpeechSynthesisUtterance&) override;
+ void didFinishSpeaking(PlatformSpeechSynthesisUtterance&) override;
+ void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) override;
+ void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex) override;
void startSpeakingImmediately(SpeechSynthesisUtterance&);
void handleSpeakingCompleted(SpeechSynthesisUtterance&, bool errorOccurred);
void fireEvent(const AtomicString& type, SpeechSynthesisUtterance&, unsigned long charIndex, const String& name);
-
+
#if PLATFORM(IOS)
// Restrictions to change default behaviors.
enum BehaviorRestrictionFlags {
@@ -84,12 +83,12 @@
RequireUserGestureForSpeechStartRestriction = 1 << 0,
};
typedef unsigned BehaviorRestrictions;
-
+
bool userGestureRequiredForSpeechStart() const { return m_restrictions & RequireUserGestureForSpeechStartRestriction; }
void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &= ~restriction; }
#endif
std::unique_ptr<PlatformSpeechSynthesizer> m_platformSpeechSynthesizer;
- Vector<RefPtr<SpeechSynthesisVoice>> m_voiceList;
+ Vector<Ref<SpeechSynthesisVoice>> m_voiceList;
SpeechSynthesisUtterance* m_currentSpeechUtterance;
Deque<Ref<SpeechSynthesisUtterance>> m_utteranceQueue;
bool m_isPaused;
@@ -97,7 +96,7 @@
BehaviorRestrictions m_restrictions;
#endif
};
-
+
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesisEvent.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -29,20 +29,19 @@
#if ENABLE(SPEECH_SYNTHESIS)
#include "Event.h"
-#include <wtf/PassRefPtr.h>
namespace WebCore {
-
+
class SpeechSynthesisEvent : public Event {
public:
static Ref<SpeechSynthesisEvent> create(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name);
-
+
unsigned long charIndex() const { return m_charIndex; }
float elapsedTime() const { return m_elapsedTime; }
const String& name() const { return m_name; }
-
+
virtual EventInterface eventInterface() const { return SpeechSynthesisEventInterfaceType; }
-
+
private:
SpeechSynthesisEvent(const AtomicString& type, unsigned charIndex, float elapsedTime, const String& name);
@@ -50,7 +49,7 @@
float m_elapsedTime;
String m_name;
};
-
+
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -32,7 +32,6 @@
#include "EventTarget.h"
#include "PlatformSpeechSynthesisUtterance.h"
#include "SpeechSynthesisVoice.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -40,7 +39,7 @@
class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public ContextDestructionObserver, public EventTargetWithInlineData {
public:
static Ref<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&);
-
+
~SpeechSynthesisUtterance();
const String& text() const { return m_platformUtterance->text(); }
@@ -63,7 +62,7 @@
double startTime() const { return m_platformUtterance->startTime(); }
void setStartTime(double startTime) { m_platformUtterance->setStartTime(startTime); }
-
+
using RefCounted<SpeechSynthesisUtterance>::ref;
using RefCounted<SpeechSynthesisUtterance>::deref;
@@ -80,7 +79,7 @@
void refEventTarget() override { ref(); }
void derefEventTarget() override { deref(); }
};
-
+
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.cpp (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -29,17 +29,17 @@
#if ENABLE(SPEECH_SYNTHESIS)
namespace WebCore {
-
-Ref<SpeechSynthesisVoice> SpeechSynthesisVoice::create(PassRefPtr<PlatformSpeechSynthesisVoice> voice)
+
+Ref<SpeechSynthesisVoice> SpeechSynthesisVoice::create(PlatformSpeechSynthesisVoice& voice)
{
return adoptRef(*new SpeechSynthesisVoice(voice));
}
-SpeechSynthesisVoice::SpeechSynthesisVoice(PassRefPtr<PlatformSpeechSynthesisVoice> voice)
+SpeechSynthesisVoice::SpeechSynthesisVoice(PlatformSpeechSynthesisVoice& voice)
: m_platformVoice(voice)
{
}
-
+
} // namespace WebCore
#endif // ENABLE(SPEECH_SYNTHESIS)
Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.h (203339 => 203340)
--- trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesisVoice.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -29,7 +29,6 @@
#if ENABLE(SPEECH_SYNTHESIS)
#include "PlatformSpeechSynthesisVoice.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -38,20 +37,20 @@
class SpeechSynthesisVoice : public RefCounted<SpeechSynthesisVoice> {
public:
virtual ~SpeechSynthesisVoice() { }
- static Ref<SpeechSynthesisVoice> create(PassRefPtr<PlatformSpeechSynthesisVoice>);
-
+ static Ref<SpeechSynthesisVoice> create(PlatformSpeechSynthesisVoice&);
+
const String& voiceURI() const { return m_platformVoice->voiceURI(); }
const String& name() const { return m_platformVoice->name(); }
const String& lang() const { return m_platformVoice->lang(); }
bool localService() const { return m_platformVoice->localService(); }
bool isDefault() const { return m_platformVoice->isDefault(); }
-
- PlatformSpeechSynthesisVoice* platformVoice() const { return m_platformVoice.get(); }
+ PlatformSpeechSynthesisVoice* platformVoice() { return m_platformVoice.ptr(); }
+
private:
- explicit SpeechSynthesisVoice(PassRefPtr<PlatformSpeechSynthesisVoice>);
-
- RefPtr<PlatformSpeechSynthesisVoice> m_platformVoice;
+ explicit SpeechSynthesisVoice(PlatformSpeechSynthesisVoice&);
+
+ Ref<PlatformSpeechSynthesisVoice> m_platformVoice;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/PlatformSpeechSynthesizer.h (203339 => 203340)
--- trunk/Source/WebCore/platform/PlatformSpeechSynthesizer.h 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/platform/PlatformSpeechSynthesizer.h 2016-07-18 06:13:28 UTC (rev 203340)
@@ -53,12 +53,12 @@
class PlatformSpeechSynthesizerClient {
public:
- virtual void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
- virtual void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
- virtual void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
- virtual void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
- virtual void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
- virtual void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>, SpeechBoundary, unsigned charIndex) = 0;
+ virtual void didStartSpeaking(PlatformSpeechSynthesisUtterance&) = 0;
+ virtual void didFinishSpeaking(PlatformSpeechSynthesisUtterance&) = 0;
+ virtual void didPauseSpeaking(PlatformSpeechSynthesisUtterance&) = 0;
+ virtual void didResumeSpeaking(PlatformSpeechSynthesisUtterance&) = 0;
+ virtual void speakingErrorOccurred(PlatformSpeechSynthesisUtterance&) = 0;
+ virtual void boundaryEventOccurred(PlatformSpeechSynthesisUtterance&, SpeechBoundary, unsigned charIndex) = 0;
virtual void voicesDidChange() = 0;
protected:
virtual ~PlatformSpeechSynthesizerClient() { }
Modified: trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp (203339 => 203340)
--- trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -177,20 +177,22 @@
void PlatformSpeechSynthesisProviderEfl::fireSpeechEvent(SpeechEvent speechEvent)
{
+ ASSERT(m_utterance);
+
switch (speechEvent) {
case SpeechStart:
- m_platformSpeechSynthesizer->client()->didStartSpeaking(m_utterance);
+ m_platformSpeechSynthesizer->client()->didStartSpeaking(*m_utterance);
break;
case SpeechPause:
- m_platformSpeechSynthesizer->client()->didPauseSpeaking(m_utterance);
+ m_platformSpeechSynthesizer->client()->didPauseSpeaking(*m_utterance);
break;
case SpeechResume:
- m_platformSpeechSynthesizer->client()->didResumeSpeaking(m_utterance);
+ m_platformSpeechSynthesizer->client()->didResumeSpeaking(*m_utterance);
break;
case SpeechError:
m_isEngineStarted = false;
case SpeechCancel:
- m_platformSpeechSynthesizer->client()->speakingErrorOccurred(m_utterance);
+ m_platformSpeechSynthesizer->client()->speakingErrorOccurred(*m_utterance);
break;
default:
ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (203339 => 203340)
--- trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm 2016-07-18 06:13:28 UTC (rev 203340)
@@ -167,7 +167,7 @@
if (!m_utterance)
return;
- m_synthesizerObject->client()->didStartSpeaking(m_utterance);
+ m_synthesizerObject->client()->didStartSpeaking(*m_utterance);
}
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance
@@ -181,7 +181,7 @@
RefPtr<WebCore::PlatformSpeechSynthesisUtterance> platformUtterance = m_utterance;
m_utterance = nullptr;
- m_synthesizerObject->client()->didFinishSpeaking(platformUtterance);
+ m_synthesizerObject->client()->didFinishSpeaking(*platformUtterance);
}
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didPauseSpeechUtterance:(AVSpeechUtterance *)utterance
@@ -191,7 +191,7 @@
if (!m_utterance)
return;
- m_synthesizerObject->client()->didPauseSpeaking(m_utterance);
+ m_synthesizerObject->client()->didPauseSpeaking(*m_utterance);
}
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didContinueSpeechUtterance:(AVSpeechUtterance *)utterance
@@ -201,7 +201,7 @@
if (!m_utterance)
return;
- m_synthesizerObject->client()->didResumeSpeaking(m_utterance);
+ m_synthesizerObject->client()->didResumeSpeaking(*m_utterance);
}
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didCancelSpeechUtterance:(AVSpeechUtterance *)utterance
@@ -215,7 +215,7 @@
RefPtr<WebCore::PlatformSpeechSynthesisUtterance> platformUtterance = m_utterance;
m_utterance = nullptr;
- m_synthesizerObject->client()->didFinishSpeaking(platformUtterance);
+ m_synthesizerObject->client()->didFinishSpeaking(*platformUtterance);
}
- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpeechString:(NSRange)characterRange utterance:(AVSpeechUtterance *)utterance
@@ -227,7 +227,7 @@
return;
// iOS only supports word boundaries.
- m_synthesizerObject->client()->boundaryEventOccurred(m_utterance, WebCore::SpeechWordBoundary, characterRange.location);
+ m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechWordBoundary, characterRange.location);
}
@end
Modified: trunk/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm (203339 => 203340)
--- trunk/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm 2016-07-18 06:13:28 UTC (rev 203340)
@@ -133,7 +133,7 @@
m_utterance = utterance;
[m_synthesizer startSpeakingString:utterance->text()];
- m_synthesizerObject->client()->didStartSpeaking(utterance);
+ m_synthesizerObject->client()->didStartSpeaking(*m_utterance);
}
- (void)pause
@@ -142,7 +142,7 @@
return;
[m_synthesizer pauseSpeakingAtBoundary:NSSpeechImmediateBoundary];
- m_synthesizerObject->client()->didPauseSpeaking(m_utterance);
+ m_synthesizerObject->client()->didPauseSpeaking(*m_utterance);
}
- (void)resume
@@ -151,7 +151,7 @@
return;
[m_synthesizer continueSpeaking];
- m_synthesizerObject->client()->didResumeSpeaking(m_utterance);
+ m_synthesizerObject->client()->didResumeSpeaking(*m_utterance);
}
- (void)cancel
@@ -160,7 +160,7 @@
return;
[m_synthesizer stopSpeakingAtBoundary:NSSpeechImmediateBoundary];
- m_synthesizerObject->client()->speakingErrorOccurred(m_utterance);
+ m_synthesizerObject->client()->speakingErrorOccurred(*m_utterance);
m_utterance = 0;
}
@@ -183,9 +183,9 @@
m_utterance = 0;
if (finishedSpeaking)
- m_synthesizerObject->client()->didFinishSpeaking(utterance);
+ m_synthesizerObject->client()->didFinishSpeaking(*utterance);
else
- m_synthesizerObject->client()->speakingErrorOccurred(utterance);
+ m_synthesizerObject->client()->speakingErrorOccurred(*utterance);
}
- (void)speechSynthesizer:(NSSpeechSynthesizer *)sender willSpeakWord:(NSRange)characterRange ofString:(NSString *)string
@@ -197,7 +197,7 @@
return;
// Mac platform only supports word boundaries.
- m_synthesizerObject->client()->boundaryEventOccurred(m_utterance, WebCore::SpeechWordBoundary, characterRange.location);
+ m_synthesizerObject->client()->boundaryEventOccurred(*m_utterance, WebCore::SpeechWordBoundary, characterRange.location);
}
@end
Modified: trunk/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp (203339 => 203340)
--- trunk/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp 2016-07-18 06:08:04 UTC (rev 203339)
+++ trunk/Source/WebCore/platform/mock/PlatformSpeechSynthesizerMock.cpp 2016-07-18 06:13:28 UTC (rev 203340)
@@ -47,7 +47,7 @@
RefPtr<PlatformSpeechSynthesisUtterance> protect(m_utterance);
m_utterance = nullptr;
- client()->didFinishSpeaking(protect);
+ client()->didFinishSpeaking(*protect);
}
void PlatformSpeechSynthesizerMock::initializeVoiceList()
@@ -61,11 +61,11 @@
{
ASSERT(!m_utterance);
m_utterance = WTFMove(utterance);
- client()->didStartSpeaking(m_utterance);
+ client()->didStartSpeaking(*m_utterance);
// Fire a fake word and then sentence boundary event.
- client()->boundaryEventOccurred(m_utterance, SpeechWordBoundary, 0);
- client()->boundaryEventOccurred(m_utterance, SpeechSentenceBoundary, m_utterance->text().length());
+ client()->boundaryEventOccurred(*m_utterance, SpeechWordBoundary, 0);
+ client()->boundaryEventOccurred(*m_utterance, SpeechSentenceBoundary, m_utterance->text().length());
// Give the fake speech job some time so that pause and other functions have time to be called.
m_speakingFinishedTimer.startOneShot(.1);
@@ -77,18 +77,18 @@
return;
m_speakingFinishedTimer.stop();
- client()->speakingErrorOccurred(m_utterance);
+ client()->speakingErrorOccurred(*m_utterance);
m_utterance = nullptr;
}
void PlatformSpeechSynthesizerMock::pause()
{
- client()->didPauseSpeaking(m_utterance);
+ client()->didPauseSpeaking(*m_utterance);
}
void PlatformSpeechSynthesizerMock::resume()
{
- client()->didResumeSpeaking(m_utterance);
+ client()->didResumeSpeaking(*m_utterance);
}
} // namespace WebCore