[Win] Fix a slew of simple clang-cl warnings.
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 04:24:47 +0000 (04:24 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 04:24:47 +0000 (04:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195652

Reviewed by Don Olmstead.

Source/WebCore:

* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::willSetupSslCtx):
(WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest): -Wreorder
(WebCore::CurlRequest::setupTransfer): -Wunused-variable
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
* platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString): -Wwritable-strings
* rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
(WebCore::RenderThemeWin::getThemeData): -Wswitch

Source/WebCore/PAL:

* pal/win/LoggingWin.cpp:
(PAL::logLevelString): -Wwritable-strings

Source/WebKit:

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): -Wswitch
* Platform/IPC/win/ConnectionWin.cpp:
(IPC::Connection::readEventHandler): -Wunused-variable
* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString): -Wwritable-strings
* UIProcess/Launcher/win/ProcessLauncherWin.cpp:
(WebKit::ProcessLauncher::launchProcess): -Wunused-variable

Source/WebKitLegacy/win:

* Interfaces/AccessibleComparable.idl: -Wmissing-braces
* Plugins/PluginDatabaseWin.cpp: -Wunused-function
(WebCore::addJavaPluginDirectory): Deleted.
* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::AcceleratedCompositingContext): -Wreorder
* WebCoreSupport/WebEditorClient.cpp:
(WebEditorUndoCommand::WebEditorUndoCommand): -Wreorder
(undoNameForEditAction): -Wswitch
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::WebFrameLoaderClient): -Wswitch
(WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): -Wunused-variable
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::WebInspectorFrontendClient): -Wreorder
* WebCoreSupport/WebInspectorClient.h: -Winconsistent-missing-override
* WebError.cpp:
(WebError::WebError): -Wreorder
* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld): -Wlogical-op-parentheses
* WebHistory.cpp: -Wunused-function (x5)
(areEqualOrClose): Deleted.
(addDayToSystemTime): Deleted.
(getDayBoundaries): Deleted.
(beginningOfDay): Deleted.
(dateKey): Deleted.
* WebNotificationCenter.cpp:
(WebNotificationCenter::removeObserver): -Wunused-variable
* WebView.cpp: -Wunused-function, -Wreorder
(WebView::addVisitedLinks): -Wunused-variable

Tools:

* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::windowSnapshotImage): -Wunused-variable

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

31 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/win/LoggingWin.cpp
Source/WebCore/page/AutoscrollController.cpp
Source/WebCore/platform/network/curl/CurlContext.cpp
Source/WebCore/platform/network/curl/CurlFormDataStream.cpp
Source/WebCore/platform/network/curl/CurlRequest.cpp
Source/WebCore/platform/network/curl/CurlSSLVerifier.cpp
Source/WebCore/platform/network/curl/CurlSSLVerifier.h
Source/WebCore/platform/win/LoggingWin.cpp
Source/WebCore/rendering/RenderThemeWin.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
Source/WebKit/Platform/IPC/win/ConnectionWin.cpp
Source/WebKit/Platform/win/LoggingWin.cpp
Source/WebKit/UIProcess/Launcher/win/ProcessLauncherWin.cpp
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/Interfaces/AccessibleComparable.idl
Source/WebKitLegacy/win/Plugins/PluginDatabaseWin.cpp
Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.h
Source/WebKitLegacy/win/WebError.cpp
Source/WebKitLegacy/win/WebFrame.cpp
Source/WebKitLegacy/win/WebHistory.cpp
Source/WebKitLegacy/win/WebNotificationCenter.cpp
Source/WebKitLegacy/win/WebView.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp

