Title: [228455] trunk/Source/WebKit
Revision
228455
Author
commit-qu...@webkit.org
Date
2018-02-13 22:01:37 -0800 (Tue, 13 Feb 2018)

Log 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.kim...@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:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (228454 => 228455)


--- trunk/Source/WebKit/ChangeLog	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/ChangeLog	2018-02-14 06:01:37 UTC (rev 228455)
@@ -1,3 +1,36 @@
+2018-02-13  Yousuke Kimoto  <yousuke.kim...@sony.com>
+
+        [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
+        https://bugs.webkit.org/show_bug.cgi?id=182679
+
+        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:
+
 2018-02-13  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r228431.

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp (228454 => 228455)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -30,11 +30,14 @@
 #include "NetworkCacheFileSystem.h"
 #include <WebCore/FileSystem.h>
 #include <fcntl.h>
+#include <wtf/RunLoop.h>
+#include <wtf/SHA1.h>
+
+#if !OS(WINDOWS)
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <wtf/RunLoop.h>
-#include <wtf/SHA1.h>
+#endif
 
 namespace WebKit {
 namespace NetworkCache {
@@ -83,6 +86,7 @@
 
 BlobStorage::Blob BlobStorage::add(const String& path, const Data& data)
 {
+#if !OS(WINDOWS)
     ASSERT(!RunLoop::isMain());
 
     auto hash = computeSHA1(data, m_salt);
@@ -114,6 +118,9 @@
     m_approximateSize += mappedData.size();
 
     return { mappedData, hash };
+#else
+    return { Data(), computeSHA1(data, m_salt) };
+#endif
 }
 
 BlobStorage::Blob BlobStorage::get(const String& path)

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp (228454 => 228455)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -28,10 +28,13 @@
 
 #include <WebCore/FileSystem.h>
 #include <fcntl.h>
+#include <wtf/CryptographicallyRandomNumber.h>
+
+#if !OS(WINDOWS)
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#include <wtf/CryptographicallyRandomNumber.h>
+#endif
 
 namespace WebKit {
 namespace NetworkCache {
@@ -38,6 +41,7 @@
 
 Data Data::mapToFile(const char* path) const
 {
+#if !OS(WINDOWS)
     int fd = open(path, O_CREAT | O_EXCL | O_RDWR , S_IRUSR | S_IWUSR);
     if (fd < 0)
         return { };
@@ -67,10 +71,14 @@
     msync(map, m_size, MS_ASYNC);
 
     return Data::adoptMap(map, m_size, fd);
+#else
+    return Data();
+#endif
 }
 
 Data mapFile(const char* path)
 {
+#if !OS(WINDOWS)
     int fd = open(path, O_RDONLY, 0);
     if (fd < 0)
         return { };
@@ -86,10 +94,14 @@
     }
 
     return adoptAndMapFile(fd, 0, size);
+#else
+    return Data();
+#endif
 }
 
 Data adoptAndMapFile(int fd, size_t offset, size_t size)
 {
+#if !OS(WINDOWS)
     if (!size) {
         close(fd);
         return Data::empty();
@@ -102,6 +114,9 @@
     }
 
     return Data::adoptMap(map, size, fd);
+#else
+    return Data();
+#endif
 }
 
 SHA1::Digest computeSHA1(const Data& data, const Salt& salt)
@@ -138,6 +153,7 @@
 
 std::optional<Salt> readOrMakeSalt(const String& path)
 {
+#if !OS(WINDOWS)
     auto cpath = WebCore::FileSystem::fileSystemRepresentation(path);
     auto fd = open(cpath.data(), O_RDONLY, 0);
     Salt salt;
@@ -154,6 +170,9 @@
             return { };
     }
     return salt;
+#else
+    return Salt();
+#endif
 }
 
 } // namespace NetworkCache

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp (228454 => 228455)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -28,13 +28,16 @@
 
 #include "Logging.h"
 #include <WebCore/FileSystem.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/time.h>
 #include <wtf/Assertions.h>
 #include <wtf/Function.h>
 #include <wtf/text/CString.h>
 
+#if !OS(WINDOWS)
+#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#endif
+
 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
 #include <sys/attr.h>
 #include <unistd.h>
@@ -50,6 +53,7 @@
 
 static DirectoryEntryType directoryEntryType(uint8_t dtype)
 {
+#if !OS(WINDOWS)
     switch (dtype) {
     case DT_DIR:
         return DirectoryEntryType::Directory;
@@ -59,10 +63,14 @@
         ASSERT_NOT_REACHED();
         return DirectoryEntryType::File;
     }
+#else
+    return DirectoryEntryType::File;
+#endif
 }
 
 void traverseDirectory(const String& path, const Function<void (const String&, DirectoryEntryType)>& function)
 {
+#if !OS(WINDOWS)
     DIR* dir = opendir(WebCore::FileSystem::fileSystemRepresentation(path).data());
     if (!dir)
         return;
@@ -79,6 +87,9 @@
         function(nameString, directoryEntryType(dp->d_type));
     }
     closedir(dir);
+#else
+    function(String(), DirectoryEntryType::File);
+#endif
 }
 
 void deleteDirectoryRecursively(const String& path)
@@ -116,6 +127,8 @@
         return { };
     return { WallTime::fromRawSeconds(g_ascii_strtoull(birthtimeString, nullptr, 10)),
         WallTime::fromRawSeconds(g_file_info_get_attribute_uint64(fileInfo.get(), "time::modified")) };
+#elif OS(WINDOWS)
+    return FileTimes();
 #endif
 }
 
