Stop moving local objects in return statements
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Dec 2015 16:26:24 +0000 (16:26 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Dec 2015 16:26:24 +0000 (16:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=152557

Reviewed by Brady Eidson.

Source/JavaScriptCore:

Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.

Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
I found these issues by temporarily replacing WTF::move with std::move and recompiling.

* inspector/ScriptCallStack.cpp:
(Inspector::ScriptCallStack::buildInspectorArray):
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::buildInspectorObject):
* jit/CallFrameShuffler.h:
(JSC::CallFrameShuffler::snapshot):
* runtime/TypeSet.cpp:
(JSC::TypeSet::allStructureRepresentations):
(JSC::StructureShape::inspectorRepresentation):

Source/WebCore:

Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.

Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
I found these issues by temporarily replacing WTF::move with std::move and recompiling.

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::isolatedCopy):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::deletedValue):
* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::objectStoreNames):
(WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::createObjectStore):
(WebCore::IDBClient::IDBTransaction::createIndex):
(WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBClient::IDBTransaction::requestGetRecord):
(WebCore::IDBClient::IDBTransaction::requestIndexRecord):
(WebCore::IDBClient::IDBTransaction::requestClearObjectStore):
(WebCore::IDBClient::IDBTransaction::requestPutOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::isolatedCopy):
(WebCore::IDBDatabaseInfo::objectStoreNames):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::error):
(WebCore::IDBResultData::openDatabaseSuccess):
(WebCore::IDBResultData::openDatabaseUpgradeNeeded):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::versionChange):
(WebCore::IDBTransactionInfo::isolatedCopy):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::create):
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::originLockFor):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue):
* dom/NodeOrString.cpp:
(WebCore::convertNodesOrStringsIntoNode):
* inspector/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
(WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::buildObjectForHeaders):
(WebCore::buildObjectForResourceRequest):
(WebCore::buildObjectForCachedResource):
* inspector/InspectorOverlay.cpp:
(WebCore::buildArrayForQuad):
(WebCore::buildObjectForFlowRegions):
(WebCore::InspectorOverlay::buildObjectForHighlightedNodes):
* inspector/InspectorPageAgent.cpp:
(WebCore::createXHRTextDecoder):
(WebCore::buildArrayForCookies):
(WebCore::InspectorPageAgent::buildObjectForFrame):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildMediaObject):
(WebCore::InspectorStyle::buildArrayForComputedStyle):
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForStyle):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::stopFromConsole):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createConsoleProfileData):
(WebCore::TimelineRecordFactory::createProbeSampleData):
(WebCore::TimelineRecordFactory::createEventDispatchData):
(WebCore::TimelineRecordFactory::createGenericTimerData):
(WebCore::TimelineRecordFactory::createTimerInstallData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):
(WebCore::TimelineRecordFactory::createTimeStampData):
(WebCore::TimelineRecordFactory::createAnimationFrameData):
(WebCore::createQuad):
(WebCore::TimelineRecordFactory::createPaintData):
(WebCore::buildInspectorObject):
* loader/FrameLoader.cpp:
(WebCore::createWindow):
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* platform/network/ios/QuickLook.mm:
(WebCore::QuickLookHandle::create):
* testing/Internals.cpp:
(WebCore::Internals::openDummyInspectorFrontend):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::createResourceRequest):
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::evaluate):

Source/WebKit2:

Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.

Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
I found these issues by temporarily replacing WTF::move with std::move and recompiling.

* UIProcess/WebPageProxy.cpp:
(WebKit::ExceededDatabaseQuotaRecords::createRecord):

Source/WTF:

* wtf/StdLibExtras.h: Added a FIXME about how using WTF::move() prevents several Clang diagnostics from emitting useful warnings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/ScriptCallStack.cpp
Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.cpp
Source/JavaScriptCore/jit/CallFrameShuffler.h
Source/JavaScriptCore/runtime/TypeSet.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/StdLibExtras.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp
Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp
Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp
Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp
Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/dom/NodeOrString.cpp
Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
Source/WebCore/inspector/InspectorNetworkAgent.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/NavigationAction.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/platform/network/ios/QuickLook.mm
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/WorkerScriptLoader.cpp
Source/WebCore/xml/XPathExpression.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 4811bf1..61f5bfd 100644 (file)
@@ -1,3 +1,25 @@
+2015-12-25  Andy Estes  <aestes@apple.com>
+
+        Stop moving local objects in return statements
+        https://bugs.webkit.org/show_bug.cgi?id=152557
+
+        Reviewed by Brady Eidson.
+
+        Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.
+
+        Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
+        I found these issues by temporarily replacing WTF::move with std::move and recompiling.
+
+        * inspector/ScriptCallStack.cpp:
+        (Inspector::ScriptCallStack::buildInspectorArray):
+        * inspector/agents/InspectorScriptProfilerAgent.cpp:
+        (Inspector::buildInspectorObject):
+        * jit/CallFrameShuffler.h:
+        (JSC::CallFrameShuffler::snapshot):
+        * runtime/TypeSet.cpp:
+        (JSC::TypeSet::allStructureRepresentations):
+        (JSC::StructureShape::inspectorRepresentation):
+
 2015-12-26  Mark Lam  <mark.lam@apple.com>
 
         Rename NodeMayOverflowInXXX to NodeMayOverflowInt32InXXX.
index 49b0719..65ec9de 100644 (file)
@@ -111,7 +111,7 @@ Ref<Inspector::Protocol::Console::StackTrace> ScriptCallStack::buildInspectorArr
     auto frames = Inspector::Protocol::Console::StackTrace::create();
     for (size_t i = 0; i < m_frames.size(); i++)
         frames->addItem(m_frames.at(i).buildInspectorObject());
-    return WTF::move(frames);
+    return frames;
 }
 
 } // namespace Inspector