index c759de4..e340106 100644 (file)
@@ -1,3 +1,28 @@
+2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] Fix a slew of simple clang-cl warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=195652
+
+        Reviewed by Don Olmstead.
+
+        * page/AutoscrollController.cpp:
+        (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
+        * platform/network/curl/CurlContext.cpp:
+        (WebCore::CurlHandle::willSetupSslCtx):
+        (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
+        * platform/network/curl/CurlFormDataStream.cpp:
+        (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
+        * platform/network/curl/CurlRequest.cpp:
+        (WebCore::CurlRequest::CurlRequest): -Wreorder
+        (WebCore::CurlRequest::setupTransfer): -Wunused-variable
+        * platform/network/curl/CurlSSLVerifier.cpp:
+        (WebCore::CurlSSLVerifier::CurlSSLVerifier):
+        * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
+        * platform/win/LoggingWin.cpp:
+        (WebCore::logLevelString): -Wwritable-strings
+        * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
+        (WebCore::RenderThemeWin::getThemeData): -Wswitch
+
 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Move the code for determining the need for touch bar quirks to Quirks class
index 95c8322..388d0e3 100644 (file)
@@ -1,3 +1,13 @@
+2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] Fix a slew of simple clang-cl warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=195652
+
+        Reviewed by Don Olmstead.
+
+        * pal/win/LoggingWin.cpp:
+        (PAL::logLevelString): -Wwritable-strings
+
 2019-03-12  Timothy Hatcher  <timothy@apple.com>
 
         Expose document attributes and body background color through HTMLConverter.
index 6b232c4..5b55320 100644 (file)
@@ -37,7 +37,7 @@ namespace PAL {
 String logLevelString()
 {
 #if !LOG_DISABLED
-    static char* const loggingEnvironmentVariable = "WebCoreLogging";
+    static const char* loggingEnvironmentVariable = "WebCoreLogging";
     DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
     if (!length)
         return emptyString();
index cfbbfaa..4af7ccd 100644 (file)
@@ -199,6 +199,8 @@ void AutoscrollController::handleMouseReleaseEvent(const PlatformMouseEvent& mou
     case AutoscrollForPanCanStop:
         stopAutoscrollTimer();
         break;
+    default:
+        break;
     }
 }
 
index 0ce1100..c5c4535 100644 (file)
@@ -330,7 +330,7 @@ CURLcode CurlHandle::willSetupSslCtx(void* sslCtx)
         return CURLE_ABORTED_BY_CALLBACK;
 
     if (!m_sslVerifier)
-        m_sslVerifier = std::make_unique<CurlSSLVerifier>(*this, sslCtx);
+        m_sslVerifier = std::make_unique<CurlSSLVerifier>(sslCtx);
 
     return CURLE_OK;
 }
@@ -386,10 +386,8 @@ void CurlHandle::setUrl(const URL& url)
 void CurlHandle::appendRequestHeaders(const HTTPHeaderMap& headers)
 {
     if (headers.size()) {
-        for (auto& entry : headers) {
-            auto& value = entry.value;
+        for (auto& entry : headers)
             appendRequestHeader(entry.key, entry.value);
-        }
     }
 }
 
index 8129fe0..dd63a4a 100644 (file)
@@ -97,8 +97,6 @@ unsigned long long CurlFormDataStream::totalSize()
 
 void CurlFormDataStream::computeContentLength()
 {
-    static auto maxCurlOffT = CurlHandle::maxCurlOffT();
-
     if (!m_formData || m_isContentLengthUpdated)
         return;
 
index 46542a7..ffe2331 100644 (file)
 namespace WebCore {
 
 CurlRequest::CurlRequest(const ResourceRequest&request, CurlRequestClient* client, ShouldSuspend shouldSuspend, EnableMultipart enableMultipart, CaptureNetworkLoadMetrics captureExtraMetrics, MessageQueue<Function<void()>>* messageQueue)
-    : m_request(request.isolatedCopy())
-    , m_client(client)
+    : m_client(client)
+    , m_messageQueue(messageQueue)
+    , m_request(request.isolatedCopy())
     , m_shouldSuspend(shouldSuspend == ShouldSuspend::Yes)
     , m_enableMultipart(enableMultipart == EnableMultipart::Yes)
     , m_formDataStream(m_request.httpBody())
-    , m_messageQueue(messageQueue)
     , m_captureExtraMetrics(captureExtraMetrics == CaptureNetworkLoadMetrics::Extended)
 {
     ASSERT(isMainThread());
@@ -186,8 +186,6 @@ void CurlRequest::runOnWorkerThreadIfRequired(Function<void()>&& task)
 
 CURL* CurlRequest::setupTransfer()
 {
-    auto& sslHandle = CurlContext::singleton().sslHandle();
-
     auto httpHeaderFields = m_request.httpHeaderFields();
     appendAcceptLanguageHeader(httpHeaderFields);
 
index 369070d..8094b93 100644 (file)
@@ -37,8 +37,7 @@ namespace WebCore {
 static Vector<CertificateInfo::Certificate> pemDataFromCtx(X509StoreCTX*);
 static CurlSSLVerifier::SSLCertificateFlags convertToSSLCertificateFlags(unsigned);
 
-CurlSSLVerifier::CurlSSLVerifier(CurlHandle& curlHandle, void* sslCtx)
-    : m_curlHandle(curlHandle)
+CurlSSLVerifier::CurlSSLVerifier(void* sslCtx)
 {
     auto* ctx = static_cast<SSL_CTX*>(sslCtx);
     const auto& sslHandle = CurlContext::singleton().sslHandle();
index 49b6b9d..9e3b800 100644 (file)
@@ -50,7 +50,7 @@ public:
         SSL_CERTIFICATE_GENERIC_ERROR = (1 << 6) // Some other error occurred validating the certificate
     };
 
-    CurlSSLVerifier(CurlHandle&, void* sslCtx);
+    CurlSSLVerifier(void* sslCtx);
 
     int sslErrors() { return m_sslErrors; }
     const CertificateInfo& certificateInfo() const { return m_certificateInfo; }
@@ -58,8 +58,6 @@ public:
 private:
     static int verifyCallback(int, X509StoreCTX*);
 
-    CurlHandle& m_curlHandle;
-
     int m_sslErrors { 0 };
     CertificateInfo m_certificateInfo;
 
index e6c444e..31f067f 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 String logLevelString()
 {
 #if !LOG_DISABLED
-    static char* const loggingEnvironmentVariable = "WebCoreLogging";
+    static const char* loggingEnvironmentVariable = "WebCoreLogging";
     DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
     if (!length)
         return emptyString();
index 7eb703a..de04e5f 100644 (file)
@@ -163,8 +163,6 @@ namespace WebCore {
 // This is the fixed width IE and Firefox use for buttons on dropdown menus
 static const int dropDownButtonWidth = 17;
 
-static const int shell32MagnifierIconIndex = 22;
-
 // Default font size to match Firefox.
 static const float defaultControlFontPixelSize = 13;
 
@@ -612,6 +610,8 @@ ThemeData RenderThemeWin::getThemeData(const RenderObject& o, ControlSubPart sub
             result.m_part = subPart == SpinButtonUp ? SPNP_UP : SPNP_DOWN;
             result.m_state = determineSpinButtonState(o, subPart);
             break;
+        default:
+            break;
     }
 
     return result;
@@ -1021,8 +1021,6 @@ Color RenderThemeWin::systemColor(CSSValueID cssValueId, OptionSet<StyleColor::O
 }
 
 #if ENABLE(VIDEO)
-static const size_t maximumReasonableBufferSize = 32768;
-
 static void fillBufferWithContentsOfFile(FileSystem::PlatformFileHandle file, long long filesize, Vector<char>& buffer)
 {
     // Load the file content into buffer
index d1b6832..3b1c948 100644 (file)
@@ -1,3 +1,19 @@
+2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] Fix a slew of simple clang-cl warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=195652
+
+        Reviewed by Don Olmstead.
+
+        * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
+        (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): -Wswitch
+        * Platform/IPC/win/ConnectionWin.cpp:
+        (IPC::Connection::readEventHandler): -Wunused-variable
+        * Platform/win/LoggingWin.cpp:
+        (WebKit::logLevelString): -Wwritable-strings
+        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
+        (WebKit::ProcessLauncher::launchProcess): -Wunused-variable
+
 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Move the code for determining the need for touch bar quirks to Quirks class
index bdaffde..7755ef3 100644 (file)
@@ -230,7 +230,7 @@ void NetworkDataTaskCurl::invokeDidReceiveResponse()
             break;
         case PolicyAction::Ignore:
             break;
-        case PolicyAction::Download:
+        default:
             notImplemented();
             break;
         }
index e26a7e2..640f452 100644 (file)
@@ -123,7 +123,6 @@ void Connection::readEventHandler()
 
                 m_readBuffer.grow(m_readBuffer.size() + bytesToRead);
                 if (!::ReadFile(m_connectionPipe, m_readBuffer.data() + numberOfBytesRead, bytesToRead, 0, &m_readListener.state())) {
-                    DWORD error = ::GetLastError();
                     ASSERT_NOT_REACHED();
                     return;
                 }
index 69b0a5c..5ae3cad 100644 (file)
@@ -38,8 +38,7 @@ namespace WebKit {
 String logLevelString()
 {
 #if !LOG_DISABLED
-    static char* const loggingEnvironmentVariable = "WebKitLogging";
-
+    static const char* loggingEnvironmentVariable = "WebKitLogging";
     DWORD length = GetEnvironmentVariableA(loggingEnvironmentVariable, 0, 0);
     if (!length)
         return emptyString();
index d3d171d..775aec2 100644 (file)
@@ -98,7 +98,6 @@ void ProcessLauncher::launchProcess()
 
     if (!result) {
         // FIXME: What should we do here?
-        DWORD error = ::GetLastError();
         ASSERT_NOT_REACHED();
     }
 
index 5e60639..b4ea4c3 100644 (file)
@@ -1,3 +1,39 @@
+2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] Fix a slew of simple clang-cl warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=195652
+
+        Reviewed by Don Olmstead.
+
+        * Interfaces/AccessibleComparable.idl: -Wmissing-braces
+        * Plugins/PluginDatabaseWin.cpp: -Wunused-function
+        (WebCore::addJavaPluginDirectory): Deleted.
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        (AcceleratedCompositingContext::AcceleratedCompositingContext): -Wreorder
+        * WebCoreSupport/WebEditorClient.cpp:
+        (WebEditorUndoCommand::WebEditorUndoCommand): -Wreorder
+        (undoNameForEditAction): -Wswitch
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::WebFrameLoaderClient): -Wswitch
+        (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks): -Wunused-variable
+        * WebCoreSupport/WebInspectorClient.cpp:
+        (WebInspectorFrontendClient::WebInspectorFrontendClient): -Wreorder
+        * WebCoreSupport/WebInspectorClient.h: -Winconsistent-missing-override
+        * WebError.cpp:
+        (WebError::WebError): -Wreorder
+        * WebFrame.cpp:
+        (WebFrame::stringByEvaluatingJavaScriptInScriptWorld): -Wlogical-op-parentheses
+        * WebHistory.cpp: -Wunused-function (x5)
+        (areEqualOrClose): Deleted.
+        (addDayToSystemTime): Deleted.
+        (getDayBoundaries): Deleted.
+        (beginningOfDay): Deleted.
+        (dateKey): Deleted.
+        * WebNotificationCenter.cpp:
+        (WebNotificationCenter::removeObserver): -Wunused-variable
+        * WebView.cpp: -Wunused-function, -Wreorder
+        (WebView::addVisitedLinks): -Wunused-variable
+
 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r242688, r242643, r242624.
index 0348f8f..5d4f298 100644 (file)
@@ -31,7 +31,7 @@ import "ocidl.idl";
 import "oleacc.idl";
 import "Accessible2_2.idl";
 
-cpp_quote("extern const GUID  __declspec(selectany) SID_AccessibleComparable = { 0x62b8cb5f, 0xfb7a, 0x4faf, 0x81, 0xe8, 0x52, 0xb6, 0x5f, 0x12, 0x8b, 0x31 };")
+cpp_quote("extern const GUID  __declspec(selectany) SID_AccessibleComparable = { 0x62b8cb5f, 0xfb7a, 0x4faf, { 0x81, 0xe8, 0x52, 0xb6, 0x5f, 0x12, 0x8b, 0x31 } };")
 
 [
     object,
index 807a9c1..583495c 100644 (file)
@@ -268,56 +268,6 @@ static inline void addAdobeAcrobatPluginDirectory(Vector<String>& directories)
     RegCloseKey(key);
 }
 
-static inline void addJavaPluginDirectory(Vector<String>& directories)
-{
-    HKEY key;
-    HRESULT result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\JavaSoft\\Java Plug-in"), 0, KEY_READ, &key);
-    if (result != ERROR_SUCCESS)
-        return;
-
-    WCHAR name[128];
-    FILETIME lastModified;
-
-    Vector<int> latestJavaVersion;
-    String latestJavaVersionString;
-
-    // Enumerate subkeys
-    for (int i = 0;; i++) {
-        DWORD nameLen = sizeof(name) / sizeof(WCHAR);
-        result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
-
-        if (result != ERROR_SUCCESS)
-            break;
-
-        Vector<int> javaVersion = parseVersionString(String(name, nameLen));
-        if (compareVersions(javaVersion, latestJavaVersion)) {
-            latestJavaVersion = javaVersion;
-            latestJavaVersionString = String(name, nameLen);
-        }
-    }
-
-    if (!latestJavaVersionString.isEmpty()) {
-        DWORD type;
-        WCHAR javaInstallPathStr[_MAX_PATH];
-        DWORD javaInstallPathSize = sizeof(javaInstallPathStr);
-        DWORD useNewPluginValue;
-        DWORD useNewPluginSize;
-
-        String javaPluginKeyPath = "Software\\JavaSoft\\Java Plug-in\\" + latestJavaVersionString;
-        result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.wideCharacters().data(), L"UseNewJavaPlugin", &type, &useNewPluginValue, &useNewPluginSize);
-
-        if (result == ERROR_SUCCESS && useNewPluginValue == 1) {
-            result = getRegistryValue(HKEY_LOCAL_MACHINE, javaPluginKeyPath.wideCharacters().data(), L"JavaHome", &type, javaInstallPathStr, &javaInstallPathSize);
-            if (result == ERROR_SUCCESS) {
-                String javaPluginDirectory = String(javaInstallPathStr, javaInstallPathSize / sizeof(WCHAR) - 1) + "\\bin\\new_plugin";
-                directories.append(javaPluginDirectory);
-            }
-        }
-    }
-
-    RegCloseKey(key);
-}
-
 static inline String safariPluginsDirectory()
 {
     WCHAR moduleFileNameStr[_MAX_PATH];
index a52b120..ae47e30 100644 (file)
@@ -53,9 +53,9 @@ using namespace WebCore;
 
 AcceleratedCompositingContext::AcceleratedCompositingContext(WebView& webView)
     : m_webView(webView)
-    , m_layerFlushTimer(*this)
     , m_context(nullptr)
     , m_window(0)
+    , m_layerFlushTimer(*this)
 {
 }
 
index 910be87..f72b6b5 100644 (file)
@@ -521,9 +521,9 @@ private:
 };
 
 WebEditorUndoCommand::WebEditorUndoCommand(UndoStep& step, bool isUndo)
-    : m_step(step)
-    , m_isUndo(isUndo) 
-    , m_refCount(1)
+    : m_refCount(1)
+    , m_step(step)
+    , m_isUndo(isUndo)
 { 
 }
 
@@ -623,8 +623,8 @@ static String undoNameForEditAction(EditAction editAction)
     case EditAction::FormatBlock: return WEB_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name");
     case EditAction::Indent: return WEB_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name");
     case EditAction::Outdent: return WEB_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name");
+    default: return String();
     }
-    return String();
 }
 
 void WebEditorClient::registerUndoStep(UndoStep& step)
index 11595b2..f314b0a 100644 (file)
@@ -107,9 +107,9 @@ public:
 };
 
 WebFrameLoaderClient::WebFrameLoaderClient(WebFrame* webFrame)
-    : m_webFrame(webFrame)
+    : m_policyListenerPrivate(std::make_unique<WebFramePolicyListenerPrivate>())
+    , m_webFrame(webFrame)
     , m_manualLoader(0)
-    , m_policyListenerPrivate(std::make_unique<WebFramePolicyListenerPrivate>())
     , m_hasSentResponseToPlugin(false) 
 {
 }
@@ -745,8 +745,6 @@ void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
     COMPtr<IWebHistoryDelegate> historyDelegate;
     webView->historyDelegate(&historyDelegate);
 
-    WebHistory* history = WebHistory::sharedHistory();
-
     DocumentLoader* loader = core(m_webFrame)->loader().documentLoader();
     ASSERT(loader->unreachableURL().isEmpty());
 
index 06ac11c..b2daedb 100644 (file)
@@ -219,8 +219,8 @@ WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView
     : InspectorFrontendClientLocal(&inspectedWebView->page()->inspectorController(),  core(frontendWebView.get()), WTFMove(settings))
     , m_inspectedWebView(inspectedWebView)
     , m_inspectedWebViewHwnd(inspectedWebViewHwnd)
-    , m_inspectorClient(inspectorClient)
     , m_frontendHwnd(frontendHwnd)
+    , m_inspectorClient(inspectorClient)
     , m_frontendWebView(frontendWebView)
     , m_frontendWebViewHwnd(frontendWebViewHwnd)
     , m_attached(false)
index edde6f5..7966cf2 100644 (file)
@@ -128,7 +128,7 @@ private:
     LRESULT onClose(WPARAM, LPARAM);
     LRESULT onSetFocus();
 
-    virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM);
+    void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM) override;
 
     void onWebViewWindowPosChanging(WPARAM, LPARAM);
 
index 7c2d10a..a674405 100644 (file)
@@ -42,8 +42,8 @@ using namespace WebCore;
 // WebError ---------------------------------------------------------------------
 
 WebError::WebError(const ResourceError& error, IPropertyBag* userInfo)
-    : m_error(error)
-    , m_userInfo(userInfo)
+    : m_userInfo(userInfo)
+    , m_error(error)
 {
     gClassCount++;
     gClassNameCount().add("WebError");
index 4ad3166..d1c4cf5 100644 (file)
@@ -2019,7 +2019,7 @@ HRESULT WebFrame::stringByEvaluatingJavaScriptInScriptWorld(IWebScriptWorld* iWo
     // This bizarre set of rules matches behavior from WebKit for Safari 2.0.
     // If you don't like it, use -[WebScriptObject evaluateWebScript:] or 
     // JSEvaluateScript instead, since they have less surprising semantics.
-    if (!result || !result.isBoolean() && !result.isString() && !result.isNumber())
+    if (!result || (!result.isBoolean() && !result.isString() && !result.isNumber()))
         return S_OK;
 
     JSC::ExecState* exec = anyWorldGlobalObject->globalExec();
index ff9da24..de2b362 100644 (file)
 
 using namespace WebCore;
 
-static bool areEqualOrClose(double d1, double d2)
-{
-    double diff = d1-d2;
-    return (diff < .000001 && diff > -.000001);
-}
-
 static COMPtr<IPropertyBag> createUserInfoFromArray(BSTR notificationStr, IWebHistoryItem** data, size_t size)
 {
 #if USE(CF)
@@ -91,65 +85,6 @@ static inline COMPtr<IPropertyBag> createUserInfoFromHistoryItem(BSTR notificati
     return createUserInfoFromArray(notificationStr, &item, 1);
 }
 
-static inline void addDayToSystemTime(SYSTEMTIME& systemTime)
-{
-    systemTime.wDay += 1;
-    if (systemTime.wDay > 31) {
-        systemTime.wDay = 1;
-        systemTime.wMonth += 1;
-    }
-    if (systemTime.wMonth > 12) {
-        systemTime.wMonth = 1;
-        systemTime.wYear += 1;
-    }
-
-    // Convert to and from VariantTime to fix invalid dates like 2001-04-31.
-    DATE date = 0.0;
-    ::SystemTimeToVariantTime(&systemTime, &date);
-    ::VariantTimeToSystemTime(date, &systemTime);
-}
-
-static void getDayBoundaries(DATE day, DATE& beginningOfDay, DATE& beginningOfNextDay)
-{
-    SYSTEMTIME systemTime;
-    ::VariantTimeToSystemTime(day, &systemTime);
-
-    SYSTEMTIME beginningLocalTime;
-    ::SystemTimeToTzSpecificLocalTime(0, &systemTime, &beginningLocalTime);
-    beginningLocalTime.wHour = 0;
-    beginningLocalTime.wMinute = 0;
-    beginningLocalTime.wSecond = 0;
-    beginningLocalTime.wMilliseconds = 0;
-
-    SYSTEMTIME beginningOfNextDayLocalTime = beginningLocalTime;
-    addDayToSystemTime(beginningOfNextDayLocalTime);
-
-    SYSTEMTIME beginningSystemTime;
-    if (::TzSpecificLocalTimeToSystemTime(0, &beginningLocalTime, &beginningSystemTime))
-        ::SystemTimeToVariantTime(&beginningSystemTime, &beginningOfDay);
-
-    SYSTEMTIME beginningOfNextDaySystemTime;
-    if (::TzSpecificLocalTimeToSystemTime(0, &beginningOfNextDayLocalTime, &beginningOfNextDaySystemTime))
-        ::SystemTimeToVariantTime(&beginningOfNextDaySystemTime, &beginningOfNextDay);
-}
-
-static inline DATE beginningOfDay(DATE date)
-{
-    static DATE cachedBeginningOfDay = std::numeric_limits<DATE>::quiet_NaN();
-    static DATE cachedBeginningOfNextDay;
-    if (!(date >= cachedBeginningOfDay && date < cachedBeginningOfNextDay))
-        getDayBoundaries(date, cachedBeginningOfDay, cachedBeginningOfNextDay);
-    return cachedBeginningOfDay;
-}
-
-static inline WebHistory::DateKey dateKey(DATE date)
-{
-    // Converting from double (DATE) to int64_t (WebHistoryDateKey) is safe
-    // here because all sensible dates are in the range -2**48 .. 2**47 which
-    // safely fits in an int64_t.
-    return beginningOfDay(date) * secondsPerDay;
-}
-
 // WebHistory -----------------------------------------------------------------
 
 WebHistory::WebHistory()
index f57f7e3..7bd9889 100644 (file)
@@ -189,8 +189,6 @@ HRESULT WebNotificationCenter::removeObserver(_In_opt_ IWebNotificationObserver*
         return E_FAIL;
 
     ObjectObserverList& observerList = it->value;
-    ObserverListIterator end = observerList.end();
-
     observerList.removeFirstMatching([anObject, anObserver] (const ObjectObserverPair& pair) {
         IUnknown* observedObject = pair.first.get();
         IWebNotificationObserver* observer = pair.second.get();
index b4d228f..27236bb 100644 (file)
@@ -389,8 +389,6 @@ static const int maxToolTipWidth = 250;
 
 static const int delayBeforeDeletingBackingStoreMsec = 5000;
 
-static ATOM registerWebView();
-
 static void initializeStaticObservers();
 
 static HRESULT updateSharedSettingsFromPreferencesIfNeeded(IWebPreferences*);
@@ -7107,8 +7105,6 @@ HRESULT WebView::historyDelegate(_COM_Outptr_opt_ IWebHistoryDelegate** historyD
 HRESULT WebView::addVisitedLinks(__inout_ecount_full(visitedURLCount) BSTR* visitedURLs, unsigned visitedURLCount)
 {
     auto& visitedLinkStore = m_webViewGroup->visitedLinkStore();
-    PageGroup& group = core(this)->group();
-    
     for (unsigned i = 0; i < visitedURLCount; ++i) {
         BSTR url = visitedURLs[i];
         unsigned length = SysStringLen(url);
@@ -7404,7 +7400,9 @@ class EnumTextMatches final : public IEnumTextMatches
     UINT m_index;
     Vector<IntRect> m_rects;
 public:
-    EnumTextMatches(Vector<IntRect>* rects) : m_index(0), m_ref(1)
+    EnumTextMatches(Vector<IntRect>* rects)
+        : m_ref(1)
+        , m_index(0)
     {
         m_rects = *rects;
     }
index 47cf230..9d23c86 100644 (file)
@@ -1,3 +1,13 @@
+2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
+
+        [Win] Fix a slew of simple clang-cl warnings.
+        https://bugs.webkit.org/show_bug.cgi?id=195652
+
+        Reviewed by Don Olmstead.
+
+        * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+        (WTR::PlatformWebView::windowSnapshotImage): -Wunused-variable
+
 2019-03-12  Justin Fan  <justin_fan@apple.com>
 
         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
index 2c3c3fd..7879457 100644 (file)
@@ -212,7 +212,6 @@ cairo_surface_t* PlatformWebView::windowSnapshotImage()
     auto memoryDC = adoptGDIObject(::CreateCompatibleDC(windowDC));
 
     BITMAPINFO bitmapInfo { };
-    WKRect wkFrame = windowFrame();
     bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
     bitmapInfo.bmiHeader.biWidth = width;
     bitmapInfo.bmiHeader.biHeight = -height;