Diff
Modified: trunk/Source/WTF/wtf/Scope.h (224017 => 224018)
--- trunk/Source/WTF/wtf/Scope.h 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WTF/wtf/Scope.h 2017-10-26 14:06:26 UTC (rev 224018)
@@ -37,7 +37,7 @@
public:
template<typename ExitFunctionParameter>
explicit ScopeExit(ExitFunctionParameter&& exitFunction)
- : m_exitFunction(std::forward<ExitFunction>(exitFunction))
+ : m_exitFunction(WTFMove(exitFunction))
{
}
Modified: trunk/Source/WebCore/ChangeLog (224017 => 224018)
--- trunk/Source/WebCore/ChangeLog 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/ChangeLog 2017-10-26 14:06:26 UTC (rev 224018)
@@ -1,3 +1,22 @@
+2017-10-26 Christopher Reid <[email protected]>
+
+ Remove scopeguard from platform
+ https://bugs.webkit.org/show_bug.cgi?id=178681
+
+ Reviewed by Brady Eidson.
+
+ Replacing platform/ScopeGuard with WTF::ScopeExit.
+ No new tests, no change in behavior.
+
+ * Modules/indexeddb/IDBRequest.cpp:
+ * Modules/indexeddb/IDBRequest.h:
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/FileSystem.cpp:
+ * platform/ScopeGuard.h: Removed.
+ * platform/network/BlobRegistryImpl.cpp:
+ * workers/service/ServiceWorkerContainer.cpp:
+
2017-10-26 Carlos Garcia Campos <[email protected]>
REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (224017 => 224018)
--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -45,10 +45,10 @@
#include "JSDOMConvertNumbers.h"
#include "JSDOMConvertSequences.h"
#include "Logging.h"
-#include "ScopeGuard.h"
#include "ScriptExecutionContext.h"
#include "ThreadSafeDataBuffer.h"
#include <heap/StrongInlines.h>
+#include <wtf/Scope.h>
#include <wtf/Variant.h>
@@ -177,7 +177,7 @@
ASSERT(!m_cursorRequestNotifier);
m_source = Source { &cursor };
- m_cursorRequestNotifier = std::make_unique<ScopeGuard>([this]() {
+ m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() {
ASSERT(WTF::holds_alternative<RefPtr<IDBCursor>>(m_source.value()));
WTF::get<RefPtr<IDBCursor>>(m_source.value())->decrementOutstandingRequestCount();
});
@@ -487,7 +487,7 @@
m_domError = nullptr;
m_idbError = IDBError { };
- m_cursorRequestNotifier = std::make_unique<ScopeGuard>([this]() {
+ m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() {
m_pendingCursor->decrementOutstandingRequestCount();
});
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (224017 => 224018)
--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h 2017-10-26 14:06:26 UTC (rev 224018)
@@ -34,6 +34,8 @@
#include "IDBResourceIdentifier.h"
#include "IndexedDB.h"
#include <heap/Strong.h>
+#include <wtf/Function.h>
+#include <wtf/Scope.h>
namespace WebCore {
@@ -47,7 +49,6 @@
class IDBResultData;
class IDBTransaction;
class IDBValue;
-class ScopeGuard;
class ThreadSafeDataBuffer;
namespace IDBClient {
@@ -170,7 +171,7 @@
RefPtr<IDBCursor> m_pendingCursor;
- std::unique_ptr<ScopeGuard> m_cursorRequestNotifier;
+ std::unique_ptr<WTF::ScopeExit<WTF::Function<void()>>> m_cursorRequestNotifier;
Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
};
Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (224017 => 224018)
--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -40,7 +40,6 @@
#include "IDBTransactionInfo.h"
#include "IDBValue.h"
#include "Logging.h"
-#include "ScopeGuard.h"
#include "SerializedScriptValue.h"
#include "UniqueIDBDatabaseConnection.h"
#include <heap/HeapInlines.h>
@@ -49,6 +48,7 @@
#include <runtime/StructureInlines.h>
#include <wtf/MainThread.h>
#include <wtf/NeverDestroyed.h>
+#include <wtf/Scope.h>
namespace WebCore {
@@ -984,9 +984,12 @@
}
bool usedKeyIsGenerated = false;
- ScopeGuard generatedKeyResetter;
+ uint64_t keyNumber;
+ auto generatedKeyResetter = WTF::makeScopeExit([this, transactionIdentifier, objectStoreIdentifier, &keyNumber, &usedKeyIsGenerated]() {
+ if (usedKeyIsGenerated)
+ m_backingStore->revertGeneratedKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber);
+ });
if (objectStoreInfo->autoIncrement() && !keyData.isValid()) {
- uint64_t keyNumber;
error = m_backingStore->generateKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber);
if (!error.isNull()) {
postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, error, usedKey));
@@ -995,9 +998,6 @@
usedKey.setNumberValue(keyNumber);
usedKeyIsGenerated = true;
- generatedKeyResetter.enable([this, transactionIdentifier, objectStoreIdentifier, keyNumber]() {
- m_backingStore->revertGeneratedKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber);
- });
} else
usedKey = keyData;
@@ -1065,7 +1065,7 @@
if (overwriteMode != IndexedDB::ObjectStoreOverwriteMode::OverwriteForCursor && objectStoreInfo->autoIncrement() && keyData.type() == IndexedDB::KeyType::Number)
error = m_backingStore->maybeUpdateKeyGeneratorNumber(transactionIdentifier, objectStoreIdentifier, keyData.number());
- generatedKeyResetter.disable();
+ generatedKeyResetter.release();
postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, error, usedKey));
}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (224017 => 224018)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-10-26 14:06:26 UTC (rev 224018)
@@ -1364,7 +1364,6 @@
51327D6011A33A2B004F9D65 /* SinkDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 51327D5E11A33A2B004F9D65 /* SinkDocument.h */; };
513F14540AB634C400094DDF /* IconLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 513F14520AB634C400094DDF /* IconLoader.h */; };
51405C89190B014400754F94 /* SelectionRectGatherer.h in Headers */ = {isa = PBXBuildFile; fileRef = 51405C87190B014400754F94 /* SelectionRectGatherer.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 514129901C601ACC0059E714 /* ScopeGuard.h in Headers */ = {isa = PBXBuildFile; fileRef = 5141298F1C601A890059E714 /* ScopeGuard.h */; settings = {ATTRIBUTES = (Private, ); }; };
514129991C6976900059E714 /* IDBRequestCompletionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 514129971C6976150059E714 /* IDBRequestCompletionEvent.h */; };
5143B2631DDD15200014FAC6 /* LinkIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5143B2621DDD14900014FAC6 /* LinkIcon.h */; settings = {ATTRIBUTES = (Private, ); }; };
5145B10A1BC48E2E00E86219 /* IDBResourceIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 5145B1081BC4890B00E86219 /* IDBResourceIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7691,7 +7690,6 @@
51405C86190B014400754F94 /* SelectionRectGatherer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectionRectGatherer.cpp; sourceTree = "<group>"; };
51405C87190B014400754F94 /* SelectionRectGatherer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRectGatherer.h; sourceTree = "<group>"; };
5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBCursorWithValueCustom.cpp; sourceTree = "<group>"; };
- 5141298F1C601A890059E714 /* ScopeGuard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeGuard.h; sourceTree = "<group>"; };
514129961C6976150059E714 /* IDBRequestCompletionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBRequestCompletionEvent.cpp; sourceTree = "<group>"; };
514129971C6976150059E714 /* IDBRequestCompletionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRequestCompletionEvent.h; sourceTree = "<group>"; };
5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBIndexCustom.cpp; sourceTree = "<group>"; };
@@ -23523,7 +23521,6 @@
293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */,
5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
- 5141298F1C601A890059E714 /* ScopeGuard.h */,
BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */,
BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */,
CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */,
@@ -28811,7 +28808,6 @@
5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */,
5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */,
- 514129901C601ACC0059E714 /* ScopeGuard.h in Headers */,
BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */,
A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */,
41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */,
Modified: trunk/Source/WebCore/platform/FileSystem.cpp (224017 => 224018)
--- trunk/Source/WebCore/platform/FileSystem.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/platform/FileSystem.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -28,8 +28,8 @@
#include "FileSystem.h"
#include "FileMetadata.h"
-#include "ScopeGuard.h"
#include <wtf/HexNumber.h>
+#include <wtf/Scope.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
@@ -213,7 +213,7 @@
static int bufferSize = 1 << 19;
Vector<char> buffer(bufferSize);
- ScopeGuard fileCloser([source]() {
+ auto fileCloser = WTF::makeScopeExit([source]() {
PlatformFileHandle handle = source;
closeFile(handle);
});
Deleted: trunk/Source/WebCore/platform/ScopeGuard.h (224017 => 224018)
--- trunk/Source/WebCore/platform/ScopeGuard.h 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/platform/ScopeGuard.h 2017-10-26 14:06:26 UTC (rev 224018)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef ScopeGuard_h
-#define ScopeGuard_h
-
-#include <wtf/Function.h>
-
-namespace WebCore {
-
-class ScopeGuard {
-public:
- ScopeGuard()
- {
- }
-
- ScopeGuard(WTF::Function<void()>&& function)
- : m_function(WTFMove(function))
- {
- }
-
- ~ScopeGuard()
- {
- if (m_function)
- m_function();
- }
-
- void enable(WTF::Function<void()>&& function)
- {
- m_function = WTFMove(function);
- }
-
- void disable()
- {
- m_function = nullptr;
- }
-
-private:
- WTF::Function<void()> m_function;
-};
-
-} // namespace WebCore
-
-#endif // ScopeGuard_h
Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (224017 => 224018)
--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -41,9 +41,9 @@
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
-#include "ScopeGuard.h"
#include <wtf/MainThread.h>
#include <wtf/NeverDestroyed.h>
+#include <wtf/Scope.h>
#include <wtf/StdLibExtras.h>
#include <wtf/WorkQueue.h>
@@ -286,7 +286,7 @@
PlatformFileHandle file;
String tempFilePath = openTemporaryFile(ASCIILiteral("Blob"), file);
- ScopeGuard fileCloser([file]() mutable {
+ auto fileCloser = WTF::makeScopeExit([file]() mutable {
closeFile(file);
});
Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp (224017 => 224018)
--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -35,7 +35,6 @@
#include "Logging.h"
#include "NavigatorBase.h"
#include "ResourceError.h"
-#include "ScopeGuard.h"
#include "ScriptExecutionContext.h"
#include "SecurityOrigin.h"
#include "ServiceWorker.h"
@@ -44,6 +43,7 @@
#include "ServiceWorkerProvider.h"
#include "URL.h"
#include <wtf/RunLoop.h>
+#include <wtf/Scope.h>
namespace WebCore {
@@ -202,7 +202,7 @@
void ServiceWorkerContainer::jobResolvedWithRegistration(ServiceWorkerJob& job, ServiceWorkerRegistrationData&& data)
{
- ScopeGuard guard([this, &job] {
+ auto guard = WTF::makeScopeExit([this, &job] {
jobDidFinish(job);
});
@@ -221,7 +221,7 @@
void ServiceWorkerContainer::jobResolvedWithUnregistrationResult(ServiceWorkerJob& job, bool unregistrationResult)
{
- ScopeGuard guard([this, &job] {
+ auto guard = WTF::makeScopeExit([this, &job] {
jobDidFinish(job);
});
Modified: trunk/Source/WebKit/ChangeLog (224017 => 224018)
--- trunk/Source/WebKit/ChangeLog 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebKit/ChangeLog 2017-10-26 14:06:26 UTC (rev 224018)
@@ -1,3 +1,12 @@
+2017-10-26 Christopher Reid <[email protected]>
+
+ Remove scopeguard from platform
+ https://bugs.webkit.org/show_bug.cgi?id=178681
+
+ Reviewed by Brady Eidson.
+
+ * Shared/mac/ChildProcessMac.mm:
+
2017-10-25 Per Arne Vollan <[email protected]>
Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
Modified: trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm (224017 => 224018)
--- trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm 2017-10-26 14:06:26 UTC (rev 224018)
@@ -33,7 +33,6 @@
#import "QuarantineSPI.h"
#import "SandboxInitializationParameters.h"
#import <WebCore/FileSystem.h>
-#import <WebCore/ScopeGuard.h>
#import <WebCore/SystemVersion.h>
#import <mach/mach.h>
#import <mach/task.h>
@@ -41,6 +40,7 @@
#import <pwd.h>
#import <stdlib.h>
#import <sysexits.h>
+#import <wtf/Scope.h>
#import <wtf/spi/darwin/SandboxSPI.h>
#if USE(APPLE_INTERNAL_SDK)
@@ -84,7 +84,7 @@
{
int error;
qtn_proc_t quarantineProperties = qtn_proc_alloc();
- ScopeGuard quarantinePropertiesDeleter([quarantineProperties]() {
+ auto quarantinePropertiesDeleter = makeScopeExit([quarantineProperties]() {
qtn_proc_free(quarantineProperties);
});
Modified: trunk/Tools/ChangeLog (224017 => 224018)
--- trunk/Tools/ChangeLog 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Tools/ChangeLog 2017-10-26 14:06:26 UTC (rev 224018)
@@ -1,3 +1,12 @@
+2017-10-26 Christopher Reid <[email protected]>
+
+ Remove scopeguard from platform
+ https://bugs.webkit.org/show_bug.cgi?id=178681
+
+ Reviewed by Brady Eidson.
+
+ * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
+
2017-09-21 Carlos Garcia Campos <[email protected]>
WebDriver: Add support to import and run W3C tests
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp (224017 => 224018)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp 2017-10-26 13:14:00 UTC (rev 224017)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp 2017-10-26 14:06:26 UTC (rev 224018)
@@ -30,9 +30,9 @@
#include "WTFStringUtilities.h"
#include <WebCore/FileMonitor.h>
#include <WebCore/FileSystem.h>
-#include <WebCore/ScopeGuard.h>
#include <wtf/MainThread.h>
#include <wtf/RunLoop.h>
+#include <wtf/Scope.h>
#include <wtf/StringExtras.h>
#include <wtf/WorkQueue.h>
#include <wtf/text/StringBuffer.h>
@@ -120,7 +120,7 @@
StringBuffer<LChar> buffer(bufferSize);
- ScopeGuard fileCloser([source]() {
+ auto fileCloser = WTF::makeScopeExit([source]() {
PlatformFileHandle handle = source;
closeFile(handle);
});