index b72078c..0b1cf59 100644 (file)
@@ -181,7 +181,7 @@ static Ref<Protocol::Timeline::CPUProfileNode> buildInspectorObject(const JSC::P
         result->setChildren(WTF::move(children));
     }
 
-    return WTF::move(result);
+    return result;
 }
 
 static Ref<Protocol::Timeline::CPUProfile> buildProfileInspectorObject(const JSC::Profile* profile)
index c993e8c..45a7730 100644 (file)
@@ -117,7 +117,7 @@ public:
             RELEASE_ASSERT_NOT_REACHED();
 #endif
         }
-        return WTF::move(data);
+        return data;
     }
 
     // Ask the shuffler to put the callee into some registers once the
index a436cda..a02e2a6 100644 (file)
@@ -224,7 +224,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::StructureDescriptio
     for (size_t i = 0; i < m_structureHistory.size(); i++)
         description->addItem(m_structureHistory.at(i)->inspectorRepresentation());
 
-    return WTF::move(description);
+    return description;
 }
 
 Ref<Inspector::Protocol::Runtime::TypeSet> TypeSet::inspectorTypeSet() const
@@ -523,7 +523,7 @@ Ref<Inspector::Protocol::Runtime::StructureDescription> StructureShape::inspecto
         currentShape = currentShape->m_proto;
     }
 
-    return WTF::move(base);
+    return base;
 }
 
 bool StructureShape::hasSamePrototypeChain(PassRefPtr<StructureShape> prpOther)
index 200d354..a8cfe55 100644 (file)
@@ -1,3 +1,12 @@
+2015-12-25  Andy Estes  <aestes@apple.com>
+
+        Stop moving local objects in return statements
+        https://bugs.webkit.org/show_bug.cgi?id=152557
+
+        Reviewed by Brady Eidson.
+
+        * wtf/StdLibExtras.h: Added a FIXME about how using WTF::move() prevents several Clang diagnostics from emitting useful warnings.
+
 2015-12-22  Filip Pizlo  <fpizlo@apple.com>
 
         FTL B3 should be able to run richards
index 8f2f331..92ba430 100644 (file)
@@ -111,6 +111,8 @@ inline bool isPointerTypeAlignmentOkay(Type*)
 
 namespace WTF {
 
+// FIXME: Using this function prevents Clang's move diagnostics (-Wpessimizing-move, -Wredundant-move, -Wself-move) from
+// finding mistakes, since these diagnostics only evaluate calls to std::move().
 template<typename T>
 ALWAYS_INLINE typename std::remove_reference<T>::type&& move(T&& value)
 {
index 25e6ef4..00e0e97 100644 (file)
@@ -1,3 +1,115 @@
+2015-12-25  Andy Estes  <aestes@apple.com>
+
+        Stop moving local objects in return statements
+        https://bugs.webkit.org/show_bug.cgi?id=152557
+
+        Reviewed by Brady Eidson.
+
+        Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.
+
+        Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
+        I found these issues by temporarily replacing WTF::move with std::move and recompiling.
+
+        * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
+        (WebCore::IDBDatabaseIdentifier::isolatedCopy):
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::deletedValue):
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+        (WebCore::IDBClient::IDBDatabase::objectStoreNames):
+        (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::createObjectStore):
+        (WebCore::IDBClient::IDBTransaction::createIndex):
+        (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
+        (WebCore::IDBClient::IDBTransaction::requestGetRecord):
+        (WebCore::IDBClient::IDBTransaction::requestIndexRecord):
+        (WebCore::IDBClient::IDBTransaction::requestClearObjectStore):
+        (WebCore::IDBClient::IDBTransaction::requestPutOrAdd):
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
+        * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+        (WebCore::IDBDatabaseInfo::isolatedCopy):
+        (WebCore::IDBDatabaseInfo::objectStoreNames):
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::error):
+        (WebCore::IDBResultData::openDatabaseSuccess):
+        (WebCore::IDBResultData::openDatabaseUpgradeNeeded):
+        * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
+        (WebCore::IDBTransactionInfo::versionChange):
+        (WebCore::IDBTransactionInfo::isolatedCopy):
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::create):
+        * Modules/webaudio/OfflineAudioContext.cpp:
+        (WebCore::OfflineAudioContext::create):
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::originLockFor):
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::create):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::formatNumberValue):
+        * dom/NodeOrString.cpp:
+        (WebCore::convertNodesOrStringsIntoNode):
+        * inspector/InspectorApplicationCacheAgent.cpp:
+        (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
+        (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
+        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
+        * inspector/InspectorIndexedDBAgent.cpp:
+        * inspector/InspectorLayerTreeAgent.cpp:
+        (WebCore::InspectorLayerTreeAgent::buildObjectForLayer):
+        * inspector/InspectorNetworkAgent.cpp:
+        (WebCore::buildObjectForHeaders):
+        (WebCore::buildObjectForResourceRequest):
+        (WebCore::buildObjectForCachedResource):
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::buildArrayForQuad):
+        (WebCore::buildObjectForFlowRegions):
+        (WebCore::InspectorOverlay::buildObjectForHighlightedNodes):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::createXHRTextDecoder):
+        (WebCore::buildArrayForCookies):
+        (WebCore::InspectorPageAgent::buildObjectForFrame):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::buildMediaObject):
+        (WebCore::InspectorStyle::buildArrayForComputedStyle):
+        (WebCore::buildObjectForSelectorHelper):
+        (WebCore::selectorsFromSource):
+        (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
+        (WebCore::InspectorStyleSheet::buildObjectForStyle):
+        (WebCore::InspectorStyleSheet::buildArrayForRuleList):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::stopFromConsole):
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+        (WebCore::TimelineRecordFactory::createFunctionCallData):
+        (WebCore::TimelineRecordFactory::createConsoleProfileData):
+        (WebCore::TimelineRecordFactory::createProbeSampleData):
+        (WebCore::TimelineRecordFactory::createEventDispatchData):
+        (WebCore::TimelineRecordFactory::createGenericTimerData):
+        (WebCore::TimelineRecordFactory::createTimerInstallData):
+        (WebCore::TimelineRecordFactory::createEvaluateScriptData):
+        (WebCore::TimelineRecordFactory::createTimeStampData):
+        (WebCore::TimelineRecordFactory::createAnimationFrameData):
+        (WebCore::createQuad):
+        (WebCore::TimelineRecordFactory::createPaintData):
+        (WebCore::buildInspectorObject):
+        * loader/FrameLoader.cpp:
+        (WebCore::createWindow):
+        * loader/NavigationAction.cpp:
+        (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::createWindow):
+        * platform/network/ios/QuickLook.mm:
+        (WebCore::QuickLookHandle::create):
+        * testing/Internals.cpp:
+        (WebCore::Internals::openDummyInspectorFrontend):
+        * workers/WorkerScriptLoader.cpp:
+        (WebCore::WorkerScriptLoader::createResourceRequest):
+        * xml/XPathExpression.cpp:
+        (WebCore::XPathExpression::evaluate):
+
 2015-12-27  Zalan Bujtas  <zalan@apple.com>
 
         Should never be reached failure in WebCore::RenderElement::clearLayoutRootIfNeeded