@@ -127,8 +140,10 @@
         if (WallTime::now() - times.modification < 1_h)
             return;
     }
+#if !OS(WINDOWS)
     // This really updates both the access time and the modification time.
     utimes(WebCore::FileSystem::fileSystemRepresentation(path).data(), nullptr);
+#endif
 }
 
 bool canUseSharedMemoryForPath(const String& path)

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp (228454 => 228455)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -908,7 +908,7 @@
             });
 
             const unsigned maximumParallelReadCount = 5;
-            traverseOperation.activeCondition.wait(lock, [&traverseOperation] {
+            traverseOperation.activeCondition.wait(lock, [&traverseOperation, maximumParallelReadCount] {
                 return traverseOperation.activeCount <= maximumParallelReadCount;
             });
         });

Modified: trunk/Source/WebKit/NetworkProcess/win/SystemProxyWin.h (228454 => 228455)


--- trunk/Source/WebKit/NetworkProcess/win/SystemProxyWin.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/NetworkProcess/win/SystemProxyWin.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -23,6 +23,10 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#pragma once
+
+#include <windows.h>
+
 class WindowsSystemProxy {
     static const int ProxyServerNameLength = 512;
 public:

Modified: trunk/Source/WebKit/Platform/IPC/Attachment.h (228454 => 228455)


--- trunk/Source/WebKit/Platform/IPC/Attachment.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Platform/IPC/Attachment.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -31,6 +31,10 @@
 #include <mach/mach_traps.h>
 #endif
 
+#if OS(WINDOWS)
+#include <windows.h>
+#endif
+
 namespace IPC {
 
 class Decoder;

Modified: trunk/Source/WebKit/Platform/Module.h (228454 => 228455)


--- trunk/Source/WebKit/Platform/Module.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Platform/Module.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -37,6 +37,10 @@
 typedef struct _GModule GModule;
 #endif
 
+#if OS(WINDOWS)
+#include <windows.h>
+#endif
+
 namespace WebKit {
 
 class Module {
@@ -64,7 +68,7 @@
     void* platformFunctionPointer(const char* functionName) const;
 
     String m_path;
-#if PLATFORM(WIN)
+#if OS(WINDOWS)
     HMODULE m_module;
 #endif
 #if USE(CF)

Modified: trunk/Source/WebKit/Platform/SharedMemory.h (228454 => 228455)


--- trunk/Source/WebKit/Platform/SharedMemory.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Platform/SharedMemory.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -35,6 +35,10 @@
 #include <wtf/Optional.h>
 #endif
 
+#if OS(WINDOWS)
+#include <windows.h>
+#endif
+
 namespace IPC {
 class Decoder;
 class Encoder;

Modified: trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp (228454 => 228455)


--- trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -38,9 +38,12 @@
 #include "PluginProcessConnectionMessages.h"
 #include "PluginProxyMessages.h"
 #include "WebProcessConnectionMessages.h"
-#include <unistd.h>
 #include <wtf/SetForScope.h>
 
+#if !OS(WINDOWS)
+#include <unistd.h>
+#endif
+
 using namespace WebCore;
 
 namespace WebKit {

Modified: trunk/Source/WebKit/Shared/API/c/WKBase.h (228454 => 228455)


--- trunk/Source/WebKit/Shared/API/c/WKBase.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Shared/API/c/WKBase.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -32,16 +32,14 @@
 
 #if defined(BUILDING_GTK__)
 #include <WebKit/WKBaseGtk.h>
-#endif
-
-#if defined(__APPLE__) && !defined(BUILDING_GTK__)
+#elif defined(BUILDING_WPE__)
+#include <WebKit/WKBaseWPE.h>
+#elif defined(__APPLE__)
 #include <WebKit/WKBaseMac.h>
+#elif defined(_WIN32)
+#include <WebKit/WKBaseWin.h>
 #endif
 
-#if defined(BUILDING_WPE__)
-#include <WebKit/WKBaseWPE.h>
-#endif
-
 /* WebKit2 shared types */
 
 typedef uint32_t WKTypeID;

Modified: trunk/Source/WebKit/Shared/ChildProcess.cpp (228454 => 228455)


--- trunk/Source/WebKit/Shared/ChildProcess.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Shared/ChildProcess.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -30,7 +30,10 @@
 #include "SandboxInitializationParameters.h"
 #include <WebCore/SchemeRegistry.h>
 #include <pal/SessionID.h>
+
+#if !OS(WINDOWS)
 #include <unistd.h>
+#endif
 
 using namespace WebCore;
 

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (228454 => 228455)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -35,7 +35,6 @@
 #include <WebCore/MediaSelectionOption.h>
 #include <WebCore/NetworkLoadMetrics.h>
 #include <WebCore/NotificationDirection.h>
-#include <WebCore/PaymentHeaders.h>
 #include <WebCore/RealtimeMediaSource.h>
 #include <WebCore/ScrollSnapOffsetsInfo.h>
 #include <WebCore/ServiceWorkerTypes.h>
@@ -42,6 +41,10 @@
 #include <WebCore/StoredCredentialsPolicy.h>
 #include <WebCore/WorkerType.h>
 
+#if ENABLE(APPLE_PAY)
+#include <WebCore/PaymentHeaders.h>
+#endif
+
 namespace WTF {
 class MonotonicTime;
 class Seconds;

Modified: trunk/Source/WebKit/UIProcess/ProcessAssertion.h (228454 => 228455)


--- trunk/Source/WebKit/UIProcess/ProcessAssertion.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/UIProcess/ProcessAssertion.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -26,10 +26,13 @@
 #ifndef ProcessAssertion_h
 #define ProcessAssertion_h
 
-#include <unistd.h>
 #include <wtf/Function.h>
 #include <wtf/ProcessID.h>
 
+#if !OS(WINDOWS)
+#include <unistd.h>
+#endif
+
 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
 #include <wtf/RetainPtr.h>
 #include <wtf/WeakPtr.h>

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h (228454 => 228455)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2018-02-14 06:01:37 UTC (rev 228455)
@@ -62,6 +62,8 @@
 typedef NSBundle *PlatformBundle;
 #elif USE(GLIB)
 typedef ::GModule* PlatformBundle;
+#elif OS(WINDOWS)
+typedef void* PlatformBundle;
 #endif
 
 class InjectedBundleScriptWorld;

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (228454 => 228455)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-02-14 05:07:07 UTC (rev 228454)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2018-02-14 06:01:37 UTC (rev 228455)
@@ -117,12 +117,15 @@
 #include <WebCore/Settings.h>
 #include <WebCore/URLParser.h>
 #include <WebCore/UserGestureIndicator.h>
-#include <unistd.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/Language.h>
 #include <wtf/RunLoop.h>
 #include <wtf/text/StringHash.h>
 
+#if !OS(WINDOWS)
+#include <unistd.h>
+#endif
+
 #if PLATFORM(WAYLAND)
 #include "WaylandCompositorDisplay.h"
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to