Title: [170650] trunk
Revision
170650
Author
[email protected]
Date
2014-07-01 10:49:47 -0700 (Tue, 01 Jul 2014)

Log Message

Remove unnecessary calls to std::move()
https://bugs.webkit.org/show_bug.cgi?id=134493

Reviewed by Anders Carlsson.

Source/WebCore:
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::CDM):
* css/CSSGrammar.y.in:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):
* css/MediaQuery.cpp:
(WebCore::MediaQuery::MediaQuery):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::dashesForIntersectionsWithRect):

Source/WebKit2:
* Shared/ShareableResource.cpp:
(WebKit::ShareableResource::Handle::tryWrapInCFData):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
of const WebCore::CertificateInfo& to avoid returning a dangling reference to
a local variable. Also, remove the unnecessary calls to std::move() as the compiler
will invoke the move constructor for WebCore::CertificateInfo on return from the
function.
* WebProcess/WebPage/WebFrame.h:

Tools:
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170649 => 170650)


--- trunk/Source/WebCore/ChangeLog	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/ChangeLog	2014-07-01 17:49:47 UTC (rev 170650)
@@ -1,3 +1,20 @@
+2014-07-01  Daniel Bates  <[email protected]>
+
+        Remove unnecessary calls to std::move()
+        https://bugs.webkit.org/show_bug.cgi?id=134493
+
+        Reviewed by Anders Carlsson.
+
+        * Modules/encryptedmedia/CDM.cpp:
+        (WebCore::CDM::CDM):
+        * css/CSSGrammar.y.in:
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::formatNumberValue):
+        * css/MediaQuery.cpp:
+        (WebCore::MediaQuery::MediaQuery):
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::Font::dashesForIntersectionsWithRect):
+
 2014-07-01  Zalan Bujtas  <[email protected]>
 
         Subpixel rendering: Pixel crack in breadcrumbs at devforums.apple.com.

Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (170649 => 170650)


--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -106,7 +106,7 @@
     : m_keySystem(keySystem)
     , m_client(0)
 {
-    m_private = std::move(CDMFactoryForKeySystem(keySystem)->constructor(this));
+    m_private = CDMFactoryForKeySystem(keySystem)->constructor(this);
 }
 
 CDM::~CDM()

Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (170649 => 170650)


--- trunk/Source/WebCore/css/CSSGrammar.y.in	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2014-07-01 17:49:47 UTC (rev 170650)
@@ -377,7 +377,7 @@
     }
 ;
 
-webkit_mediaquery: WEBKIT_MEDIAQUERY_SYM WHITESPACE maybe_space media_query '}' { parser->m_mediaQuery = std::move(std::unique_ptr<MediaQuery>($4)); } ;
+webkit_mediaquery: WEBKIT_MEDIAQUERY_SYM WHITESPACE maybe_space media_query '}' { parser->m_mediaQuery = std::unique_ptr<MediaQuery>($4); } ;
 
 webkit_selector:
     WEBKIT_SELECTOR_SYM '{' maybe_space selector_list '}' {
@@ -558,7 +558,7 @@
     ;
 
 webkit_source_size_list:
-    WEBKIT_SIZESATTR_SYM WHITESPACE source_size_list '}' { parser->m_sourceSizeList = std::move(std::unique_ptr<SourceSizeList>($3)); };
+    WEBKIT_SIZESATTR_SYM WHITESPACE source_size_list '}' { parser->m_sourceSizeList = std::unique_ptr<SourceSizeList>($3); };
 
 source_size_list:
     maybe_space source_size maybe_space {

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (170649 => 170650)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -940,7 +940,7 @@
 template <unsigned characterCount>
 ALWAYS_INLINE PassRef<StringImpl> CSSPrimitiveValue::formatNumberValue(const char (&characters)[characterCount]) const
 {
-    return std::move(formatNumberValue(characters, characterCount - 1));
+    return formatNumberValue(characters, characterCount - 1);
 }
 
 ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForcustomCSSText() const

Modified: trunk/Source/WebCore/css/MediaQuery.cpp (170649 => 170650)


--- trunk/Source/WebCore/css/MediaQuery.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/css/MediaQuery.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -110,7 +110,7 @@
     , m_serializationCache(o.m_serializationCache)
 {
     for (unsigned i = 0; i < m_expressions->size(); ++i)
-        (*m_expressions)[i] = std::move(o.m_expressions->at(i)->copy());
+        (*m_expressions)[i] = o.m_expressions->at(i)->copy();
 }
 
 MediaQuery::~MediaQuery()

Modified: trunk/Source/WebCore/platform/graphics/mac/FontMac.mm (170649 => 170650)


--- trunk/Source/WebCore/platform/graphics/mac/FontMac.mm	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebCore/platform/graphics/mac/FontMac.mm	2014-07-01 17:49:47 UTC (rev 170650)
@@ -534,9 +534,9 @@
     bool isSVG = false;
     FloatPoint origin = FloatPoint(textOrigin.x() + deltaX, textOrigin.y());
     if (!fontData->isSVGFont())
-        translator = std::move(std::make_unique<MacGlyphToPathTranslator>(run, glyphBuffer, origin));
+        translator = std::make_unique<MacGlyphToPathTranslator>(run, glyphBuffer, origin);
     else {
-        translator = std::move(run.renderingContext()->createGlyphToPathTranslator(*fontData, &run, glyphBuffer, 0, glyphBuffer.size(), origin));
+        translator = run.renderingContext()->createGlyphToPathTranslator(*fontData, &run, glyphBuffer, 0, glyphBuffer.size(), origin);
         isSVG = true;
     }
     DashArray result;

Modified: trunk/Source/WebKit2/ChangeLog (170649 => 170650)


--- trunk/Source/WebKit2/ChangeLog	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-01 17:49:47 UTC (rev 170650)
@@ -1,3 +1,20 @@
+2014-07-01  Daniel Bates  <[email protected]>
+
+        Remove unnecessary calls to std::move()
+        https://bugs.webkit.org/show_bug.cgi?id=134493
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/ShareableResource.cpp:
+        (WebKit::ShareableResource::Handle::tryWrapInCFData):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
+        of const WebCore::CertificateInfo& to avoid returning a dangling reference to
+        a local variable. Also, remove the unnecessary calls to std::move() as the compiler
+        will invoke the move constructor for WebCore::CertificateInfo on return from the
+        function.
+        * WebProcess/WebPage/WebFrame.h:
+
 2014-07-01  Anders Carlsson  <[email protected]>
 
         Add a BackForwardListItemState struct and put the snapshot UUID there

Modified: trunk/Source/WebKit2/Shared/ShareableResource.cpp (170649 => 170650)


--- trunk/Source/WebKit2/Shared/ShareableResource.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebKit2/Shared/ShareableResource.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -89,7 +89,7 @@
     }
 
     RetainPtr<CFAllocatorRef> deallocator = adoptCF(createShareableResourceDeallocator(resource.get()));
-    return std::move(adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(resource->data()), static_cast<CFIndex>(resource->size()), deallocator.get())));
+    return adoptCF(CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(resource->data()), static_cast<CFIndex>(resource->size()), deallocator.get()));
 }
 
 PassRefPtr<SharedBuffer> ShareableResource::Handle::tryWrapInSharedBuffer() const

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (170649 => 170650)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -402,16 +402,16 @@
     return documentLoader->url().string();
 }
 