index 94b7caf..dd94e1f 100644 (file)
@@ -52,7 +52,7 @@ IDBDatabaseIdentifier IDBDatabaseIdentifier::isolatedCopy() const
     identifier.m_openingOrigin = m_openingOrigin.isolatedCopy();
     identifier.m_mainFrameOrigin = m_mainFrameOrigin.isolatedCopy();
 
-    return WTF::move(identifier);
+    return identifier;
 }
 
 #ifndef NDEBUG
index 142f248..fd36519 100644 (file)
@@ -324,7 +324,7 @@ IDBKeyData IDBKeyData::deletedValue()
     IDBKeyData result;
     result.m_isNull = false;
     result.m_isDeletedValue = true;
-    return WTF::move(result);
+    return result;
 }
 
 bool IDBKeyData::operator<(const IDBKeyData& rhs) const
index 08b50db..3e2dca4 100644 (file)
@@ -84,7 +84,7 @@ RefPtr<DOMStringList> IDBDatabase::objectStoreNames() const
     for (auto& name : m_info.objectStoreNames())
         objectStoreNames->append(name);
     objectStoreNames->sort();
-    return WTF::move(objectStoreNames);
+    return objectStoreNames;
 }
 
 RefPtr<WebCore::IDBObjectStore> IDBDatabase::createObjectStore(const String&, const Dictionary&, ExceptionCodeWithMessage&)
@@ -266,7 +266,7 @@ Ref<IDBTransaction> IDBDatabase::startVersionChangeTransaction(const IDBTransact
 
     m_activeTransactions.set(transaction->info().identifier(), &transaction.get());
 
-    return WTF::move(transaction);
+    return transaction;
 }
 
 void IDBDatabase::didStartTransaction(IDBTransaction& transaction)
index 28f4bd9..4217f77 100644 (file)
@@ -444,7 +444,7 @@ Ref<IDBObjectStore> IDBTransaction::createObjectStore(const IDBObjectStoreInfo&
     auto operation = createTransactionOperation(*this, &IDBTransaction::didCreateObjectStoreOnServer, &IDBTransaction::createObjectStoreOnServer, info);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(objectStore);
+    return objectStore;
 }
 
 void IDBTransaction::createObjectStoreOnServer(TransactionOperation& operation, const IDBObjectStoreInfo& info)
@@ -473,7 +473,7 @@ Ref<IDBIndex> IDBTransaction::createIndex(IDBObjectStore& objectStore, const IDB
     auto operation = createTransactionOperation(*this, &IDBTransaction::didCreateIndexOnServer, &IDBTransaction::createIndexOnServer, info);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(index);
+    return index;
 }
 
 void IDBTransaction::createIndexOnServer(TransactionOperation& operation, const IDBIndexInfo& info)
@@ -529,7 +529,7 @@ Ref<IDBRequest> IDBTransaction::doRequestOpenCursor(ScriptExecutionContext& cont
     auto operation = createTransactionOperation(*this, request.get(), &IDBTransaction::didOpenCursorOnServer, &IDBTransaction::openCursorOnServer, cursor->info());
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(request);
+    return request;
 }
 
 void IDBTransaction::openCursorOnServer(TransactionOperation& operation, const IDBCursorInfo& info)
@@ -584,7 +584,7 @@ Ref<IDBRequest> IDBTransaction::requestGetRecord(ScriptExecutionContext& context
     auto operation = createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, keyRangeData);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(request);
+    return request;
 }
 
 Ref<IDBRequest> IDBTransaction::requestGetValue(ScriptExecutionContext& context, IDBIndex& index, const IDBKeyRangeData& range)
@@ -611,7 +611,7 @@ Ref<IDBRequest> IDBTransaction::requestIndexRecord(ScriptExecutionContext& conte
     auto operation = createTransactionOperation(*this, request.get(), &IDBTransaction::didGetRecordOnServer, &IDBTransaction::getRecordOnServer, range);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(request);
+    return request;
 }
 
 void IDBTransaction::getRecordOnServer(TransactionOperation& operation, const IDBKeyRangeData& keyRange)
