Title: [194470] trunk
Revision
194470
Author
[email protected]
Date
2015-12-31 14:49:09 -0800 (Thu, 31 Dec 2015)

Log Message

Fix warnings uncovered by migrating to WTF_MOVE
https://bugs.webkit.org/show_bug.cgi?id=152601

Reviewed by Daniel Bates.

Source/_javascript_Core:

* create_regex_tables: Moving a return value prevented copy elision.
* ftl/FTLUnwindInfo.cpp:
(JSC::FTL::parseUnwindInfo): Ditto.
* replay/EncodedValue.h: Ditto.

Source/WebCore:

* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession): Moving a return value prevented copy elision.

Source/WebKit2:

* UIProcess/API/APIUIClient.h:
(API::UIClient::actionsForElement): Moving a return value passed to the function by value is redundant, since it
will be implicitly moved in this case.
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::actionsForElement): Ditto.

Tools:

Ignored -Wself-move warnings in these two API tests. It's useful to test that these classes properly handle
self-move, even if doing so would trigger a warning.

* TestWebKitAPI/Tests/WTF/NakedPtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/RefPtr.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (194469 => 194470)


--- trunk/Source/_javascript_Core/ChangeLog	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-12-31 22:49:09 UTC (rev 194470)
@@ -1,3 +1,15 @@
+2015-12-31  Andy Estes  <[email protected]>
+
+        Fix warnings uncovered by migrating to WTF_MOVE
+        https://bugs.webkit.org/show_bug.cgi?id=152601
+
+        Reviewed by Daniel Bates.
+
+        * create_regex_tables: Moving a return value prevented copy elision.
+        * ftl/FTLUnwindInfo.cpp:
+        (JSC::FTL::parseUnwindInfo): Ditto.
+        * replay/EncodedValue.h: Ditto.
+
 2015-12-30  Aleksandr Skachkov  <[email protected]>
 
         [ES6] Arrow function syntax. Arrow function specific features. Lexical bind "super"

Modified: trunk/Source/_javascript_Core/create_regex_tables (194469 => 194470)


--- trunk/Source/_javascript_Core/create_regex_tables	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/_javascript_Core/create_regex_tables	2015-12-31 22:49:09 UTC (rev 194470)
@@ -106,7 +106,7 @@
             function += ("    characterClass->m_rangesUnicode.append(CharacterRange(0x%04x, 0x%04x));\n" % (min, max))
         else:
             function += ("    characterClass->m_ranges.append(CharacterRange(0x%02x, 0x%02x));\n" % (min, max))
-    function += ("    return WTF::move(characterClass);\n")
+    function += ("    return characterClass;\n")
     function += ("}\n\n")
     functions += function
 

Modified: trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp (194469 => 194470)


--- trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/_javascript_Core/ftl/FTLUnwindInfo.cpp	2015-12-31 22:49:09 UTC (rev 194470)
@@ -1016,7 +1016,7 @@
 
 #endif
     registerOffsets->sort();
-    return WTF::move(registerOffsets);
+    return registerOffsets;
 }
 
 } } // namespace JSC::FTL

Modified: trunk/Source/_javascript_Core/replay/EncodedValue.h (194469 => 194470)


--- trunk/Source/_javascript_Core/replay/EncodedValue.h	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/_javascript_Core/replay/EncodedValue.h	2015-12-31 22:49:09 UTC (rev 194470)
@@ -114,7 +114,7 @@
         for (const typename EncodingTraits<T>::DecodedType& value : vectorOfValues)
             encodedVector.append<T>(value);
 
-        return WTF::move(encodedVector);
+        return encodedVector;
     }
 
     static bool decodeValue(EncodedValue& encodedVector, DecodedType& decodedValue)

Modified: trunk/Source/WebCore/ChangeLog (194469 => 194470)


--- trunk/Source/WebCore/ChangeLog	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/WebCore/ChangeLog	2015-12-31 22:49:09 UTC (rev 194470)
@@ -1,3 +1,13 @@
+2015-12-31  Andy Estes  <[email protected]>
+
+        Fix warnings uncovered by migrating to WTF_MOVE
+        https://bugs.webkit.org/show_bug.cgi?id=152601
+
+        Reviewed by Daniel Bates.
+
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        (WebCore::MediaKeys::createSession): Moving a return value prevented copy elision.
+
 2015-12-31  Brady Eidson  <[email protected]>
 
         Review feedback followup for:

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (194469 => 194470)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2015-12-31 22:49:09 UTC (rev 194470)
@@ -119,7 +119,7 @@
     session->generateKeyRequest(type, initData);
 
     // 6. Return the new object to the caller.
