Changeset 228455 in webkit


Ignore:
Timestamp:
Feb 13, 2018 10:01:37 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
https://bugs.webkit.org/show_bug.cgi?id=182679

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2018-02-13
Reviewed by Michael Catanzaro.

  • NetworkProcess/cache/NetworkCacheBlobStorage.cpp:

(WebKit::NetworkCache::BlobStorage::add):

  • NetworkProcess/cache/NetworkCacheData.cpp:

(WebKit::NetworkCache::Data::mapToFile const):
(WebKit::NetworkCache::mapFile):
(WebKit::NetworkCache::adoptAndMapFile):
(WebKit::NetworkCache::readOrMakeSalt):

  • NetworkProcess/cache/NetworkCacheFileSystem.cpp:

(WebKit::NetworkCache::directoryEntryType):
(WebKit::NetworkCache::traverseDirectory):
(WebKit::NetworkCache::fileTimes):
(WebKit::NetworkCache::updateFileModificationTimeIfNeeded):

  • NetworkProcess/cache/NetworkCacheStorage.cpp:

(WebKit::NetworkCache::Storage::traverse):

  • NetworkProcess/win/SystemProxyWin.h:
  • Platform/IPC/Attachment.h:
  • Platform/Module.h:
  • Platform/SharedMemory.h:
  • PluginProcess/WebProcessConnection.cpp:
  • Shared/API/c/WKBase.h:
  • Shared/ChildProcess.cpp:
  • Shared/WebCoreArgumentCoders.h:
  • UIProcess/ProcessAssertion.h:
  • WebProcess/InjectedBundle/InjectedBundle.h:
  • WebProcess/WebProcess.cpp:
Location:
trunk/Source/WebKit
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r228451 r228455  
     12018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>
     2
     3        [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
     4        https://bugs.webkit.org/show_bug.cgi?id=182679
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
     9        (WebKit::NetworkCache::BlobStorage::add):
     10        * NetworkProcess/cache/NetworkCacheData.cpp:
     11        (WebKit::NetworkCache::Data::mapToFile const):
     12        (WebKit::NetworkCache::mapFile):
     13        (WebKit::NetworkCache::adoptAndMapFile):
     14        (WebKit::NetworkCache::readOrMakeSalt):
     15        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
     16        (WebKit::NetworkCache::directoryEntryType):
     17        (WebKit::NetworkCache::traverseDirectory):
     18        (WebKit::NetworkCache::fileTimes):
     19        (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
     20        * NetworkProcess/cache/NetworkCacheStorage.cpp:
     21        (WebKit::NetworkCache::Storage::traverse):
     22        * NetworkProcess/win/SystemProxyWin.h:
     23        * Platform/IPC/Attachment.h:
     24        * Platform/Module.h:
     25        * Platform/SharedMemory.h:
     26        * PluginProcess/WebProcessConnection.cpp:
     27        * Shared/API/c/WKBase.h:
     28        * Shared/ChildProcess.cpp:
     29        * Shared/WebCoreArgumentCoders.h:
     30        * UIProcess/ProcessAssertion.h:
     31        * WebProcess/InjectedBundle/InjectedBundle.h:
     32        * WebProcess/WebProcess.cpp:
     33
    1342018-02-13  Commit Queue  <commit-queue@webkit.org>
    235
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp

    r226423 r228455  
    3131#include <WebCore/FileSystem.h>
    3232#include <fcntl.h>
     33#include <wtf/RunLoop.h>
     34#include <wtf/SHA1.h>
     35
     36#if !OS(WINDOWS)
    3337#include <sys/mman.h>
    3438#include <sys/stat.h>
    3539#include <unistd.h>
    36 #include <wtf/RunLoop.h>
    37 #include <wtf/SHA1.h>
     40#endif
    3841
    3942namespace WebKit {
     
    8487BlobStorage::Blob BlobStorage::add(const String& path, const Data& data)
    8588{
     89#if !OS(WINDOWS)
    8690    ASSERT(!RunLoop::isMain());
    8791
     
    115119
    116120    return { mappedData, hash };
     121#else
     122    return { Data(), computeSHA1(data, m_salt) };
     123#endif
    117124}
    118125
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp

    r226423 r228455  
    2929#include <WebCore/FileSystem.h>
    3030#include <fcntl.h>
     31#include <wtf/CryptographicallyRandomNumber.h>
     32
     33#if !OS(WINDOWS)
    3134#include <sys/mman.h>
    3235#include <sys/stat.h>
    3336#include <unistd.h>
    34 #include <wtf/CryptographicallyRandomNumber.h>
     37#endif
    3538
    3639namespace WebKit {
     
    3942Data Data::mapToFile(const char* path) const
    4043{
     44#if !OS(WINDOWS)
    4145    int fd = open(path, O_CREAT | O_EXCL | O_RDWR , S_IRUSR | S_IWUSR);
    4246    if (fd < 0)
     
    6872
    6973    return Data::adoptMap(map, m_size, fd);
     74#else
     75    return Data();
     76#endif
    7077}
    7178
    7279Data mapFile(const char* path)
    7380{
     81#if !OS(WINDOWS)
    7482    int fd = open(path, O_RDONLY, 0);
    7583    if (fd < 0)
     
    8795
    8896    return adoptAndMapFile(fd, 0, size);
     97#else
     98    return Data();
     99#endif
    89100}
    90101
    91102Data adoptAndMapFile(int fd, size_t offset, size_t size)
    92103{
     104#if !OS(WINDOWS)
    93105    if (!size) {
    94106        close(fd);
     
    103115
    104116    return Data::adoptMap(map, size, fd);
     117#else
     118    return Data();
     119#endif
    105120}
    106121
     
    139154std::optional<Salt> readOrMakeSalt(const String& path)
    140155{
     156#if !OS(WINDOWS)
    141157    auto cpath = WebCore::FileSystem::fileSystemRepresentation(path);
    142158    auto fd = open(cpath.data(), O_RDONLY, 0);
     
    155171    }
    156172    return salt;
     173#else
     174    return Salt();
     175#endif
    157176}
    158177
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp

    r226349 r228455  
    2929#include "Logging.h"
    3030#include <WebCore/FileSystem.h>
     31#include <wtf/Assertions.h>
     32#include <wtf/Function.h>
     33#include <wtf/text/CString.h>
     34
     35#if !OS(WINDOWS)
    3136#include <dirent.h>
    3237#include <sys/stat.h>
    3338#include <sys/time.h>
    34 #include <wtf/Assertions.h>
    35 #include <wtf/Function.h>
    36 #include <wtf/text/CString.h>
     39#endif
    3740
    3841#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
     
    5154static DirectoryEntryType directoryEntryType(uint8_t dtype)
    5255{
     56#if !OS(WINDOWS)
    5357    switch (dtype) {
    5458    case DT_DIR:
     
    6064        return DirectoryEntryType::File;
    6165    }
     66#else
     67    return DirectoryEntryType::File;
     68#endif
    6269}
    6370
    6471void traverseDirectory(const String& path, const Function<void (const String&, DirectoryEntryType)>& function)
    6572{
     73#if !OS(WINDOWS)
    6674    DIR* dir = opendir(WebCore::FileSystem::fileSystemRepresentation(path).data());
    6775    if (!dir)
     
    8088    }
    8189    closedir(dir);
     90#else
     91    function(String(), DirectoryEntryType::File);
     92#endif
    8293}
    8394
     
    117128    return { WallTime::fromRawSeconds(g_ascii_strtoull(birthtimeString, nullptr, 10)),
    118129        WallTime::fromRawSeconds(g_file_info_get_attribute_uint64(fileInfo.get(), "time::modified")) };
     130#elif OS(WINDOWS)
     131    return FileTimes();
    119132#endif
    120133}
     
    128141            return;
    129142    }
     143#if !OS(WINDOWS)
    130144    // This really updates both the access time and the modification time.
    131145    utimes(WebCore::FileSystem::fileSystemRepresentation(path).data(), nullptr);
     146#endif
    132147}
    133148
  • trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp

    r226349 r228455  
    909909
    910910            const unsigned maximumParallelReadCount = 5;
    911             traverseOperation.activeCondition.wait(lock, [&traverseOperation] {
     911            traverseOperation.activeCondition.wait(lock, [&traverseOperation, maximumParallelReadCount] {
    912912                return traverseOperation.activeCount <= maximumParallelReadCount;
    913913            });
  • trunk/Source/WebKit/NetworkProcess/win/SystemProxyWin.h

    r221625 r228455  
    2424 */
    2525
     26#pragma once
     27
     28#include <windows.h>
     29
    2630class WindowsSystemProxy {
    2731    static const int ProxyServerNameLength = 512;
  • trunk/Source/WebKit/Platform/IPC/Attachment.h

    r224351 r228455  
    3030#include <mach/mach_init.h>
    3131#include <mach/mach_traps.h>
     32#endif
     33
     34#if OS(WINDOWS)
     35#include <windows.h>
    3236#endif
    3337
  • trunk/Source/WebKit/Platform/Module.h

    r223966 r228455  
    3838#endif
    3939
     40#if OS(WINDOWS)
     41#include <windows.h>
     42#endif
     43
    4044namespace WebKit {
    4145
     
    6569
    6670    String m_path;
    67 #if PLATFORM(WIN)
     71#if OS(WINDOWS)
    6872    HMODULE m_module;
    6973#endif
  • trunk/Source/WebKit/Platform/SharedMemory.h

    r223966 r228455  
    3434#include "Attachment.h"
    3535#include <wtf/Optional.h>
     36#endif
     37
     38#if OS(WINDOWS)
     39#include <windows.h>
    3640#endif
    3741
  • trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp

    r216448 r228455  
    3939#include "PluginProxyMessages.h"
    4040#include "WebProcessConnectionMessages.h"
     41#include <wtf/SetForScope.h>
     42
     43#if !OS(WINDOWS)
    4144#include <unistd.h>
    42 #include <wtf/SetForScope.h>
     45#endif
    4346
    4447using namespace WebCore;
  • trunk/Source/WebKit/Shared/API/c/WKBase.h

    r216696 r228455  
    3333#if defined(BUILDING_GTK__)
    3434#include <WebKit/WKBaseGtk.h>
    35 #endif
    36 
    37 #if defined(__APPLE__) && !defined(BUILDING_GTK__)
     35#elif defined(BUILDING_WPE__)
     36#include <WebKit/WKBaseWPE.h>
     37#elif defined(__APPLE__)
    3838#include <WebKit/WKBaseMac.h>
    39 #endif
    40 
    41 #if defined(BUILDING_WPE__)
    42 #include <WebKit/WKBaseWPE.h>
     39#elif defined(_WIN32)
     40#include <WebKit/WKBaseWin.h>
    4341#endif
    4442
  • trunk/Source/WebKit/Shared/ChildProcess.cpp

    r226327 r228455  
    3131#include <WebCore/SchemeRegistry.h>
    3232#include <pal/SessionID.h>
     33
     34#if !OS(WINDOWS)
    3335#include <unistd.h>
     36#endif
    3437
    3538using namespace WebCore;
  • trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h

    r226886 r228455  
    3636#include <WebCore/NetworkLoadMetrics.h>
    3737#include <WebCore/NotificationDirection.h>
    38 #include <WebCore/PaymentHeaders.h>
    3938#include <WebCore/RealtimeMediaSource.h>
    4039#include <WebCore/ScrollSnapOffsetsInfo.h>
     
    4241#include <WebCore/StoredCredentialsPolicy.h>
    4342#include <WebCore/WorkerType.h>
     43
     44#if ENABLE(APPLE_PAY)
     45#include <WebCore/PaymentHeaders.h>
     46#endif
    4447
    4548namespace WTF {
  • trunk/Source/WebKit/UIProcess/ProcessAssertion.h

    r222422 r228455  
    2727#define ProcessAssertion_h
    2828
    29 #include <unistd.h>
    3029#include <wtf/Function.h>
    3130#include <wtf/ProcessID.h>
     31
     32#if !OS(WINDOWS)
     33#include <unistd.h>
     34#endif
    3235
    3336#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
  • trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h

    r226510 r228455  
    6363#elif USE(GLIB)
    6464typedef ::GModule* PlatformBundle;
     65#elif OS(WINDOWS)
     66typedef void* PlatformBundle;
    6567#endif
    6668
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r228350 r228455  
    118118#include <WebCore/URLParser.h>
    119119#include <WebCore/UserGestureIndicator.h>
    120 #include <unistd.h>
    121120#include <wtf/CurrentTime.h>
    122121#include <wtf/Language.h>
    123122#include <wtf/RunLoop.h>
    124123#include <wtf/text/StringHash.h>
     124
     125#if !OS(WINDOWS)
     126#include <unistd.h>
     127#endif
    125128
    126129#if PLATFORM(WAYLAND)
Note: See TracChangeset for help on using the changeset viewer.