@@ -732,7 +732,7 @@ Ref<IDBRequest> IDBTransaction::requestClearObjectStore(ScriptExecutionContext&
     auto operation = createTransactionOperation(*this, request.get(), &IDBTransaction::didClearObjectStoreOnServer, &IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(request);
+    return request;
 }
 
 void IDBTransaction::clearObjectStoreOnServer(TransactionOperation& operation, const uint64_t& objectStoreIdentifier)
@@ -763,7 +763,7 @@ Ref<IDBRequest> IDBTransaction::requestPutOrAdd(ScriptExecutionContext& context,
     auto operation = createTransactionOperation(*this, request.get(), &IDBTransaction::didPutOrAddOnServer, &IDBTransaction::putOrAddOnServer, key, &value, overwriteMode);
     scheduleOperation(WTF::move(operation));
 
-    return WTF::move(request);
+    return request;
 }
 
 void IDBTransaction::putOrAddOnServer(TransactionOperation& operation, RefPtr<IDBKey> key, RefPtr<SerializedScriptValue> value, const IndexedDB::ObjectStoreOverwriteMode& overwriteMode)
index a00a0e2..07ad54a 100644 (file)
@@ -1085,13 +1085,13 @@ RefPtr<UniqueIDBDatabaseTransaction> UniqueIDBDatabase::takeNextRunnableTransact
 
     hadDeferredTransactions = !deferredTransactions.isEmpty();
     if (!hadDeferredTransactions)
-        return WTF::move(currentTransaction);
+        return currentTransaction;
 
     // Prepend the deferred transactions back on the beginning of the deque for future scheduling passes.
     while (!deferredTransactions.isEmpty())
         m_pendingTransactions.prepend(deferredTransactions.takeLast());
 
-    return WTF::move(currentTransaction);
+    return currentTransaction;
 }
 
 void UniqueIDBDatabase::inProgressTransactionCompleted(const IDBResourceIdentifier& transactionIdentifier)
index ae4022b..44aa47e 100644 (file)
@@ -47,7 +47,7 @@ IDBDatabaseInfo IDBDatabaseInfo::isolatedCopy() const
     info.m_name = m_name.isolatedCopy();
     info.m_version = m_version;
 
-    return WTF::move(info);
+    return info;
 }
 
 bool IDBDatabaseInfo::hasObjectStore(const String& name) const
@@ -123,7 +123,7 @@ Vector<String> IDBDatabaseInfo::objectStoreNames() const
     for (auto& objectStore : m_objectStoreMap.values())
         names.uncheckedAppend(objectStore.name());
 
-    return WTF::move(names);
+    return names;
 }
 
 void IDBDatabaseInfo::deleteObjectStore(const String& objectStoreName)
index 31aef8f..302eee7 100644 (file)
@@ -67,7 +67,7 @@ IDBResultData IDBResultData::error(const IDBResourceIdentifier& requestIdentifie
     IDBResultData result(requestIdentifier);
     result.m_type = IDBResultType::Error;
     result.m_error = error;
-    return WTF::move(result);
+    return result;
 }
 
 IDBResultData IDBResultData::openDatabaseSuccess(const IDBResourceIdentifier& requestIdentifier, IDBServer::UniqueIDBDatabaseConnection& connection)
@@ -76,7 +76,7 @@ IDBResultData IDBResultData::openDatabaseSuccess(const IDBResourceIdentifier& re
     result.m_type = IDBResultType::OpenDatabaseSuccess;
     result.m_databaseConnectionIdentifier = connection.identifier();
     result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(connection.database().info());
-    return WTF::move(result);
+    return result;
 }
 
 
@@ -87,7 +87,7 @@ IDBResultData IDBResultData::openDatabaseUpgradeNeeded(const IDBResourceIdentifi
     result.m_databaseConnectionIdentifier = transaction.databaseConnection().identifier();
     result.m_databaseInfo = std::make_unique<IDBDatabaseInfo>(transaction.databaseConnection().database().info());
     result.m_transactionInfo = std::make_unique<IDBTransactionInfo>(transaction.info());
-    return WTF::move(result);
+    return result;
 }
 
 IDBResultData IDBResultData::deleteDatabaseSuccess(const IDBResourceIdentifier& requestIdentifier, const IDBDatabaseInfo& info)
index 7b89ed7..fe5aee8 100644 (file)
@@ -53,7 +53,7 @@ IDBTransactionInfo IDBTransactionInfo::versionChange(const IDBServer::IDBConnect
     result.m_newVersion = newVersion;
     result.m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(originalDatabaseInfo);
 
-    return WTF::move(result);
+    return result;
 }
 
 IDBTransactionInfo::IDBTransactionInfo(const IDBTransactionInfo& info)
@@ -79,7 +79,7 @@ IDBTransactionInfo IDBTransactionInfo::isolatedCopy() const
     if (m_originalDatabaseInfo)
         result.m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(*m_originalDatabaseInfo);
 
-    return WTF::move(result);
+    return result;
 }
 
 #ifndef NDEBUG
index 1ef4054..506e921 100644 (file)
@@ -44,7 +44,7 @@ Ref<InProcessIDBServer> InProcessIDBServer::create()
 {
     Ref<InProcessIDBServer> server = adoptRef(*new InProcessIDBServer);
     server->m_server->registerConnection(server->connectionToClient());
-    return WTF::move(server);
+    return server;
 }
 
 InProcessIDBServer::InProcessIDBServer()
index e5ed948..8a61aea 100644 (file)
@@ -51,7 +51,7 @@ RefPtr<OfflineAudioContext> OfflineAudioContext::create(ScriptExecutionContext&
 
     RefPtr<OfflineAudioContext> audioContext(adoptRef(new OfflineAudioContext(document, numberOfChannels, numberOfFrames, sampleRate)));
     audioContext->suspendIfNeeded();
-    return WTF::move(audioContext);
+    return audioContext;
 }
 
 OfflineAudioContext::OfflineAudioContext(Document& document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
index 79bccc4..1fe9f1a 100644 (file)
@@ -667,7 +667,7 @@ RefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
     ASSERT(lock);
     addResult.iterator->value = lock;
 
-    return WTF::move(lock);
+    return lock;
 }
 
 void DatabaseTracker::deleteOriginLockFor(SecurityOrigin* origin)
