Title: [207214] trunk/Source
Revision
207214
Author
cdu...@apple.com
Date
2016-10-12 07:41:59 -0700 (Wed, 12 Oct 2016)

Log Message

Stop using PassRefPtr in platform/efl
https://bugs.webkit.org/show_bug.cgi?id=163321

Reviewed by Laszlo Gombos.

Stop using PassRefPtr in platform/efl.

* platform/efl/BatteryProviderEfl.cpp:
(WebCore::batteryProperties):
(WebCore::BatteryProviderEfl::setBatteryStatus):
(WebCore::BatteryProviderEfl::dispatchEvent):
* platform/efl/BatteryProviderEfl.h:
* platform/efl/BatteryProviderEflClient.h:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
(WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (207213 => 207214)


--- trunk/Source/WebCore/ChangeLog	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/ChangeLog	2016-10-12 14:41:59 UTC (rev 207214)
@@ -1,3 +1,23 @@
+2016-10-12  Chris Dumez  <cdu...@apple.com>
+
+        Stop using PassRefPtr in platform/efl
+        https://bugs.webkit.org/show_bug.cgi?id=163321
+
+        Reviewed by Laszlo Gombos.
+
+        Stop using PassRefPtr in platform/efl.
+
+        * platform/efl/BatteryProviderEfl.cpp:
+        (WebCore::batteryProperties):
+        (WebCore::BatteryProviderEfl::setBatteryStatus):
+        (WebCore::BatteryProviderEfl::dispatchEvent):
+        * platform/efl/BatteryProviderEfl.h:
+        * platform/efl/BatteryProviderEflClient.h:
+        * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
+        (WebCore::PlatformSpeechSynthesisProviderEfl::voiceName):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
+        * platform/efl/PlatformSpeechSynthesisProviderEfl.h:
+
 2016-10-12  Youenn Fablet  <you...@apple.com>
 
         Attribute setter binding generated code should use more references

Modified: trunk/Source/WebCore/platform/efl/BatteryProviderEfl.cpp (207213 => 207214)


--- trunk/Source/WebCore/platform/efl/BatteryProviderEfl.cpp	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/platform/efl/BatteryProviderEfl.cpp	2016-10-12 14:41:59 UTC (rev 207214)
@@ -124,15 +124,16 @@
         }
     }
 
-    RefPtr<BatteryStatus> batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100);
+    auto batteryStatus = BatteryStatus::create(charging, chargingTime, dischargingTime, level / 100);
+    client->setBatteryStatus(WTFMove(batteryStatus));
     if (chargingChanged)
-        client->setBatteryStatus(eventNames().chargingchangeEvent, batteryStatus);
+        client->dispatchEvent(eventNames().chargingchangeEvent);
     if (chargingTimeChanged)
-        client->setBatteryStatus(eventNames().chargingtimechangeEvent, batteryStatus);
+        client->dispatchEvent(eventNames().chargingtimechangeEvent);
     if (dischargingTimeChanged)
-        client->setBatteryStatus(eventNames().dischargingtimechangeEvent, batteryStatus);
+        client->dispatchEvent(eventNames().dischargingtimechangeEvent);
     if (levelChanged)
-        client->setBatteryStatus(eventNames().levelchangeEvent, batteryStatus);
+        client->dispatchEvent(eventNames().levelchangeEvent);
 }
 
 static void batteryPropertiesChanged(void* data, const Eldbus_Message*)
@@ -219,13 +220,17 @@
     eldbus_proxy_call(m_proxy, "EnumerateDevices", enumerateDevices, this, -1, "");
 }
 
-void BatteryProviderEfl::setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus> batteryStatus)
+void BatteryProviderEfl::setBatteryStatus(Ref<BatteryStatus>&& batteryStatus)
 {
-    m_batteryStatus = batteryStatus;
-    m_client->didChangeBatteryStatus(eventType, m_batteryStatus);
+    m_batteryStatus = WTFMove(batteryStatus);
 }
 
+void BatteryProviderEfl::dispatchEvent(const AtomicString& type)
+{
+    m_client->didChangeBatteryStatus(type, m_batteryStatus.copyRef());
 }
 
+}
+
 #endif // BATTERY_STATUS
 

Modified: trunk/Source/WebCore/platform/efl/BatteryProviderEfl.h (207213 => 207214)


