WebKit Bugzilla
Attachment 342770 Details for
Bug 186633
: [Win][MiniBrowser] Change to use WebKit by default if it's available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
FIX
186633.diff (text/plain), 5.84 KB, created by
Basuke Suzuki
on 2018-06-14 15:52:10 PDT
(
hide
)
Description:
FIX
Filename:
MIME Type:
Creator:
Basuke Suzuki
Created:
2018-06-14 15:52:10 PDT
Size:
5.84 KB
patch
obsolete
>diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index f0df078584d..7ec506d8d5a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,21 @@ >+2018-06-14 Basuke Suzuki <Basuke.Suzuki@sony.com> >+ >+ [Win][MiniBrowser] Change to use WebKit by default if it's available >+ https://bugs.webkit.org/show_bug.cgi?id=186633 >+ >+ When MiniBrowser is built with WebKit, use it by default. Also add command >+ line switch for WebKitLegacy. >+ >+ Reviewed by Youenn Fablet. >+ >+ * MiniBrowser/win/Common.cpp: >+ (parseCommandLine): >+ (dllLauncherEntryPoint): Deleted. >+ * MiniBrowser/win/Common.h: >+ * MiniBrowser/win/WinMain.cpp: >+ (wWinMain): >+ (dllLauncherEntryPoint): >+ > 2018-06-14 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [GTK] Enable tests on the GTK EWS queue >diff --git a/Tools/MiniBrowser/win/Common.cpp b/Tools/MiniBrowser/win/Common.cpp >index fa25f542d35..3588fc43b3f 100644 >--- a/Tools/MiniBrowser/win/Common.cpp >+++ b/Tools/MiniBrowser/win/Common.cpp >@@ -165,29 +165,30 @@ HRESULT displayAuthDialog(HWND hwnd, std::wstring& username, std::wstring& passw > return result > 0 ? S_OK : E_FAIL; > } > >-void parseCommandLine(bool& usesLayeredWebView, bool& useFullDesktop, bool& pageLoadTesting, _bstr_t& requestedURL) >+CommandLineOptions parseCommandLine() > { >- usesLayeredWebView = false; >- useFullDesktop = false; >- pageLoadTesting = false; >+ CommandLineOptions options; > > int argc = 0; > WCHAR** argv = CommandLineToArgvW(GetCommandLineW(), &argc); > for (int i = 1; i < argc; ++i) { > if (!wcsicmp(argv[i], L"--transparent")) >- usesLayeredWebView = true; >+ options.usesLayeredWebView = true; > else if (!wcsicmp(argv[i], L"--desktop")) >- useFullDesktop = true; >+ options.useFullDesktop = true; > else if (!wcsicmp(argv[i], L"--performance")) >- pageLoadTesting = true; >+ options.pageLoadTesting = true; > else if (!wcsicmp(argv[i], L"--highDPI")) > continue; // ignore >- else if (!requestedURL) >- requestedURL = argv[i]; >+ else if (!wcsicmp(argv[i], L"--wk1") || !wcsicmp(argv[i], L"--legacy")) >+ options.windowType = MainWindow::BrowserWindowType::WebKitLegacy; >+#if ENABLE(WEBKIT) >+ else if (!wcsicmp(argv[i], L"--wk2") || !wcsicmp(argv[i], L"--webkit")) >+ options.windowType = MainWindow::BrowserWindowType::WebKit; >+#endif >+ else if (!options.requestedURL) >+ options.requestedURL = argv[i]; > } >-} > >-extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow) >-{ >- return wWinMain(hInstance, hPrevInstance, lpstrCmdLine, nCmdShow); >+ return options; > } >diff --git a/Tools/MiniBrowser/win/Common.h b/Tools/MiniBrowser/win/Common.h >index 985fe7744c3..085a31301ca 100644 >--- a/Tools/MiniBrowser/win/Common.h >+++ b/Tools/MiniBrowser/win/Common.h >@@ -29,9 +29,26 @@ > #include "MainWindow.h" > #include "WebKitLegacyBrowserWindow.h" > >+struct CommandLineOptions { >+ bool usesLayeredWebView { }; >+ bool useFullDesktop { }; >+ bool pageLoadTesting { }; >+ MainWindow::BrowserWindowType windowType; >+ _bstr_t requestedURL; >+ >+ CommandLineOptions() >+#if ENABLE(WEBKIT) >+ : windowType(MainWindow::BrowserWindowType::WebKit) >+#else >+ : windowType(MainWindow::BrowserWindowType::WebKitLegacy) >+#endif >+ { >+ } >+}; >+ > void computeFullDesktopFrame(); > bool getAppDataFolder(_bstr_t& directory); >-void parseCommandLine(bool& usesLayeredWebView, bool& useFullDesktop, bool& pageLoadTesting, _bstr_t& requestedURL); >+CommandLineOptions parseCommandLine(); > void createCrashReport(EXCEPTION_POINTERS*); > HRESULT displayAuthDialog(HWND, std::wstring& username, std::wstring& password); > >diff --git a/Tools/MiniBrowser/win/WinMain.cpp b/Tools/MiniBrowser/win/WinMain.cpp >index c96a677c74f..426a09eb0e6 100644 >--- a/Tools/MiniBrowser/win/WinMain.cpp >+++ b/Tools/MiniBrowser/win/WinMain.cpp >@@ -50,14 +50,9 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, > InitCtrlEx.dwICC = 0x00004000; // ICC_STANDARD_CLASSES; > InitCommonControlsEx(&InitCtrlEx); > >- bool usesLayeredWebView = false; >- bool useFullDesktop = false; >- bool pageLoadTesting = false; >- _bstr_t requestedURL; >+ auto options = parseCommandLine(); > >- parseCommandLine(usesLayeredWebView, useFullDesktop, pageLoadTesting, requestedURL); >- >- if (useFullDesktop) >+ if (options.useFullDesktop) > computeFullDesktopFrame(); > > // Init COM >@@ -65,8 +60,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, > > ::SetProcessDPIAware(); > >- auto& mainWindow = MainWindow::create(MainWindow::BrowserWindowType::WebKitLegacy).leakRef(); >- HRESULT hr = mainWindow.init(hInst, usesLayeredWebView, pageLoadTesting); >+ auto& mainWindow = MainWindow::create(options.windowType).leakRef(); >+ HRESULT hr = mainWindow.init(hInst, options.usesLayeredWebView, options.pageLoadTesting); > if (FAILED(hr)) > goto exit; > >@@ -74,8 +69,8 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, > > hAccelTable = LoadAccelerators(hInst, MAKEINTRESOURCE(IDC_MINIBROWSER)); > >- if (requestedURL.length()) >- mainWindow.loadURL(requestedURL.GetBSTR()); >+ if (options.requestedURL.length()) >+ mainWindow.loadURL(options.requestedURL.GetBSTR()); > else > mainWindow.browserWindow()->loadHTMLString(_bstr_t(defaultHTML).GetBSTR()); > >@@ -104,3 +99,8 @@ exit: > > return static_cast<int>(msg.wParam); > } >+ >+extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow) >+{ >+ return wWinMain(hInstance, hPrevInstance, lpstrCmdLine, nCmdShow); >+}
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186633
:
342763
| 342770