index 0f47681..94470ca 100644 (file)
@@ -183,7 +183,7 @@ RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const Strin
     if (ec)
         return nullptr;
 
-    return WTF::move(webSocket);
+    return webSocket;
 }
 
 RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol, ExceptionCode& ec)
index ddb8023..82367fe 100644 (file)
@@ -976,7 +976,7 @@ NEVER_INLINE Ref<StringImpl> CSSPrimitiveValue::formatNumberValue(const char* su
     for (unsigned i = 0; i < suffixLength; ++i)
         buffer[length + i] = static_cast<LChar>(suffix[i]);
 
-    return WTF::move(string);
+    return string;
 }
 
 template <unsigned characterCount>
index a8a8ef7..d5f25e4 100644 (file)
@@ -61,7 +61,7 @@ RefPtr<Node> convertNodesOrStringsIntoNode(Node& context, Vector<NodeOrString>&&
         }
     }
     
-    return WTF::move(nodeToReturn);
+    return nodeToReturn;
 }
 
 } // namespace WebCore
index 8098912..cbd9a7a 100644 (file)
@@ -164,7 +164,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::ApplicationCache::Applicatio
     for (const auto& resourceInfo : applicationCacheResources)
         resources->addItem(buildObjectForApplicationCacheResource(resourceInfo));
 
-    return WTF::move(resources);
+    return resources;
 }
 
 Ref<Inspector::Protocol::ApplicationCache::ApplicationCacheResource> InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource(const ApplicationCacheHost::ResourceInfo& resourceInfo)
index 421872c..c7cc88c 100644 (file)
@@ -1376,7 +1376,7 @@ Ref<Inspector::Protocol::DOM::Node> InspectorDOMAgent::buildObjectForNode(Node*
             value->setRole(axObject->computedRoleString());
     }
 
-    return WTF::move(value);
+    return value;
 }
 
 Ref<Inspector::Protocol::Array<String>> InspectorDOMAgent::buildArrayForElementAttributes(Element* element)
@@ -1384,13 +1384,13 @@ Ref<Inspector::Protocol::Array<String>> InspectorDOMAgent::buildArrayForElementA
     auto attributesValue = Inspector::Protocol::Array<String>::create();
     // Go through all attributes and serialize them.
     if (!element->hasAttributes())
-        return WTF::move(attributesValue);
+        return attributesValue;
     for (const Attribute& attribute : element->attributesIterator()) {
         // Add attribute pair
         attributesValue->addItem(attribute.name().toString());
         attributesValue->addItem(attribute.value());
     }
-    return WTF::move(attributesValue);
+    return attributesValue;
 }
 
 Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgent::buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap)
@@ -1403,7 +1403,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgen
             children->addItem(buildObjectForNode(firstChild, 0, nodesMap));
             m_childrenRequested.add(bind(container, nodesMap));
         }
-        return WTF::move(children);
+        return children;
     }
 
     Node* child = innerFirstChild(container);
@@ -1414,7 +1414,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgen
         children->addItem(buildObjectForNode(child, depth, nodesMap));
         child = innerNextSibling(child);
     }
-    return WTF::move(children);
+    return children;
 }
 
 RefPtr<Inspector::Protocol::Array<Inspector::Protocol::DOM::Node>> InspectorDOMAgent::buildArrayForPseudoElements(const Element& element, NodeToIdMap* nodesMap)
@@ -1481,7 +1481,7 @@ Ref<Inspector::Protocol::DOM::EventListener> InspectorDOMAgent::buildObjectForEv
         if (!sourceName.isEmpty())
             value->setSourceName(sourceName);
     }
-    return WTF::move(value);
+    return value;
 }
     
 void InspectorDOMAgent::processAccessibilityChildren(RefPtr<AccessibilityObject>&& axObject, RefPtr<Inspector::Protocol::Array<int>>&& childNodeIds)
index 8c45337..e67633a 100644 (file)
@@ -225,7 +225,7 @@ static RefPtr<IDBTransaction> transactionForDatabase(ScriptExecutionContext* scr
     RefPtr<IDBTransaction> idbTransaction = idbDatabase->transaction(scriptExecutionContext, objectStoreName, mode, ec);
     if (ec.code)
         return nullptr;
-    return WTF::move(idbTransaction);
+    return idbTransaction;
 }
 
 static RefPtr<IDBObjectStore> objectStoreForTransaction(IDBTransaction* idbTransaction, const String& objectStoreName)
@@ -234,7 +234,7 @@ static RefPtr<IDBObjectStore> objectStoreForTransaction(IDBTransaction* idbTrans
     RefPtr<IDBObjectStore> idbObjectStore = idbTransaction->objectStore(objectStoreName, ec);
     if (ec.code)
         return nullptr;
-    return WTF::move(idbObjectStore);
+    return idbObjectStore;
 }
 
 static RefPtr<IDBIndex> indexForObjectStore(IDBObjectStore* idbObjectStore, const String& indexName)
@@ -243,7 +243,7 @@ static RefPtr<IDBIndex> indexForObjectStore(IDBObjectStore* idbObjectStore, cons
     RefPtr<IDBIndex> idbIndex = idbObjectStore->index(indexName, ec);
     if (ec.code)
         return nullptr;
-    return WTF::move(idbIndex);
+    return idbIndex;
 }
 
 static RefPtr<KeyPath> keyPathFromIDBKeyPath(const IDBKeyPath& idbKeyPath)
@@ -276,7 +276,7 @@ static RefPtr<KeyPath> keyPathFromIDBKeyPath(const IDBKeyPath& idbKeyPath)
         ASSERT_NOT_REACHED();
     }
 