--- trunk/Source/WebCore/platform/efl/BatteryProviderEfl.h	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/platform/efl/BatteryProviderEfl.h	2016-10-12 14:41:59 UTC (rev 207214)
@@ -39,9 +39,11 @@
     virtual void startUpdating();
     virtual void stopUpdating();
 
-    void setBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus>);
+    void setBatteryStatus(Ref<BatteryStatus>&&);
     BatteryStatus* batteryStatus() const;
 
+    void dispatchEvent(const AtomicString& type);
+
 private:
     static void enumerateDevices(void* data, const Eldbus_Message*, Eldbus_Pending*);
     static void deviceTypeCallback(void* data, const Eldbus_Message*, Eldbus_Pending*);

Modified: trunk/Source/WebCore/platform/efl/BatteryProviderEflClient.h (207213 => 207214)


--- trunk/Source/WebCore/platform/efl/BatteryProviderEflClient.h	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/platform/efl/BatteryProviderEflClient.h	2016-10-12 14:41:59 UTC (rev 207214)
@@ -30,7 +30,7 @@
 
 class BatteryProviderEflClient {
 public:
-    virtual void didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus>) = 0;
+    virtual void didChangeBatteryStatus(const AtomicString& eventType, RefPtr<BatteryStatus>&&) = 0;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp (207213 => 207214)


--- trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp	2016-10-12 14:41:59 UTC (rev 207214)
@@ -64,13 +64,13 @@
     return pitch * 50;
 }
 
-String PlatformSpeechSynthesisProviderEfl::voiceName(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance) const
+String PlatformSpeechSynthesisProviderEfl::voiceName(PlatformSpeechSynthesisUtterance& utterance) const
 {
     if (!m_platformSpeechSynthesizer)
         return String();
 
-    if (!utterance->lang().isEmpty()) {
-        const String& language = utterance->lang();
+    if (!utterance.lang().isEmpty()) {
+        const String& language = utterance.lang();
         const Vector<RefPtr<PlatformSpeechSynthesisVoice>>& voiceList = m_platformSpeechSynthesizer->voiceList();
         for (const auto& voice : voiceList) {
             // Espeak adds an empty character at the beginning of the language
@@ -144,7 +144,7 @@
     }
 
     m_utterance = WTFMove(utterance);
-    String voice = voiceName(m_utterance);
+    String voice = voiceName(*m_utterance);
     espeak_SetVoiceByName(voice.utf8().data());
     espeak_SetParameter(espeakRATE, convertRateToEspeakValue(m_utterance->rate()), 0);
     espeak_SetParameter(espeakVOLUME, convertVolumeToEspeakValue(m_utterance->volume()), 0);

Modified: trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h (207213 => 207214)


--- trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h	2016-10-12 14:41:59 UTC (rev 207214)
@@ -65,7 +65,7 @@
     int convertPitchToEspeakValue(float) const;
 
     espeak_VOICE* currentVoice() const;
-    String voiceName(PassRefPtr<PlatformSpeechSynthesisUtterance>) const;
+    String voiceName(PlatformSpeechSynthesisUtterance&) const;
     void fireSpeechEvent(SpeechEvent);
 
     bool m_isEngineStarted;

Modified: trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp (207213 => 207214)


--- trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp	2016-10-12 14:41:59 UTC (rev 207214)
@@ -91,7 +91,7 @@
     m_provider.stopUpdating();
 }
 
-void BatteryProvider::didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus> status)
+void BatteryProvider::didChangeBatteryStatus(const AtomicString& eventType, RefPtr<BatteryStatus>&& status)
 {
     WKRetainPtr<WKBatteryStatusRef> wkBatteryStatus = adoptWK(WKBatteryStatusCreate(status->charging(), status->chargingTime(), status->dischargingTime(), status->level()));
 

Modified: trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.h (207213 => 207214)


--- trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.h	2016-10-12 09:54:14 UTC (rev 207213)
+++ trunk/Source/WebKit2/UIProcess/efl/BatteryProvider.h	2016-10-12 14:41:59 UTC (rev 207214)
@@ -49,7 +49,7 @@
     explicit BatteryProvider(WKContextRef);
 
     // BatteryProviderEflClient interface.
-    virtual void didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<WebCore::BatteryStatus>);
+    virtual void didChangeBatteryStatus(const AtomicString& eventType, RefPtr<WebCore::BatteryStatus>&&);
 
     WKRetainPtr<WKBatteryManagerRef> m_batteryManager;
     WebCore::BatteryProviderEfl m_provider;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to