WebKit Bugzilla
Attachment 357804 Details for
Bug 192924
: [Win][Clang] Fix compilation warnings of DumpRenderTree
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192924-20181220191952.patch (text/plain), 11.75 KB, created by
Fujii Hironori
on 2018-12-20 02:19:53 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2018-12-20 02:19:53 PST
Size:
11.75 KB
patch
obsolete
>Subversion Revision: 239436 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 070e9778b18f1c95bee76c4c8cc19ce739f845b2..aed2997dac3fa5bc6b33243f52c6de1406037dec 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,33 @@ >+2018-12-20 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ [Win][Clang] Fix compilation warnings of DumpRenderTree >+ https://bugs.webkit.org/show_bug.cgi?id=192924 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DumpRenderTree/AccessibilityController.h: Added member variable initializations in the class definition. >+ * DumpRenderTree/win/AccessibilityControllerWin.cpp: >+ (AccessibilityController::AccessibilityController): Moved member variable initializations to the class definition. >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (dumpHistoryItem): String literals can't be converted non-const type. Use auto for them. >+ (resetWebPreferencesToConsistentValues): Pass a temporal _bstr_t >+ object to the argument of setDefaultTextEncodingName instead of a >+ const string literal. >+ (createWebViewAndOffscreenWindow): Use %lx for HRESULT (aka 'long'). >+ (main): Exit if _dup2 fails. Use %lu for'DWORD'(aka 'unsigned long'). >+ (setCacheFolder): Deleted. >+ * DumpRenderTree/win/DumpRenderTreeWin.h: Fix class/struct mismatch of FrameLoadDelegate and PolicyDelegate declarations. >+ * DumpRenderTree/win/EditingDelegate.cpp: >+ (dump): Use %d for int. >+ * DumpRenderTree/win/FrameLoadDelegate.cpp: Removed unused variable g_delegateWaitingOnTimer. >+ * DumpRenderTree/win/ResourceLoadDelegate.cpp: >+ (BSTRFromString): Deleted unused function. >+ * DumpRenderTree/win/TestRunnerWin.cpp: >+ (TestRunner::setDatabaseQuota): Pass a temporal _bstr_t object to >+ the arguemnt of setQuota instead of const string lateral. >+ * DumpRenderTree/win/WorkQueueItemWin.cpp: >+ (jsStringRefToWString): Deleted unused function. >+ > 2018-12-20 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Bump webkitgtk-test-fonts to 0.0.8 >diff --git a/Tools/DumpRenderTree/AccessibilityController.h b/Tools/DumpRenderTree/AccessibilityController.h >index 8ec28c233586d5be49edf3203f0e7ea0921cf761..e73a2c27d17722d124d14251b90b65521085a31c 100644 >--- a/Tools/DumpRenderTree/AccessibilityController.h >+++ b/Tools/DumpRenderTree/AccessibilityController.h >@@ -84,12 +84,12 @@ private: > static JSClassRef getJSClass(); > > #if PLATFORM(WIN) >- HWINEVENTHOOK m_focusEventHook; >- HWINEVENTHOOK m_valueChangeEventHook; >- HWINEVENTHOOK m_scrollingStartEventHook; >+ HWINEVENTHOOK m_focusEventHook { nullptr }; >+ HWINEVENTHOOK m_valueChangeEventHook { nullptr }; >+ HWINEVENTHOOK m_scrollingStartEventHook { nullptr }; > >- HWINEVENTHOOK m_allEventsHook; >- HWINEVENTHOOK m_notificationsEventHook; >+ HWINEVENTHOOK m_allEventsHook { nullptr }; >+ HWINEVENTHOOK m_notificationsEventHook { nullptr }; > HashMap<PlatformUIElement, JSObjectRef> m_notificationListeners; > #endif > >diff --git a/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp >index f416482da62d259a4738fa99480afb689645a27c..b414619879955b87870d62c7e4a9e462444e9c99 100644 >--- a/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp >+++ b/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp >@@ -42,14 +42,7 @@ > #include <wtf/Assertions.h> > #include <wtf/text/AtomicString.h> > >-AccessibilityController::AccessibilityController() >- : m_focusEventHook(0) >- , m_scrollingStartEventHook(0) >- , m_valueChangeEventHook(0) >- , m_allEventsHook(0) >- , m_notificationsEventHook(0) >-{ >-} >+AccessibilityController::AccessibilityController() = default; > > AccessibilityController::~AccessibilityController() > { >diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >index 8e0929a2f7a77147d1dc6eeccc2f5097044e27ef..a4b5c77070890a5cf142d2d9c8b3c3386483e6ed 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp >+++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp >@@ -524,8 +524,8 @@ static void dumpHistoryItem(IWebHistoryItem* item, int indent, bool current) > return; > > if (wcsstr(static_cast<wchar_t*>(url), L"file:/") == static_cast<wchar_t*>(url)) { >- static wchar_t* layoutTestsStringUnixPath = L"/LayoutTests/"; >- static wchar_t* layoutTestsStringDOSPath = L"\\LayoutTests\\"; >+ auto layoutTestsStringUnixPath = L"/LayoutTests/"; >+ auto layoutTestsStringDOSPath = L"\\LayoutTests\\"; > > wchar_t* result = wcsstr(static_cast<wchar_t*>(url), layoutTestsStringUnixPath); > if (!result) >@@ -832,7 +832,7 @@ static void resetWebPreferencesToConsistentValues(IWebPreferences* preferences) > preferences->setDefaultFontSize(16); > preferences->setDefaultFixedFontSize(13); > preferences->setMinimumFontSize(0); >- preferences->setDefaultTextEncodingName(L"ISO-8859-1"); >+ preferences->setDefaultTextEncodingName(_bstr_t(L"ISO-8859-1")); > preferences->setJavaEnabled(FALSE); > preferences->setJavaScriptEnabled(TRUE); > preferences->setEditableLinkBehavior(WebKitEditableLinkOnlyLiveWithShiftKey); >@@ -919,17 +919,6 @@ static void setApplicationId() > } > } > >-static void setCacheFolder() >-{ >- String libraryPath = libraryPathForDumpRenderTree(); >- >- COMPtr<IWebCache> webCache; >- if (SUCCEEDED(WebKitCreateInstance(CLSID_WebCache, 0, IID_IWebCache, (void**)&webCache))) { >- _bstr_t cacheFolder = WebCore::FileSystem::pathByAppendingComponent(libraryPath, "LocalCache").utf8().data(); >- webCache->setCacheFolder(cacheFolder); >- } >-} >- > // Called once on DumpRenderTree startup. > static void setDefaultsToConsistentValuesForTesting() > { >@@ -1338,7 +1327,7 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow) > IWebView* webView = nullptr; > HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, (void**)&webView); > if (FAILED(hr)) { >- fprintf(stderr, "Failed to create CLSID_WebView instance, error 0x%x\n", hr); >+ fprintf(stderr, "Failed to create CLSID_WebView instance, error 0x%lx\n", hr); > return nullptr; > } > >@@ -1542,6 +1531,8 @@ int main(int argc, const char* argv[]) > testResult = fdopen(fdStdout, "a+b"); > // Redirect stdout to stderr. > int result = _dup2(_fileno(stderr), 1); >+ if (result) >+ return -5; > > // Tests involving the clipboard are flaky when running with multiple DRTs, since the clipboard is global. > // We can fix this by assigning each DRT a separate window station (each window station has its own clipboard). >@@ -1553,14 +1544,14 @@ int main(int argc, const char* argv[]) > auto windowsStation = ::CreateWindowStation(windowStationName.charactersWithNullTermination().data(), CWF_CREATE_ONLY, WINSTA_ALL_ACCESS, nullptr); > if (windowsStation) { > if (!::SetProcessWindowStation(windowsStation)) >- fprintf(stderr, "SetProcessWindowStation failed with error %d\n", ::GetLastError()); >+ fprintf(stderr, "SetProcessWindowStation failed with error %lu\n", ::GetLastError()); > > desktop = ::CreateDesktop(desktopName.charactersWithNullTermination().data(), nullptr, nullptr, 0, GENERIC_ALL, nullptr); > if (!desktop) >- fprintf(stderr, "Failed to create desktop with error %d\n", ::GetLastError()); >+ fprintf(stderr, "Failed to create desktop with error %lu\n", ::GetLastError()); > } else { > DWORD error = ::GetLastError(); >- fprintf(stderr, "Failed to create window station with error %d\n", error); >+ fprintf(stderr, "Failed to create window station with error %lu\n", error); > if (error == ERROR_ACCESS_DENIED) > fprintf(stderr, "DumpRenderTree should be run as Administrator!\n"); > } >diff --git a/Tools/DumpRenderTree/win/DumpRenderTreeWin.h b/Tools/DumpRenderTree/win/DumpRenderTreeWin.h >index 45e7423f8bd1ec8ae92f3649d209c6aa63d63c37..0cf94f246f3edf971e8c400b59310d416fda0a25 100644 >--- a/Tools/DumpRenderTree/win/DumpRenderTreeWin.h >+++ b/Tools/DumpRenderTree/win/DumpRenderTreeWin.h >@@ -32,8 +32,8 @@ > struct IWebFrame; > struct IWebScriptWorld; > struct IWebView; >-struct FrameLoadDelegate; >-struct PolicyDelegate; >+class FrameLoadDelegate; >+class PolicyDelegate; > typedef const struct __CFString* CFStringRef; > typedef struct HWND__* HWND; > >diff --git a/Tools/DumpRenderTree/win/EditingDelegate.cpp b/Tools/DumpRenderTree/win/EditingDelegate.cpp >index 6aa10f07b183d286d373d72e69c76f8474b95513..a185d1f16c632b7c7130344e397cdfc720a0ec78 100644 >--- a/Tools/DumpRenderTree/win/EditingDelegate.cpp >+++ b/Tools/DumpRenderTree/win/EditingDelegate.cpp >@@ -120,7 +120,7 @@ static std::string dump(IDOMRange* range) > return std::string(); > > char buffer[1024]; >- snprintf(buffer, ARRAYSIZE(buffer), "range from %ld of %s to %ld of %s", startOffset, dumpPath(startContainer.get()).c_str(), endOffset, dumpPath(endContainer.get()).c_str()); >+ snprintf(buffer, ARRAYSIZE(buffer), "range from %d of %s to %d of %s", startOffset, dumpPath(startContainer.get()).c_str(), endOffset, dumpPath(endContainer.get()).c_str()); > return buffer; > } > >diff --git a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp >index 3c9aeacd8313c29cd325e3cfaab83fc8254f1d3c..c80df1be5f2de47d3b831637ef6e9fbcd934c8e6 100644 >--- a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp >+++ b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp >@@ -51,8 +51,6 @@ > > using std::string; > >-static FrameLoadDelegate* g_delegateWaitingOnTimer; >- > string descriptionSuitableForTestResult(IWebFrame* webFrame) > { > COMPtr<IWebView> webView; >diff --git a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp >index e02cba71ab4ca8331e1104b0227f41e83e190921..1a41b1372ff876c3a615d19e924a43b8591faa3e 100644 >--- a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp >+++ b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp >@@ -52,14 +52,6 @@ static inline wstring wstringFromInt(int i) > return ss.str(); > } > >-static inline BSTR BSTRFromString(const string& str) >-{ >- int length = ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), 0, 0); >- BSTR result = ::SysAllocStringLen(0, length); >- ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), result, length); >- return result; >-} >- > wstring ResourceLoadDelegate::descriptionSuitableForTestResult(unsigned long identifier) const > { > IdentifierMap::const_iterator it = m_urlMap.find(identifier); >diff --git a/Tools/DumpRenderTree/win/TestRunnerWin.cpp b/Tools/DumpRenderTree/win/TestRunnerWin.cpp >index 974d4cc2bfe930c70735d006b2b0305630bed245..bea5931416edab54dd37c3f8fa65f9982547db5d 100644 >--- a/Tools/DumpRenderTree/win/TestRunnerWin.cpp >+++ b/Tools/DumpRenderTree/win/TestRunnerWin.cpp >@@ -448,7 +448,7 @@ void TestRunner::setDatabaseQuota(unsigned long long quota) > if (FAILED(tmpDatabaseManager->sharedWebDatabaseManager(&databaseManager))) > return; > >- databaseManager->setQuota(TEXT("file:///"), quota); >+ databaseManager->setQuota(_bstr_t("file:///"), quota); > } > > void TestRunner::goBack() >diff --git a/Tools/DumpRenderTree/win/WorkQueueItemWin.cpp b/Tools/DumpRenderTree/win/WorkQueueItemWin.cpp >index 70f03454410730b2aeff4e08e0cab60afe43be03..356a5f480d44d43b0d2eb3b20c04e0f3574e7e6b 100644 >--- a/Tools/DumpRenderTree/win/WorkQueueItemWin.cpp >+++ b/Tools/DumpRenderTree/win/WorkQueueItemWin.cpp >@@ -43,16 +43,6 @@ > > using std::wstring; > >-static wstring jsStringRefToWString(JSStringRef jsStr) >-{ >- size_t length = JSStringGetLength(jsStr); >- Vector<WCHAR> buffer(length + 1); >- memcpy(buffer.data(), JSStringGetCharactersPtr(jsStr), length * sizeof(WCHAR)); >- buffer[length] = '\0'; >- >- return buffer.data(); >-} >- > bool LoadItem::invoke() const > { > _bstr_t targetBSTR(JSStringCopyBSTR(m_target.get()), false);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
achristensen
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192924
: 357804