-    return WTF::move(keyPath);
+    return keyPath;
 }
 
 class DatabaseLoader : public ExecutableWithDatabase {
index 6415afd..7044357 100644 (file)
@@ -196,7 +196,7 @@ Ref<Inspector::Protocol::LayerTree::Layer> InspectorLayerTreeAgent::buildObjectF
             layerObject->setPseudoElement("first-line");
     }
 
-    return WTF::move(layerObject);
+    return layerObject;
 }
 
 int InspectorLayerTreeAgent::idForNode(ErrorString& errorString, Node* node)
index f5fc6e6..ffe9230 100644 (file)
@@ -186,7 +186,7 @@ static Ref<InspectorObject> buildObjectForHeaders(const HTTPHeaderMap& headers)
     
     for (const auto& header : headers)
         headersObject->setString(header.key, header.value);
-    return WTF::move(headersObject);
+    return headersObject;
 }
 
 static Ref<Inspector::Protocol::Network::ResourceTiming> buildObjectForTiming(const ResourceLoadTiming& timing, DocumentLoader* loader)
@@ -212,7 +212,7 @@ static Ref<Inspector::Protocol::Network::Request> buildObjectForResourceRequest(
         .release();
     if (request.httpBody() && !request.httpBody()->isEmpty())
         requestObject->setPostData(request.httpBody()->flattenToString());
-    return WTF::move(requestObject);
+    return requestObject;
 }
 
 static RefPtr<Inspector::Protocol::Network::Response> buildObjectForResourceResponse(const ResourceResponse& response, DocumentLoader* loader)
@@ -252,7 +252,7 @@ static Ref<Inspector::Protocol::Network::CachedResource> buildObjectForCachedRes
     if (!sourceMappingURL.isEmpty())
         resourceObject->setSourceMapURL(sourceMappingURL);
 
-    return WTF::move(resourceObject);
+    return resourceObject;
 }
 
 InspectorNetworkAgent::~InspectorNetworkAgent()
index 8580d31..074721d 100644 (file)
@@ -372,7 +372,7 @@ static Ref<Inspector::Protocol::OverlayTypes::Quad> buildArrayForQuad(const Floa
     array->addItem(buildObjectForPoint(quad.p2()));
     array->addItem(buildObjectForPoint(quad.p3()));
     array->addItem(buildObjectForPoint(quad.p4()));
-    return WTF::move(array);
+    return array;
 }
 
 static Ref<Inspector::Protocol::OverlayTypes::FragmentHighlightData> buildObjectForHighlight(const Highlight& highlight)
@@ -450,7 +450,7 @@ static Ref<Inspector::Protocol::Array<Inspector::Protocol::OverlayTypes::Region>
         arrayOfRegions->addItem(WTF::move(regionObject));
     }
 
-    return WTF::move(arrayOfRegions);
+    return arrayOfRegions;
 }
 
 static Ref<Inspector::Protocol::OverlayTypes::Size> buildObjectForSize(const IntSize& size)
@@ -834,7 +834,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::OverlayTypes::NodeHighlightD
         }
     }
 
-    return WTF::move(highlights);
+    return highlights;
 }
 
 void InspectorOverlay::drawNodeHighlight()
index 0e00021..dc8fb09 100644 (file)
@@ -130,7 +130,7 @@ static RefPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeType,
         decoder = TextResourceDecoder::create("text/html", "UTF-8");
     else
         decoder = TextResourceDecoder::create("text/plain", "UTF-8");
-    return WTF::move(decoder);
+    return decoder;
 }
 
 bool InspectorPageAgent::cachedResourceContent(CachedResource* cachedResource, String* result, bool* base64Encoded)
@@ -443,7 +443,7 @@ static Ref<Inspector::Protocol::Array<Inspector::Protocol::Page::Cookie>> buildA
     for (const auto& cookie : cookiesList)
         cookies->addItem(buildObjectForCookie(cookie));
 
-    return WTF::move(cookies);
+    return cookies;
 }
 
 static Vector<CachedResource*> cachedResourcesForFrame(Frame* frame)
@@ -908,7 +908,7 @@ Ref<Inspector::Protocol::Page::Frame> InspectorPageAgent::buildObjectForFrame(Fr
         frameObject->setName(name);
     }
 
-    return WTF::move(frameObject);
+    return frameObject;
 }
 
 Ref<Inspector::Protocol::Page::FrameResourceTree> InspectorPageAgent::buildObjectForFrameTree(Frame* frame)
index 64b1d45..3f5b41a 100644 (file)
@@ -183,7 +183,7 @@ static Ref<Inspector::Protocol::CSS::CSSMedia> buildMediaObject(const MediaList*
         mediaObject->setSourceURL(sourceURL);
         mediaObject->setSourceLine(media->queries()->lastLine());
     }
-    return WTF::move(mediaObject);
+    return mediaObject;
 }
 
 static RefPtr<CSSRuleList> asCSSRuleList(CSSStyleSheet* styleSheet)
@@ -327,7 +327,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSComputedStylePropert
         result->addItem(WTF::move(entry));
     }
 
-    return WTF::move(result);
+    return result;
 }
 
 bool InspectorStyle::getText(String* result) const
@@ -875,7 +875,7 @@ static Ref<Inspector::Protocol::CSS::CSSSelector> buildObjectForSelectorHelper(c
         }
     }
 
-    return WTF::move(inspectorSelector);
+    return inspectorSelector;
 }
 
 static Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSSelector>> selectorsFromSource(const CSSRuleSourceData* sourceData, const String& sheetText, const CSSSelectorList& selectorList, Element* element)
@@ -899,7 +899,7 @@ static Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSSelector>> se
 
         selector = CSSSelectorList::next(selector);
     }