-    return WTF::move(session);
+    return session;
 }
 
 bool MediaKeys::isTypeSupported(const String& keySystem, const String& mimeType)

Modified: trunk/Source/WebKit2/ChangeLog (194469 => 194470)


--- trunk/Source/WebKit2/ChangeLog	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/WebKit2/ChangeLog	2015-12-31 22:49:09 UTC (rev 194470)
@@ -1,3 +1,16 @@
+2015-12-31  Andy Estes  <[email protected]>
+
+        Fix warnings uncovered by migrating to WTF_MOVE
+        https://bugs.webkit.org/show_bug.cgi?id=152601
+
+        Reviewed by Daniel Bates.
+
+        * UIProcess/API/APIUIClient.h:
+        (API::UIClient::actionsForElement): Moving a return value passed to the function by value is redundant, since it
+        will be implicitly moved in this case.
+        * UIProcess/Cocoa/UIDelegate.mm:
+        (WebKit::UIDelegate::UIClient::actionsForElement): Ditto.
+
 2015-12-30  Simon Fraser  <[email protected]>
 
         Add explicit conversions between scrollOffset and scrollPostion, and use them in a few places

Modified: trunk/Source/WebKit2/UIProcess/API/APIUIClient.h (194469 => 194470)


--- trunk/Source/WebKit2/UIProcess/API/APIUIClient.h	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/WebKit2/UIProcess/API/APIUIClient.h	2015-12-31 22:49:09 UTC (rev 194470)
@@ -159,7 +159,7 @@
 #if HAVE(APP_LINKS)
     virtual bool shouldIncludeAppLinkActionsForElement(_WKActivatedElementInfo *) { return true; }
 #endif
-    virtual RetainPtr<NSArray> actionsForElement(_WKActivatedElementInfo *, RetainPtr<NSArray> defaultActions) { return WTF::move(defaultActions); }
+    virtual RetainPtr<NSArray> actionsForElement(_WKActivatedElementInfo *, RetainPtr<NSArray> defaultActions) { return defaultActions; }
     virtual void didNotHandleTapAsClick(const WebCore::IntPoint&) { }
 #endif
 

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm (194469 => 194470)


--- trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm	2015-12-31 22:49:09 UTC (rev 194470)
@@ -360,7 +360,7 @@
 RetainPtr<NSArray> UIDelegate::UIClient::actionsForElement(_WKActivatedElementInfo *elementInfo, RetainPtr<NSArray> defaultActions)
 {
     if (!m_uiDelegate.m_delegateMethods.webViewActionsForElementDefaultActions)
-        return WTF::move(defaultActions);
+        return defaultActions;
 
     auto delegate = m_uiDelegate.m_delegate.get();
     if (!delegate)

Modified: trunk/Tools/ChangeLog (194469 => 194470)


--- trunk/Tools/ChangeLog	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Tools/ChangeLog	2015-12-31 22:49:09 UTC (rev 194470)
@@ -1,3 +1,18 @@
+2015-12-31  Andy Estes  <[email protected]>
+
+        Fix warnings uncovered by migrating to WTF_MOVE
+        https://bugs.webkit.org/show_bug.cgi?id=152601
+
+        Reviewed by Daniel Bates.
+
+        Ignored -Wself-move warnings in these two API tests. It's useful to test that these classes properly handle
+        self-move, even if doing so would trigger a warning.
+
+        * TestWebKitAPI/Tests/WTF/NakedPtr.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/RefPtr.cpp:
+        (TestWebKitAPI::TEST):
+
 2015-12-31  Martin Robinson  <[email protected]>
 
         [GTK] The install-dependencies script has a syntax error

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp (194469 => 194470)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp	2015-12-31 22:49:09 UTC (rev 194470)
@@ -179,7 +179,14 @@
     {
         NakedPtr<RefLogger> ptr(&a);
         ASSERT_EQ(&a, ptr.get());
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-move"
+#endif
         ptr = WTF::move(ptr);
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         ASSERT_EQ(&a, ptr.get());
     }
 }

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp (194469 => 194470)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2015-12-31 22:47:14 UTC (rev 194469)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp	2015-12-31 22:49:09 UTC (rev 194470)
@@ -270,7 +270,14 @@
     {
         RefPtr<RefLogger> ptr(&a);
         ASSERT_EQ(&a, ptr.get());
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-move"
+#endif
         ptr = WTF::move(ptr);
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
         ASSERT_EQ(&a, ptr.get());
     }
     ASSERT_STREQ("ref(a) deref(a) ", takeLogStr().c_str());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to