[Win][Clang] Fix compilation warnings under Source/WebKit directory
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 04:35:34 +0000 (04:35 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2018 04:35:34 +0000 (04:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192695

Reviewed by Alex Christensen.

* NetworkProcess/cache/NetworkCacheData.cpp:
(makeSalt): Enclosed by #if !OS(WINDOWS).
* NetworkProcess/cache/NetworkCacheFileSystem.cpp:
(WebKit::NetworkCache::directoryEntryType): Ditto.
* Platform/win/ModuleWin.cpp:
(WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
* UIProcess/DrawingAreaProxyImpl.h: Ditto.
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::processName): Removed the duplicated 'const' type qualifier.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
(WebKit::WebInspectorProxy::platformDetach): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
* UIProcess/win/WebView.cpp:
(WebKit::WebView::paint): Ditto.
(WebKit::WebPopupMenu::setUpPlatformData): Ditto.
* UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
* WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
* WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.

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

13 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCacheData.cpp
Source/WebKit/NetworkProcess/cache/NetworkCacheFileSystem.cpp
Source/WebKit/Platform/win/ModuleWin.cpp
Source/WebKit/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp
Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp
Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp
Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h
Source/WebKit/UIProcess/win/WebView.cpp
Source/WebKit/WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h
Source/WebKit/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp

index b2527f4..7d196bb 100644 (file)
@@ -1,3 +1,33 @@
+2018-12-18  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [Win][Clang] Fix compilation warnings under Source/WebKit directory
+        https://bugs.webkit.org/show_bug.cgi?id=192695
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/cache/NetworkCacheData.cpp:
+        (makeSalt): Enclosed by #if !OS(WINDOWS).
+        * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
+        (WebKit::NetworkCache::directoryEntryType): Ditto.
+        * Platform/win/ModuleWin.cpp:
+        (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast<void*>().
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
+        Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK).
+        * UIProcess/DrawingAreaProxyImpl.h: Ditto.
+        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
+        (WebKit::processName): Removed the duplicated 'const' type qualifier.
+        * UIProcess/win/WebInspectorProxyWin.cpp:
+        (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable.
+        (WebKit::WebInspectorProxy::platformDetach): Ditto.
+        * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto.
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::paint): Ditto.
+        (WebKit::WebPopupMenu::setUpPlatformData): Ditto.
+        * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'.
+        * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto.
+        * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable.
+
 2018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337
index a6e37be..56447e4 100644 (file)
@@ -142,6 +142,7 @@ bool bytesEqual(const Data& a, const Data& b)
     return !memcmp(a.data(), b.data(), a.size());
 }
 
+#if !OS(WINDOWS)
 static Salt makeSalt()
 {
     Salt salt;
@@ -150,6 +151,7 @@ static Salt makeSalt()
     *reinterpret_cast<uint32_t*>(&salt[4]) = cryptographicallyRandomNumber();
     return salt;
 }
+#endif
 
 std::optional<Salt> readOrMakeSalt(const String& path)
 {
index 45cf26a..25bef7f 100644 (file)
@@ -51,9 +51,9 @@
 namespace WebKit {
 namespace NetworkCache {
 
+#if !OS(WINDOWS)
 static DirectoryEntryType directoryEntryType(uint8_t dtype)
 {
-#if !OS(WINDOWS)
     switch (dtype) {
     case DT_DIR:
         return DirectoryEntryType::Directory;
@@ -63,10 +63,9 @@ static DirectoryEntryType directoryEntryType(uint8_t dtype)
         ASSERT_NOT_REACHED();
         return DirectoryEntryType::File;
     }
-#else
     return DirectoryEntryType::File;
-#endif
 }
+#endif
 
 void traverseDirectory(const String& path, const Function<void (const String&, DirectoryEntryType)>& function)
 {
index fefbc26..7b65d77 100644 (file)
@@ -51,7 +51,8 @@ void* Module::platformFunctionPointer(const char* functionName) const
 {
     if (!m_module)
         return 0;
-    return ::GetProcAddress(m_module, functionName);
+    auto proc = ::GetProcAddress(m_module, functionName);
+    return reinterpret_cast<void*>(proc);
 }
 
 }
index 573d32a..9070b5a 100644 (file)
@@ -200,8 +200,10 @@ void DrawingAreaProxyImpl::discardBackingStore()
 }
 
 DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor(WebPageProxy& webPage)
-    : m_webPage(webPage)
-    , m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
+    : m_timer(RunLoop::main(), this, &DrawingMonitor::stop)
+#if PLATFORM(GTK)
+    , m_webPage(webPage)
+#endif
 {
 #if USE(GLIB_EVENT_LOOP)
     // Give redraws more priority.
index 9665225..0af777f 100644 (file)
@@ -76,10 +76,12 @@ private:
         void stop();
         void didDraw();
 
-        WebPageProxy& m_webPage;
         MonotonicTime m_startTime;
         WTF::Function<void (CallbackBase::Error)> m_callback;
         RunLoop::Timer<DrawingMonitor> m_timer;
+#if PLATFORM(GTK)
+        WebPageProxy& m_webPage;
+#endif
     };
 
     bool m_isBackingStoreDiscardable { true };
index 0f7607b..577e469 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace WebKit {
 
-static const LPCWSTR processName(ProcessLauncher::ProcessType processType)
+static LPCWSTR processName(ProcessLauncher::ProcessType processType)
 {
     switch (processType) {
     case ProcessLauncher::ProcessType::Web:
index cbfe30e..91cff61 100644 (file)
@@ -301,9 +301,6 @@ void WebInspectorProxy::platformAttach()
     static const unsigned minimumAttachedWidth = 750;
     static const unsigned minimumAttachedHeight = 250;
 
-    unsigned inspectedHeight = platformInspectedWindowHeight();
-    unsigned inspectedWidth = platformInspectedWindowWidth();
-
     if (m_inspectorDetachWindow && ::GetParent(m_inspectorViewWindow) == m_inspectorDetachWindow) {
         ::SetParent(m_inspectorViewWindow, m_inspectedViewParentWindow);
         ::ShowWindow(m_inspectorDetachWindow, SW_HIDE);
@@ -327,7 +324,6 @@ void WebInspectorProxy::platformDetach()
         return;
 
     if (!m_inspectorDetachWindow) {
-        static bool haveRegisteredClass = false;
         registerWindowClass();
         m_inspectorDetachWindow = ::CreateWindowEx(0, WebInspectorProxyClassName, 0, WS_OVERLAPPEDWINDOW,
             CW_USEDEFAULT, CW_USEDEFAULT, initialWindowWidth, initialWindowHeight,
index a0f963d..980e0b7 100644 (file)
@@ -50,8 +50,6 @@ static const LPCWSTR kWebKit2WebPopupMenuProxyWindowClassName = L"WebKit2WebPopu
 static constexpr int defaultAnimationDuration = 200;
 static constexpr int maxPopupHeight = 320;
 static constexpr int popupWindowBorderWidth = 1;
-static constexpr int separatorPadding = 4;
-static constexpr int separatorHeight = 1;
 
 // This is used from within our custom message pump when we want to send a
 // message to the web view and not have our message stolen and sent to
index 0292d96..4694c47 100644 (file)
@@ -45,8 +45,8 @@ public:
     }
     ~WebPopupMenuProxyWin();
 
-    virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
-    virtual void hidePopupMenu();
+    void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) override;
+    void hidePopupMenu() override;
 
     bool setFocusedIndex(int index, bool hotTracking = false);
 
index f9b885d..ef7919c 100644 (file)
@@ -474,10 +474,8 @@ void WebView::paint(HDC hdc, const IntRect& dirtyRect)
         cairo_surface_destroy(surface);
 
         Vector<IntRect> unpaintedRects = unpaintedRegion.rects();
-        for (size_t i = 0; i < unpaintedRects.size(); ++i) {
-            RECT winRect = unpaintedRects[i];
-            drawPageBackground(hdc, m_page.get(), unpaintedRects[i]);
-        }
+        for (auto& rect : unpaintedRects)
+            drawPageBackground(hdc, m_page.get(), rect);
     } else
         drawPageBackground(hdc, m_page.get(), dirtyRect);
 }
index f830e68..f40c5e8 100644 (file)
@@ -47,7 +47,7 @@ public:
     WebFrameLoaderClient* webFrameLoaderClient() const;
 
 #if PLATFORM(WIN)
-    WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const;
+    WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const override;
 #endif
 
 private:
index e4b7cd0..3c1ea06 100644 (file)
@@ -111,7 +111,6 @@ void WebPopupMenu::setUpPlatformData(const WebCore::IntRect& pageCoordinates, Pl
 
         String itemText = m_popupClient->itemText(index);
 
-        TextDirection direction = itemText.defaultWritingDirection() == U_RIGHT_TO_LEFT ? TextDirection::RTL : TextDirection::LTR;
         TextRun textRun(itemText, 0, 0, AllowTrailingExpansion, itemStyle.textDirection(), itemStyle.hasTextDirectionOverride());
 
         notSelectedBackingStoreContext->setFillColor(optionTextColor);