-    return WTF::move(result);
+    return result;
 }
 
 Ref<Inspector::Protocol::CSS::CSSSelector> InspectorStyleSheet::buildObjectForSelector(const CSSSelector* selector, Element* element)
@@ -931,7 +931,7 @@ Ref<Inspector::Protocol::CSS::SelectorList> InspectorStyleSheet::buildObjectForS
         .release();
     if (sourceData)
         result->setRange(buildSourceRangeObject(sourceData->ruleHeaderRange, lineEndings().get()));
-    return WTF::move(result);
+    return result;
 }
 
 RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorStyleSheet::buildObjectForRule(CSSStyleRule* rule, Element* element)
@@ -992,7 +992,7 @@ RefPtr<Inspector::Protocol::CSS::CSSStyle> InspectorStyleSheet::buildObjectForSt
         }
     }
 
-    return WTF::move(result);
+    return result;
 }
 
 bool InspectorStyleSheet::setStyleText(const InspectorCSSId& id, const String& text, String* oldText, ExceptionCode& ec)
@@ -1231,7 +1231,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSRule>> InspectorStyl
 {
     auto result = Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSRule>::create();
     if (!ruleList)
-        return WTF::move(result);
+        return result;
 
     RefPtr<CSSRuleList> refRuleList = ruleList;
     CSSStyleRuleVector rules;
@@ -1240,7 +1240,7 @@ Ref<Inspector::Protocol::Array<Inspector::Protocol::CSS::CSSRule>> InspectorStyl
     for (auto& rule : rules)
         result->addItem(buildObjectForRule(rule.get(), nullptr));
 
-    return WTF::move(result);
+    return result;
 }
 
 void InspectorStyleSheet::collectFlatRules(RefPtr<CSSRuleList>&& ruleList, CSSStyleRuleVector* result)
index d86ad13..52e5a6e 100644 (file)
@@ -266,7 +266,7 @@ RefPtr<JSC::Profile> InspectorTimelineAgent::stopFromConsole(JSC::ExecState* exe
             if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
                 internalStop();
 
-            return WTF::move(profile);
+            return profile;
         }
     }
 
index 09deeec..897b11a 100644 (file)
@@ -55,7 +55,7 @@ Ref<InspectorObject> TimelineRecordFactory::createGenericRecord(double startTime
         if (stackTrace && stackTrace->size())
             record->setValue(ASCIILiteral("stackTrace"), stackTrace->buildInspectorArray());
     }
-    return WTF::move(record);
+    return record;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine)
@@ -63,14 +63,14 @@ Ref<InspectorObject> TimelineRecordFactory::createFunctionCallData(const String&
     Ref<InspectorObject> data = InspectorObject::create();
     data->setString(ASCIILiteral("scriptName"), scriptName);
     data->setInteger(ASCIILiteral("scriptLine"), scriptLine);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createConsoleProfileData(const String& title)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setString(ASCIILiteral("title"), title);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createProbeSampleData(const ScriptBreakpointAction& action, unsigned sampleId)
@@ -78,21 +78,21 @@ Ref<InspectorObject> TimelineRecordFactory::createProbeSampleData(const ScriptBr
     Ref<InspectorObject> data = InspectorObject::create();
     data->setInteger(ASCIILiteral("probeId"), action.identifier);
     data->setInteger(ASCIILiteral("sampleId"), sampleId);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createEventDispatchData(const Event& event)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setString(ASCIILiteral("type"), event.type().string());
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createGenericTimerData(int timerId)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setInteger(ASCIILiteral("timerId"), timerId);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId, int timeout, bool singleShot)
@@ -101,7 +101,7 @@ Ref<InspectorObject> TimelineRecordFactory::createTimerInstallData(int timerId,
     data->setInteger(ASCIILiteral("timerId"), timerId);
     data->setInteger(ASCIILiteral("timeout"), timeout);
     data->setBoolean(ASCIILiteral("singleShot"), singleShot);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber)
@@ -109,21 +109,21 @@ Ref<InspectorObject> TimelineRecordFactory::createEvaluateScriptData(const Strin
     Ref<InspectorObject> data = InspectorObject::create();
     data->setString(ASCIILiteral("url"), url);
     data->setInteger(ASCIILiteral("lineNumber"), lineNumber);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createTimeStampData(const String& message)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setString(ASCIILiteral("message"), message);
-    return WTF::move(data);
+    return data;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createAnimationFrameData(int callbackId)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setInteger(ASCIILiteral("id"), callbackId);
-    return WTF::move(data);
+    return data;
 }
 
 static Ref<InspectorArray> createQuad(const FloatQuad& quad)
@@ -137,14 +137,14 @@ static Ref<InspectorArray> createQuad(const FloatQuad& quad)
     array->pushDouble(quad.p3().y());
     array->pushDouble(quad.p4().x());
     array->pushDouble(quad.p4().y());
-    return WTF::move(array);
+    return array;
 }
 
 Ref<InspectorObject> TimelineRecordFactory::createPaintData(const FloatQuad& quad)
 {
     Ref<InspectorObject> data = InspectorObject::create();
     data->setArray(ASCIILiteral("clip"), createQuad(quad));
-    return WTF::move(data);
+    return data;
 }
 
 void TimelineRecordFactory::appendLayoutRoot(InspectorObject* data, const FloatQuad& quad)
@@ -192,7 +192,7 @@ static Ref<Protocol::Timeline::CPUProfileNode> buildInspectorObject(const JSC::P
         result->setChildren(WTF::move(children));
     }
 
-    return WTF::move(result);
+    return result;
 }
 
 static Ref<Protocol::Timeline::CPUProfile> buildProfileInspectorObject(const JSC::Profile* profile)
index 900dd38..b4563ed 100644 (file)
@@ -3523,7 +3523,7 @@ RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, const FrameLo
                 if (Page* page = frame->page())
                     page->chrome().focus();
             }
