Title: [167590] trunk/Source/WebCore
Revision
167590
Author
[email protected]
Date
2014-04-21 03:39:51 -0700 (Mon, 21 Apr 2014)

Log Message

iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
https://bugs.webkit.org/show_bug.cgi?id=131916

Reviewed by Darin Adler.

A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).

* platform/RemoteCommandListener.cpp:
(WebCore::RemoteCommandListener::create):
* platform/RemoteCommandListener.h:
(WebCore::RemoteCommandListener::RemoteCommandListener):
* platform/ios/RemoteCommandListenerIOS.mm:
(WebCore::RemoteCommandListener::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (167589 => 167590)


--- trunk/Source/WebCore/ChangeLog	2014-04-21 10:15:40 UTC (rev 167589)
+++ trunk/Source/WebCore/ChangeLog	2014-04-21 10:39:51 UTC (rev 167590)
@@ -1,3 +1,20 @@
+2014-04-21  Zan Dobersek  <[email protected]>
+
+        iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
+        https://bugs.webkit.org/show_bug.cgi?id=131916
+
+        Reviewed by Darin Adler.
+
+        A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
+        in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).
+
+        * platform/RemoteCommandListener.cpp:
+        (WebCore::RemoteCommandListener::create):
+        * platform/RemoteCommandListener.h:
+        (WebCore::RemoteCommandListener::RemoteCommandListener):
+        * platform/ios/RemoteCommandListenerIOS.mm:
+        (WebCore::RemoteCommandListener::create):
+
 2014-04-21  Andreas Kling  <[email protected]>
 
         Micro-optimize the way we hand NodeLists to JSC.

Modified: trunk/Source/WebCore/platform/RemoteCommandListener.cpp (167589 => 167590)


--- trunk/Source/WebCore/platform/RemoteCommandListener.cpp	2014-04-21 10:15:40 UTC (rev 167589)
+++ trunk/Source/WebCore/platform/RemoteCommandListener.cpp	2014-04-21 10:39:51 UTC (rev 167590)
@@ -31,7 +31,7 @@
 #if !PLATFORM(IOS)
 std::unique_ptr<RemoteCommandListener> RemoteCommandListener::create(RemoteCommandListenerClient& client)
 {
-    return std::unique_ptr<RemoteCommandListener>(new RemoteCommandListener(client));
+    return std::make_unique<RemoteCommandListener>(client);
 }
 #endif
 

Modified: trunk/Source/WebCore/platform/RemoteCommandListener.h (167589 => 167590)


--- trunk/Source/WebCore/platform/RemoteCommandListener.h	2014-04-21 10:15:40 UTC (rev 167589)
+++ trunk/Source/WebCore/platform/RemoteCommandListener.h	2014-04-21 10:39:51 UTC (rev 167590)
@@ -39,11 +39,10 @@
 class RemoteCommandListener {
 public:
     static std::unique_ptr<RemoteCommandListener> create(RemoteCommandListenerClient&);
+    RemoteCommandListener(RemoteCommandListenerClient& client) : m_client(client) { }
     virtual ~RemoteCommandListener() { }
 
 protected:
-    RemoteCommandListener(RemoteCommandListenerClient& client) : m_client(client) { };
-
     RemoteCommandListenerClient& m_client;
 };
 

Modified: trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm (167589 => 167590)


--- trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm	2014-04-21 10:15:40 UTC (rev 167589)
+++ trunk/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm	2014-04-21 10:39:51 UTC (rev 167590)
@@ -41,7 +41,7 @@
 
 std::unique_ptr<RemoteCommandListener> RemoteCommandListener::create(RemoteCommandListenerClient& client)
 {
-    return std::unique_ptr<RemoteCommandListener>(new RemoteCommandListenerIOS(client));
+    return std::make_unique<RemoteCommandListenerIOS>(client);
 }
 
 RemoteCommandListenerIOS::RemoteCommandListenerIOS(RemoteCommandListenerClient& client)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to