Remove DeprecatedOptional
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Apr 2019 20:25:59 +0000 (20:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Apr 2019 20:25:59 +0000 (20:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197161

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-23
Reviewed by Darin Adler.

Source/JavaScriptCore:

* inspector/InspectorBackendDispatcher.cpp:
* inspector/InspectorBackendDispatcher.h:

Source/WTF:

This was added in r209326 to be compatible with a shipping version of Safari.
We have released several versions of Safari since then, so do what the comments say and remove it.
The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DeprecatedOptional.h: Removed.

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/DeprecatedOptional.h [deleted file]

index f1ae22b..c031750 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-23  Alex Christensen  <achristensen@webkit.org>
+
+        Remove DeprecatedOptional
+        https://bugs.webkit.org/show_bug.cgi?id=197161
+
+        Reviewed by Darin Adler.
+
+        * inspector/InspectorBackendDispatcher.cpp:
+        * inspector/InspectorBackendDispatcher.h:
+
 2019-04-22  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Use volatile load to populate backing page in MarkedBlock::Footer instead of using holdLock
index fdefd42..038cb64 100644 (file)
@@ -270,14 +270,6 @@ void BackendDispatcher::reportProtocolError(Optional<long> relatedRequestId, Com
     m_protocolErrors.append(std::tuple<CommonErrorCode, String>(errorCode, errorMessage));
 }
 
-void BackendDispatcher::reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage)
-{
-    if (relatedRequestId)
-        reportProtocolError(relatedRequestId.value(), errorCode, errorMessage);
-    else
-        reportProtocolError(WTF::nullopt, errorCode, errorMessage);
-}
-
 template<typename T>
 T BackendDispatcher::getPropertyValue(JSON::Object* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(JSON::Value&, T&)> asMethod, const char* typeName)
 {
index 3452e93..95d9d81 100644 (file)
@@ -29,7 +29,6 @@
 #include "InspectorFrontendRouter.h"
 #include "InspectorProtocolTypes.h"
 #include <functional>
-#include <wtf/DeprecatedOptional.h>
 #include <wtf/Optional.h>
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -110,9 +109,6 @@ public:
 private:
     BackendDispatcher(Ref<FrontendRouter>&&);
 
-    // This is necessary for some versions of Safari. Remove it when those versions of Safari are no longer supported.
-    void reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode, const String& errorMessage);
-
     Ref<FrontendRouter> m_frontendRouter;
     HashMap<String, SupplementalBackendDispatcher*> m_dispatchers;
 
index 118e2b1..813081e 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-23  Alex Christensen  <achristensen@webkit.org>
+
+        Remove DeprecatedOptional
+        https://bugs.webkit.org/show_bug.cgi?id=197161
+
+        Reviewed by Darin Adler.
+
+        This was added in r209326 to be compatible with a shipping version of Safari.
+        We have released several versions of Safari since then, so do what the comments say and remove it.
+        The existence of this std::optional makes migrating to C++17 harder, and there's no reason to keep it.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/DeprecatedOptional.h: Removed.
+
 2019-04-21  Zan Dobersek  <zdobersek@igalia.com>
 
         [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
index 6c0d951..89c91b0 100644 (file)
                A3EE5C3F21FFACA200FABD61 /* SchedulePairMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SchedulePairMac.mm; sourceTree = "<group>"; };
                A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
                A5098B011C16A4F900087797 /* SecuritySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecuritySPI.h; sourceTree = "<group>"; };
-               A561F30F1DF2642100FF675D /* DeprecatedOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedOptional.h; sourceTree = "<group>"; };
                A5BA15F2182433A900A82E69 /* StringCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringCocoa.mm; sourceTree = "<group>"; };
                A5BA15F41824348000A82E69 /* StringImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringImplCocoa.mm; sourceTree = "<group>"; };
                A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringImplCF.cpp; sourceTree = "<group>"; };
                                A8A4727A151A825A004123FF /* DateMath.h */,
                                996B17841EBA441C007E10EB /* DebugUtilities.h */,
                                0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */,
-                               A561F30F1DF2642100FF675D /* DeprecatedOptional.h */,
                                A8A4727E151A825A004123FF /* Deque.h */,
                                A9A4727F151A825A004123FF /* DisallowCType.h */,
                                0F4570421BE5B58F0062A629 /* Dominators.h */,
                                A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */,
                                0F9D3360165DBA73005AD387 /* FilePrintStream.cpp in Sources */,
                                A331D95B21F24992009F02AA /* FileSystem.cpp in Sources */,
-                               FE1E2C42224187C600F6B729 /* PlatformRegisters.cpp in Sources */,
                                A331D95D21F249E4009F02AA /* FileSystemCF.cpp in Sources */,
                                A331D95F21F249F6009F02AA /* FileSystemCocoa.mm in Sources */,
                                A331D96121F24A0A009F02AA /* FileSystemMac.mm in Sources */,
                                51F1752B1F3D486000C74950 /* PersistentCoders.cpp in Sources */,
                                51F1752C1F3D486000C74950 /* PersistentDecoder.cpp in Sources */,
                                51F1752D1F3D486000C74950 /* PersistentEncoder.cpp in Sources */,
+                               FE1E2C42224187C600F6B729 /* PlatformRegisters.cpp in Sources */,
                                0F9D3362165DBA73005AD387 /* PrintStream.cpp in Sources */,
                                7AF023B52061E17000A8EFD6 /* ProcessPrivilege.cpp in Sources */,
+                               FE1E2C3B2240C06600F6B729 /* PtrTag.cpp in Sources */,
                                143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */,
                                A3B725EC987446AD93F1A440 /* RandomDevice.cpp in Sources */,
                                A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */,
                                1C181C8F1D307AB800F5FA16 /* UTextProvider.cpp in Sources */,
                                1C181C911D307AB800F5FA16 /* UTextProviderLatin1.cpp in Sources */,
                                1C181C931D307AB800F5FA16 /* UTextProviderUTF16.cpp in Sources */,
-                               FE1E2C3B2240C06600F6B729 /* PtrTag.cpp in Sources */,
                                A8A47469151A825B004123FF /* UTF8Conversion.cpp in Sources */,
                                7AFEC6B11EB22B5900DADE36 /* UUID.cpp in Sources */,
                                0F66B2921DC97BAB004A1D3F /* WallTime.cpp in Sources */,
index 3c3f251..6ccacc8 100644 (file)
@@ -47,7 +47,6 @@ set(WTF_PUBLIC_HEADERS
     DateMath.h
     DebugUtilities.h
     DeferrableRefCounted.h
-    DeprecatedOptional.h
     Deque.h
     DisallowCType.h
     Dominators.h
diff --git a/Source/WTF/wtf/DeprecatedOptional.h b/Source/WTF/wtf/DeprecatedOptional.h
deleted file mode 100644 (file)
index 9b1558d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2014, 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.
- */
-
-// This file contains a deprecated version of std::optional which a released
-// version of Safari uses. Once Safari stops using this, we can remove this.
-// New code should use WTF::Optional.
-
-#pragma once
-
-#include <type_traits>
-#include <wtf/Optional.h>
-
-namespace std {
-
-template <class T>
-class optional : private WTF::OptionalBase<T> {
-public:
-    explicit constexpr operator bool() const __NOEXCEPT { return WTF::OptionalBase<T>::init_; }
-    constexpr T const& value() const& { return WTF::OptionalBase<T>::storage_.value_; }
-};
-
-}
-
-namespace WTF {
-
-template<typename T> using DeprecatedOptional = std::optional<T>;
-
-} // namespace WTF