-            return WTF::move(frame);
+            return frame;
         }
     }
 
@@ -3615,7 +3615,7 @@ RefPtr<Frame> createWindow(Frame& openerFrame, Frame& lookupFrame, const FrameLo
     page->chrome().show();
 
     created = true;
-    return WTF::move(frame);
+    return frame;
 }
 
 } // namespace WebCore
index 7c10dcf..66f431d 100644 (file)
@@ -106,7 +106,7 @@ NavigationAction NavigationAction::copyWithShouldOpenExternalURLsPolicy(ShouldOp
 {
     NavigationAction result(*this);
     result.m_shouldOpenExternalURLsPolicy = shouldOpenExternalURLsPolicy;
-    return WTF::move(result);
+    return result;
 }
 
 }
index 1e9c708..5f1e732 100644 (file)
@@ -2128,7 +2128,7 @@ RefPtr<Frame> DOMWindow::createWindow(const String& urlString, const AtomicStrin
     newFrame->page()->setOpenedByDOM();
 
     if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
-        return WTF::move(newFrame);
+        return newFrame;
 
     if (prepareDialogFunction)
         prepareDialogFunction(*newFrame->document()->domWindow());
@@ -2146,7 +2146,7 @@ RefPtr<Frame> DOMWindow::createWindow(const String& urlString, const AtomicStrin
     if (!newFrame->page())
         return nullptr;
 
-    return WTF::move(newFrame);
+    return newFrame;
 }
 
 PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
index 96f50df..419d7fd 100644 (file)
@@ -403,7 +403,7 @@ std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceHandle* handle,
 
     std::unique_ptr<QuickLookHandle> quickLookHandle(new QuickLookHandle([handle->firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], connection, nsResponse, delegate));
     handle->client()->didCreateQuickLookHandle(*quickLookHandle);
-    return WTF::move(quickLookHandle);
+    return quickLookHandle;
 }
 
 #if USE(CFNETWORK)
@@ -417,7 +417,7 @@ std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceHandle* handle,
     WebQuickLookHandleAsDelegate *delegate = [[[WebQuickLookHandleAsDelegate alloc] initWithConnectionDelegate:connectionDelegate] autorelease];
     std::unique_ptr<QuickLookHandle> quickLookHandle(new QuickLookHandle([handle->firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], nil, nsResponse, delegate));
     handle->client()->didCreateQuickLookHandle(*quickLookHandle);
-    return WTF::move(quickLookHandle);
+    return quickLookHandle;
 }
 
 CFURLResponseRef QuickLookHandle::cfResponse()
@@ -439,7 +439,7 @@ std::unique_ptr<QuickLookHandle> QuickLookHandle::create(ResourceLoader& loader,
     std::unique_ptr<QuickLookHandle> quickLookHandle(new QuickLookHandle([loader.originalRequest().nsURLRequest(DoNotUpdateHTTPBody) URL], nil, response.nsURLResponse(), delegate.get()));
     [delegate setQuickLookHandle:quickLookHandle.get()];
     loader.didCreateQuickLookHandle(*quickLookHandle);
-    return WTF::move(quickLookHandle);
+    return quickLookHandle;
 }
 
 NSURLResponse *QuickLookHandle::nsResponse()
index d3753a3..43344c8 100644 (file)
@@ -1801,7 +1801,7 @@ RefPtr<DOMWindow> Internals::openDummyInspectorFrontend(const String& url)
     RefPtr<DOMWindow> frontendWindow = window->open(url, "", "", *window, *window);
     m_inspectorFrontend = std::make_unique<InspectorStubFrontend>(inspectedPage, frontendWindow.copyRef());
 
-    return WTF::move(frontendWindow);
+    return frontendWindow;
 }
 
 void Internals::closeDummyInspectorFrontend()
index 964a0aa..3719469 100644 (file)
@@ -101,7 +101,7 @@ std::unique_ptr<ResourceRequest> WorkerScriptLoader::createResourceRequest()
 {
     auto request = std::make_unique<ResourceRequest>(m_url);
     request->setHTTPMethod("GET");
-    return WTF::move(request);
+    return request;
 }
     
 void WorkerScriptLoader::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
index fdfb8ae..31b9906 100644 (file)
@@ -87,7 +87,7 @@ RefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned short
             return nullptr;
     }
 
-    return WTF::move(result);
+    return result;
 }
 
 }
index c354a40..f36cc19 100644 (file)
@@ -1,3 +1,18 @@
+2015-12-25  Andy Estes  <aestes@apple.com>
+
+        Stop moving local objects in return statements
+        https://bugs.webkit.org/show_bug.cgi?id=152557
+
+        Reviewed by Brady Eidson.
+
+        Calling std::move() on a local object in a return statement prevents the compiler from applying the return value optimization.
+
+        Clang can warn about these mistakes with -Wpessimizing-move, although only when std::move() is called directly.
+        I found these issues by temporarily replacing WTF::move with std::move and recompiling.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::ExceededDatabaseQuotaRecords::createRecord):
+
 2015-12-26  Joonghun Park  <jh718.park@samsung.com>
 
         [WK2][EFL] Use eina_file_path_join at platformDefaultIconDatabasePath in WebProcessPoolEfl
index 592aa11..83dd3f1 100644 (file)
@@ -239,7 +239,7 @@ std::unique_ptr<ExceededDatabaseQuotaRecords::Record> ExceededDatabaseQuotaRecor
     record->currentDatabaseUsage = currentDatabaseUsage;
     record->expectedUsage = expectedUsage;
     record->reply = reply;
-    return WTF::move(record);
+    return record;
 }
 
 void ExceededDatabaseQuotaRecords::add(std::unique_ptr<ExceededDatabaseQuotaRecords::Record> record)