Changeset 209326 in webkit


Ignore:
Timestamp:
Dec 5, 2016 11:02:17 AM (7 years ago)
Author:
Joseph Pecoraro
Message:

REGRESSION(r208985): SafariForWebKitDevelopment Symbol Not Found looking for method with WTF::Optional
https://bugs.webkit.org/show_bug.cgi?id=165351

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Some versions of Safari expect:

Inspector::BackendDispatcher::reportProtocolError(WTF::Optional<long>, Inspector::BackendDispatcher::CommonErrorCode, WTF::String const&)

Which we had updated to use std::optional. Expose a version with the original
Symbol for these Safaris. This stub will just call through to the new version.

  • inspector/InspectorBackendDispatcher.cpp:

(Inspector::BackendDispatcher::reportProtocolError):

  • inspector/InspectorBackendDispatcher.h:

Source/WTF:

Include a slimmed down version of WTF::Optional which older versions
of Safari still depend on for a JavaScriptCore exported symbol.
To prevent misuse name it WTF::DeprecatedOptional and use it only in
the one instance it is needed.

  • WTF.xcodeproj/project.pbxproj:
  • wtf/DeprecatedOptional.h: Added.

(WTF::Optional::operator bool):
(WTF::Optional::value):
(WTF::Optional::asPtr):

Location:
trunk/Source
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209322 r209326  
     12016-12-05  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        REGRESSION(r208985): SafariForWebKitDevelopment Symbol Not Found looking for method with WTF::Optional
     4        https://bugs.webkit.org/show_bug.cgi?id=165351
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Some versions of Safari expect:
     9
     10            Inspector::BackendDispatcher::reportProtocolError(WTF::Optional<long>, Inspector::BackendDispatcher::CommonErrorCode, WTF::String const&)
     11       
     12        Which we had updated to use std::optional. Expose a version with the original
     13        Symbol for these Safaris. This stub will just call through to the new version.
     14
     15        * inspector/InspectorBackendDispatcher.cpp:
     16        (Inspector::BackendDispatcher::reportProtocolError):
     17        * inspector/InspectorBackendDispatcher.h:
     18
    1192016-12-05  Konstantin Tokarev  <annulen@yandex.ru>
    220
  • trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp

    r208985 r209326  
    266266}
    267267
     268#if PLATFORM(MAC)
     269void BackendDispatcher::reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage)
     270{
     271    if (relatedRequestId)
     272        reportProtocolError(relatedRequestId.value(), errorCode, errorMessage);
     273    else
     274        reportProtocolError(std::nullopt, errorCode, errorMessage);
     275}
     276#endif
     277
    268278template<typename T>
    269279T BackendDispatcher::getPropertyValue(InspectorObject* object, const String& name, bool* out_optionalValueFound, T defaultValue, std::function<bool(InspectorValue&, T&)> asMethod, const char* typeName)
  • trunk/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h

    r208985 r209326  
    2929#include "InspectorFrontendRouter.h"
    3030#include "InspectorProtocolTypes.h"
     31#include <wtf/DeprecatedOptional.h>
    3132#include <wtf/Optional.h>
    3233#include <wtf/RefCounted.h>
     
    105106    BackendDispatcher(Ref<FrontendRouter>&&);
    106107
     108#if PLATFORM(MAC)
     109    // This is necessary for some versions of Safari. Remove it when those versions of Safari are no longer supported.
     110    void reportProtocolError(WTF::DeprecatedOptional<long> relatedRequestId, CommonErrorCode, const String& errorMessage);
     111#endif
     112
    107113    Ref<FrontendRouter> m_frontendRouter;
    108114    HashMap<String, SupplementalBackendDispatcher*> m_dispatchers;
  • trunk/Source/WTF/ChangeLog

    r209322 r209326  
     12016-12-05  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        REGRESSION(r208985): SafariForWebKitDevelopment Symbol Not Found looking for method with WTF::Optional
     4        https://bugs.webkit.org/show_bug.cgi?id=165351
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Include a slimmed down version of WTF::Optional which older versions
     9        of Safari still depend on for a JavaScriptCore exported symbol.
     10        To prevent misuse name it WTF::DeprecatedOptional and use it only in
     11        the one instance it is needed.
     12
     13        * WTF.xcodeproj/project.pbxproj:
     14        * wtf/DeprecatedOptional.h: Added.
     15        (WTF::Optional::operator bool):
     16        (WTF::Optional::value):
     17        (WTF::Optional::asPtr):
     18
    1192016-12-05  Konstantin Tokarev  <annulen@yandex.ru>
    220
  • trunk/Source/WTF/WTF.xcodeproj/project.pbxproj

    r209309 r209326  
    162162                A5098B001C169E0700087797 /* SandboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A5098AFF1C169E0700087797 /* SandboxSPI.h */; };
    163163                A5098B021C16A4F900087797 /* SecuritySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A5098B011C16A4F900087797 /* SecuritySPI.h */; };
     164                A561F3101DF2642100FF675D /* DeprecatedOptional.h in Headers */ = {isa = PBXBuildFile; fileRef = A561F30F1DF2642100FF675D /* DeprecatedOptional.h */; };
    164165                A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
    165166                A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; };
     
    529530                A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
    530531                A5098B011C16A4F900087797 /* SecuritySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecuritySPI.h; sourceTree = "<group>"; };
     532                A561F30F1DF2642100FF675D /* DeprecatedOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeprecatedOptional.h; sourceTree = "<group>"; };
    531533                A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = mac/StringMac.mm; sourceTree = "<group>"; };
    532534                A5BA15F41824348000A82E69 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringImplMac.mm; path = mac/StringImplMac.mm; sourceTree = "<group>"; };
     
    915917                                A8A4727C151A825A004123FF /* DecimalNumber.h */,
    916918                                0F2B66A417B6B4F700A7AE3F /* DeferrableRefCounted.h */,
     919                                A561F30F1DF2642100FF675D /* DeprecatedOptional.h */,
    917920                                A8A4727E151A825A004123FF /* Deque.h */,
    918921                                A8A4727F151A825A004123FF /* DisallowCType.h */,
     
    14321435                                26299B6E17A9E5B800ADEBE5 /* Ref.h in Headers */,
    14331436                                A8A47418151A825B004123FF /* RefCounted.h in Headers */,
     1437                                A561F3101DF2642100FF675D /* DeprecatedOptional.h in Headers */,
    14341438                                A8A47419151A825B004123FF /* RefCountedArray.h in Headers */,
    14351439                                A8A4741B151A825B004123FF /* RefCountedLeakCounter.h in Headers */,
Note: See TracChangeset for help on using the changeset viewer.