-const WebCore::CertificateInfo& WebFrame::certificateInfo() const
+WebCore::CertificateInfo WebFrame::certificateInfo() const
 {
     if (!m_coreFrame)
-        return std::move(CertificateInfo());
+        return CertificateInfo();
 
     DocumentLoader* documentLoader = m_coreFrame->loader().documentLoader();
     if (!documentLoader)
-        return std::move(CertificateInfo());
+        return CertificateInfo();
 
-    return std::move(CertificateInfo(documentLoader->response()));
+    return CertificateInfo(documentLoader->response());
 }
 
 String WebFrame::innerText() const

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h (170649 => 170650)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h	2014-07-01 17:49:47 UTC (rev 170650)
@@ -92,7 +92,7 @@
     bool isMainFrame() const;
     String name() const;
     String url() const;
-    const WebCore::CertificateInfo& certificateInfo() const;
+    WebCore::CertificateInfo certificateInfo() const;
     String innerText() const;
     bool isFrameSet() const;
     WebFrame* parentFrame() const;

Modified: trunk/Tools/ChangeLog (170649 => 170650)


--- trunk/Tools/ChangeLog	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Tools/ChangeLog	2014-07-01 17:49:47 UTC (rev 170650)
@@ -1,3 +1,15 @@
+2014-07-01  Daniel Bates  <[email protected]>
+
+        Remove unnecessary calls to std::move()
+        https://bugs.webkit.org/show_bug.cgi?id=134493
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/WTF/HashSet.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm:
+        (TestWebKitAPI::TEST):
+
 2014-07-01  Pratik Solanki  <[email protected]>
 
         Unreviewed. Adding myself to the reviewers list to make commit bot happy.

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp (170649 => 170650)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/HashSet.cpp	2014-07-01 17:49:47 UTC (rev 170650)
@@ -96,7 +96,7 @@
     EXPECT_TRUE(hashSet.isEmpty());
 
     for (size_t i = 0; i < 100; ++i)
-        hashSet.add(std::move(MoveOnly(i + 1)));
+        hashSet.add(MoveOnly(i + 1));
 
     for (size_t i = 0; i < 100; ++i)
         EXPECT_TRUE(hashSet.take(MoveOnly(i + 1)) == MoveOnly(i + 1));
@@ -104,7 +104,7 @@
     EXPECT_TRUE(hashSet.isEmpty());
 
     for (size_t i = 0; i < 100; ++i)
-        hashSet.add(std::move(MoveOnly(i + 1)));
+        hashSet.add(MoveOnly(i + 1));
 
     HashSet<MoveOnly> secondSet;
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm (170649 => 170650)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm	2014-07-01 17:46:29 UTC (rev 170649)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/ns/RetainPtr.mm	2014-07-01 17:49:47 UTC (rev 170650)
@@ -84,7 +84,7 @@
     NSString *string = @"foo";
 
     // This should invoke RetainPtr's move constructor.
-    RetainPtr<NSString> ptr = std::move(RetainPtr<NSString>(string));
+    RetainPtr<NSString> ptr = RetainPtr<NSString>(string);
 
     EXPECT_EQ(string, ptr);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to