Ignore:
Timestamp:
Dec 19, 2018, 8:41:11 PM (6 years ago)
Author:
Chris Dumez
Message:

wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
https://bugs.webkit.org/show_bug.cgi?id=192728
<rdar://problem/46746779>

Reviewed by Geoff Garen.

Source/JavaScriptCore:

  • API/*:
  • Scripts/*:
  • assembler/*:
  • b3/*:
  • bytecode/*:
  • bytecompiler/*:
  • debugger/*:
  • dfg/*:
  • ftl/*:
  • heap/*:
  • inspector/*:
  • jit/*:
  • llint/*:
  • parser/*:
  • runtime/*:
  • tools/*:
  • wasm/*:
  • yarr/*:

Source/WebCore:

  • Modules/*:
  • animation/*:
  • bindings/*:
  • crypto/*:
  • css/*:
  • dom/*:
  • editing/*:
  • fileapi/*:
  • html/*:
  • inspector/*:
  • layout/*:
  • loader/*:
  • mathml/*:
  • page/*:
  • platform/*:
  • plugins/*:
  • rendering/*:
  • testing/*:
  • workers/*:
  • xml/*:

Source/WebCore/PAL:

  • pal/*:

Source/WebDriver:

  • :

Source/WebKit:

  • NetworkProcess/*:
  • Platform/*:
  • Scripts/*:
  • Shared/*:
  • UIProcess/*:
  • WebProcess/*:

Source/WebKitLegacy/mac:

  • DOM/*:
  • Plugins/*:
  • WebCoreSupport/*:
  • WebView/*:

Source/WebKitLegacy/win:

  • Plugins/*:
  • WebCoreSupport/*:

Source/WTF:

Update optional's move-constructor and move-assignment operator to disengage the value being moved from.
Rename to optional to Optional, make_optional() to makeOptional(), and move class from std to WTF namespace.

Based on patch by David Kilzer.

  • wtf/*:

Tools:

  • DumpRenderTree/*:
  • MiniBrowser/*:
  • TestRunnerShared/*:
  • TestWebKitAPI/*:
  • WebGPUAPIStructure/*:
  • WebKitTestRunner/*:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r239273 r239427  
    709709}
    710710
    711 static std::optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile)
     711static Optional<DirectoryName> extractDirectoryName(const String& absolutePathToFile)
    712712{
    713713    size_t firstSeparatorPosition = absolutePathToFile.find(pathSeparator());
    714714    if (firstSeparatorPosition == notFound)
    715         return std::nullopt;
     715        return WTF::nullopt;
    716716    DirectoryName directoryName;
    717717    directoryName.rootName = absolutePathToFile.substring(0, firstSeparatorPosition + 1); // Include the separator.
     
    728728}
    729729
    730 static std::optional<DirectoryName> currentWorkingDirectory()
     730static Optional<DirectoryName> currentWorkingDirectory()
    731731{
    732732#if OS(WINDOWS)
     
    742742    DWORD bufferLength = ::GetCurrentDirectoryW(0, nullptr);
    743743    if (!bufferLength)
    744         return std::nullopt;
     744        return WTF::nullopt;
    745745    // In Windows, wchar_t is the UTF-16LE.
    746746    // https://msdn.microsoft.com/en-us/library/dd374081.aspx
     
    751751    // We don't support network path like \\host\share\<path name>.
    752752    if (directoryString.startsWith("\\\\"))
    753         return std::nullopt;
     753        return WTF::nullopt;
    754754#else
    755755    Vector<char> buffer(PATH_MAX);
    756756    if (!getcwd(buffer.data(), PATH_MAX))
    757         return std::nullopt;
     757        return WTF::nullopt;
    758758    String directoryString = String::fromUTF8(buffer.data());
    759759#endif
    760760    if (directoryString.isEmpty())
    761         return std::nullopt;
     761        return WTF::nullopt;
    762762
    763763    if (directoryString[directoryString.length() - 1] == pathSeparator())
     
    24832483    auto scope = DECLARE_CATCH_SCOPE(vm);
    24842484
    2485     std::optional<DirectoryName> directoryName = currentWorkingDirectory();
     2485    Optional<DirectoryName> directoryName = currentWorkingDirectory();
    24862486    if (!directoryName)
    24872487        return;
Note: See TracChangeset for help on using the changeset viewer.