Changeset 224018 in webkit
- Timestamp:
- Oct 26, 2017 7:06:26 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/Scope.h
r204538 r224018 38 38 template<typename ExitFunctionParameter> 39 39 explicit ScopeExit(ExitFunctionParameter&& exitFunction) 40 : m_exitFunction( std::forward<ExitFunction>(exitFunction))40 : m_exitFunction(WTFMove(exitFunction)) 41 41 { 42 42 } -
trunk/Source/WebCore/ChangeLog
r224015 r224018 1 2017-10-26 Christopher Reid <chris.reid@sony.com> 2 3 Remove scopeguard from platform 4 https://bugs.webkit.org/show_bug.cgi?id=178681 5 6 Reviewed by Brady Eidson. 7 8 Replacing platform/ScopeGuard with WTF::ScopeExit. 9 No new tests, no change in behavior. 10 11 * Modules/indexeddb/IDBRequest.cpp: 12 * Modules/indexeddb/IDBRequest.h: 13 * Modules/indexeddb/server/UniqueIDBDatabase.cpp: 14 * WebCore.xcodeproj/project.pbxproj: 15 * platform/FileSystem.cpp: 16 * platform/ScopeGuard.h: Removed. 17 * platform/network/BlobRegistryImpl.cpp: 18 * workers/service/ServiceWorkerContainer.cpp: 19 1 20 2017-10-26 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r223476 r224018 46 46 #include "JSDOMConvertSequences.h" 47 47 #include "Logging.h" 48 #include "ScopeGuard.h"49 48 #include "ScriptExecutionContext.h" 50 49 #include "ThreadSafeDataBuffer.h" 51 50 #include <heap/StrongInlines.h> 51 #include <wtf/Scope.h> 52 52 #include <wtf/Variant.h> 53 53 … … 178 178 179 179 m_source = Source { &cursor }; 180 m_cursorRequestNotifier = std::make_unique< ScopeGuard>([this]() {180 m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() { 181 181 ASSERT(WTF::holds_alternative<RefPtr<IDBCursor>>(m_source.value())); 182 182 WTF::get<RefPtr<IDBCursor>>(m_source.value())->decrementOutstandingRequestCount(); … … 488 488 m_idbError = IDBError { }; 489 489 490 m_cursorRequestNotifier = std::make_unique< ScopeGuard>([this]() {490 m_cursorRequestNotifier = std::make_unique<WTF::ScopeExit<WTF::Function<void()>>>([this]() { 491 491 m_pendingCursor->decrementOutstandingRequestCount(); 492 492 }); -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h
r222250 r224018 35 35 #include "IndexedDB.h" 36 36 #include <heap/Strong.h> 37 #include <wtf/Function.h> 38 #include <wtf/Scope.h> 37 39 38 40 namespace WebCore { … … 48 50 class IDBTransaction; 49 51 class IDBValue; 50 class ScopeGuard;51 52 class ThreadSafeDataBuffer; 52 53 … … 171 172 RefPtr<IDBCursor> m_pendingCursor; 172 173 173 std::unique_ptr< ScopeGuard> m_cursorRequestNotifier;174 std::unique_ptr<WTF::ScopeExit<WTF::Function<void()>>> m_cursorRequestNotifier; 174 175 175 176 Ref<IDBClient::IDBConnectionProxy> m_connectionProxy; -
trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp
r223476 r224018 41 41 #include "IDBValue.h" 42 42 #include "Logging.h" 43 #include "ScopeGuard.h"44 43 #include "SerializedScriptValue.h" 45 44 #include "UniqueIDBDatabaseConnection.h" … … 50 49 #include <wtf/MainThread.h> 51 50 #include <wtf/NeverDestroyed.h> 51 #include <wtf/Scope.h> 52 52 53 53 … … 985 985 986 986 bool usedKeyIsGenerated = false; 987 ScopeGuard generatedKeyResetter; 987 uint64_t keyNumber; 988 auto generatedKeyResetter = WTF::makeScopeExit([this, transactionIdentifier, objectStoreIdentifier, &keyNumber, &usedKeyIsGenerated]() { 989 if (usedKeyIsGenerated) 990 m_backingStore->revertGeneratedKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber); 991 }); 988 992 if (objectStoreInfo->autoIncrement() && !keyData.isValid()) { 989 uint64_t keyNumber;990 993 error = m_backingStore->generateKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber); 991 994 if (!error.isNull()) { … … 996 999 usedKey.setNumberValue(keyNumber); 997 1000 usedKeyIsGenerated = true; 998 generatedKeyResetter.enable([this, transactionIdentifier, objectStoreIdentifier, keyNumber]() {999 m_backingStore->revertGeneratedKeyNumber(transactionIdentifier, objectStoreIdentifier, keyNumber);1000 });1001 1001 } else 1002 1002 usedKey = keyData; … … 1066 1066 error = m_backingStore->maybeUpdateKeyGeneratorNumber(transactionIdentifier, objectStoreIdentifier, keyData.number()); 1067 1067 1068 generatedKeyResetter. disable();1068 generatedKeyResetter.release(); 1069 1069 postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, error, usedKey)); 1070 1070 } -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r224009 r224018 1365 1365 513F14540AB634C400094DDF /* IconLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 513F14520AB634C400094DDF /* IconLoader.h */; }; 1366 1366 51405C89190B014400754F94 /* SelectionRectGatherer.h in Headers */ = {isa = PBXBuildFile; fileRef = 51405C87190B014400754F94 /* SelectionRectGatherer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1367 514129901C601ACC0059E714 /* ScopeGuard.h in Headers */ = {isa = PBXBuildFile; fileRef = 5141298F1C601A890059E714 /* ScopeGuard.h */; settings = {ATTRIBUTES = (Private, ); }; };1368 1367 514129991C6976900059E714 /* IDBRequestCompletionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 514129971C6976150059E714 /* IDBRequestCompletionEvent.h */; }; 1369 1368 5143B2631DDD15200014FAC6 /* LinkIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 5143B2621DDD14900014FAC6 /* LinkIcon.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 7692 7691 51405C87190B014400754F94 /* SelectionRectGatherer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectionRectGatherer.h; sourceTree = "<group>"; }; 7693 7692 5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBCursorWithValueCustom.cpp; sourceTree = "<group>"; }; 7694 5141298F1C601A890059E714 /* ScopeGuard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScopeGuard.h; sourceTree = "<group>"; };7695 7693 514129961C6976150059E714 /* IDBRequestCompletionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBRequestCompletionEvent.cpp; sourceTree = "<group>"; }; 7696 7694 514129971C6976150059E714 /* IDBRequestCompletionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRequestCompletionEvent.h; sourceTree = "<group>"; }; … … 23524 23522 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */, 23525 23523 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */, 23526 5141298F1C601A890059E714 /* ScopeGuard.h */,23527 23524 BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */, 23528 23525 BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */, … … 28812 28809 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */, 28813 28810 9BD0BF9312A42BF50072FD43 /* ScopedEventQueue.h in Headers */, 28814 514129901C601ACC0059E714 /* ScopeGuard.h in Headers */,28815 28811 BCEC01BE0C274DAC009F4EC9 /* Screen.h in Headers */, 28816 28812 A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */, -
trunk/Source/WebCore/platform/FileSystem.cpp
r221558 r224018 29 29 30 30 #include "FileMetadata.h" 31 #include "ScopeGuard.h"32 31 #include <wtf/HexNumber.h> 32 #include <wtf/Scope.h> 33 33 #include <wtf/text/CString.h> 34 34 #include <wtf/text/StringBuilder.h> … … 214 214 Vector<char> buffer(bufferSize); 215 215 216 ScopeGuard fileCloser([source]() {216 auto fileCloser = WTF::makeScopeExit([source]() { 217 217 PlatformFileHandle handle = source; 218 218 closeFile(handle); -
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp
r223728 r224018 42 42 #include "ResourceRequest.h" 43 43 #include "ResourceResponse.h" 44 #include "ScopeGuard.h"45 44 #include <wtf/MainThread.h> 46 45 #include <wtf/NeverDestroyed.h> 46 #include <wtf/Scope.h> 47 47 #include <wtf/StdLibExtras.h> 48 48 #include <wtf/WorkQueue.h> … … 287 287 String tempFilePath = openTemporaryFile(ASCIILiteral("Blob"), file); 288 288 289 ScopeGuard fileCloser([file]() mutable {289 auto fileCloser = WTF::makeScopeExit([file]() mutable { 290 290 closeFile(file); 291 291 }); -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r223964 r224018 36 36 #include "NavigatorBase.h" 37 37 #include "ResourceError.h" 38 #include "ScopeGuard.h"39 38 #include "ScriptExecutionContext.h" 40 39 #include "SecurityOrigin.h" … … 45 44 #include "URL.h" 46 45 #include <wtf/RunLoop.h> 46 #include <wtf/Scope.h> 47 47 48 48 namespace WebCore { … … 203 203 void ServiceWorkerContainer::jobResolvedWithRegistration(ServiceWorkerJob& job, ServiceWorkerRegistrationData&& data) 204 204 { 205 ScopeGuard guard([this, &job] {205 auto guard = WTF::makeScopeExit([this, &job] { 206 206 jobDidFinish(job); 207 207 }); … … 222 222 void ServiceWorkerContainer::jobResolvedWithUnregistrationResult(ServiceWorkerJob& job, bool unregistrationResult) 223 223 { 224 ScopeGuard guard([this, &job] {224 auto guard = WTF::makeScopeExit([this, &job] { 225 225 jobDidFinish(job); 226 226 }); -
trunk/Source/WebKit/ChangeLog
r223993 r224018 1 2017-10-26 Christopher Reid <chris.reid@sony.com> 2 3 Remove scopeguard from platform 4 https://bugs.webkit.org/show_bug.cgi?id=178681 5 6 Reviewed by Brady Eidson. 7 8 * Shared/mac/ChildProcessMac.mm: 9 1 10 2017-10-25 Per Arne Vollan <pvollan@apple.com> 2 11 -
trunk/Source/WebKit/Shared/mac/ChildProcessMac.mm
r222896 r224018 34 34 #import "SandboxInitializationParameters.h" 35 35 #import <WebCore/FileSystem.h> 36 #import <WebCore/ScopeGuard.h>37 36 #import <WebCore/SystemVersion.h> 38 37 #import <mach/mach.h> … … 42 41 #import <stdlib.h> 43 42 #import <sysexits.h> 43 #import <wtf/Scope.h> 44 44 #import <wtf/spi/darwin/SandboxSPI.h> 45 45 … … 85 85 int error; 86 86 qtn_proc_t quarantineProperties = qtn_proc_alloc(); 87 ScopeGuard quarantinePropertiesDeleter([quarantineProperties]() {87 auto quarantinePropertiesDeleter = makeScopeExit([quarantineProperties]() { 88 88 qtn_proc_free(quarantineProperties); 89 89 }); -
trunk/Tools/ChangeLog
r224014 r224018 1 2017-10-26 Christopher Reid <chris.reid@sony.com> 2 3 Remove scopeguard from platform 4 https://bugs.webkit.org/show_bug.cgi?id=178681 5 6 Reviewed by Brady Eidson. 7 8 * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp: 9 1 10 2017-09-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 11 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp
r222962 r224018 31 31 #include <WebCore/FileMonitor.h> 32 32 #include <WebCore/FileSystem.h> 33 #include <WebCore/ScopeGuard.h>34 33 #include <wtf/MainThread.h> 35 34 #include <wtf/RunLoop.h> 35 #include <wtf/Scope.h> 36 36 #include <wtf/StringExtras.h> 37 37 #include <wtf/WorkQueue.h> … … 121 121 StringBuffer<LChar> buffer(bufferSize); 122 122 123 ScopeGuard fileCloser([source]() {123 auto fileCloser = WTF::makeScopeExit([source]() { 124 124 PlatformFileHandle handle = source; 125 125 closeFile(handle);
Note: See TracChangeset
for help on using the changeset viewer.