Bug 186633 - [Win][MiniBrowser] Change to use WebKit by default if it's available
Summary: [Win][MiniBrowser] Change to use WebKit by default if it's available
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 174003
  Show dependency treegraph
 
Reported: 2018-06-14 14:25 PDT by Basuke Suzuki
Modified: 2018-06-14 17:24 PDT (History)
8 users (show)

See Also:


Attachments
PATCH (4.72 KB, patch)
2018-06-14 14:45 PDT, Basuke Suzuki
youennf: review+
Details | Formatted Diff | Diff
FIX (5.84 KB, patch)
2018-06-14 15:52 PDT, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Basuke Suzuki 2018-06-14 14:25:36 PDT
Add command line switch for WebKit
Comment 1 Basuke Suzuki 2018-06-14 14:43:36 PDT
Add command line switch to use WebKit or WebKitLegacy
Comment 2 Basuke Suzuki 2018-06-14 14:45:22 PDT
Created attachment 342763 [details]
PATCH
Comment 3 youenn fablet 2018-06-14 15:30:58 PDT
Comment on attachment 342763 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=342763&action=review

> Tools/MiniBrowser/win/Common.cpp:168
> +void parseCommandLine(bool& usesLayeredWebView, bool& useFullDesktop, bool& pageLoadTesting, MainWindow::BrowserWindowType& windowType, _bstr_t& requestedURL)

Maybe it should return a struct of all parameters.

> Tools/MiniBrowser/win/WinMain.cpp:56
> +    MainWindow::BrowserWindowType windowType = MainWindow::BrowserWindowType::WebKitLegacy;

Why is it legacy here?
If parseCommandLine was returning a struct, there would be no need for setting these default values.

> Tools/MiniBrowser/win/WinMain.cpp:109
> +extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow)

Isn't it already defined in Tools/MiniBrowser/win/Common.cpp?
Comment 4 Basuke Suzuki 2018-06-14 15:34:40 PDT
Comment on attachment 342763 [details]
PATCH

View in context: https://bugs.webkit.org/attachment.cgi?id=342763&action=review

>> Tools/MiniBrowser/win/Common.cpp:168
>> +void parseCommandLine(bool& usesLayeredWebView, bool& useFullDesktop, bool& pageLoadTesting, MainWindow::BrowserWindowType& windowType, _bstr_t& requestedURL)
> 
> Maybe it should return a struct of all parameters.

Make sense.

>> Tools/MiniBrowser/win/WinMain.cpp:56
>> +    MainWindow::BrowserWindowType windowType = MainWindow::BrowserWindowType::WebKitLegacy;
> 
> Why is it legacy here?
> If parseCommandLine was returning a struct, there would be no need for setting these default values.

Got it.

>> Tools/MiniBrowser/win/WinMain.cpp:109
>> +extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpstrCmdLine, int nCmdShow)
> 
> Isn't it already defined in Tools/MiniBrowser/win/Common.cpp?

Moved from Common.cpp. Common.cpp was originally included from WinMain.cpp and it is now separate code to be compiled. It is more natural to put entry point to the same source file.
Comment 5 Basuke Suzuki 2018-06-14 15:52:10 PDT
Created attachment 342770 [details]
FIX

Thanks youenn for r+.
Comment 6 EWS 2018-06-14 15:52:17 PDT
Comment on attachment 342770 [details]
FIX

Rejecting attachment 342770 [details] from commit-queue.

Basuke.Suzuki@sony.com does not have committer permissions according to https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 7 youenn fablet 2018-06-14 15:53:59 PDT
Comment on attachment 342770 [details]
FIX

View in context: https://bugs.webkit.org/attachment.cgi?id=342770&action=review

> Tools/MiniBrowser/win/Common.h:36
> +    MainWindow::BrowserWindowType windowType;

You could probably initialise its value there too so that you do not need the constructor.
Comment 8 Basuke Suzuki 2018-06-14 16:18:39 PDT
Comment on attachment 342770 [details]
FIX

View in context: https://bugs.webkit.org/attachment.cgi?id=342770&action=review

>> Tools/MiniBrowser/win/Common.h:36
>> +    MainWindow::BrowserWindowType windowType;
> 
> You could probably initialise its value there too so that you do not need the constructor.

But the default value is conditional. I tried to put them here with #if block, but it seems so unnatural. I saw many examples of constructors with conditional initialization, so it comfortable for me. What do you think?
Comment 9 youenn fablet 2018-06-14 16:42:15 PDT
(In reply to Basuke Suzuki from comment #8)
> Comment on attachment 342770 [details]
> FIX
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=342770&action=review
> 
> >> Tools/MiniBrowser/win/Common.h:36
> >> +    MainWindow::BrowserWindowType windowType;
> > 
> > You could probably initialise its value there too so that you do not need the constructor.
> 
> But the default value is conditional. I tried to put them here with #if
> block, but it seems so unnatural. I saw many examples of constructors with
> conditional initialization, so it comfortable for me. What do you think?

I guess you could use a macro but the constructor is fine too.
Comment 10 Basuke Suzuki 2018-06-14 16:56:13 PDT
Thanks. I go with constructor now.
Comment 11 WebKit Commit Bot 2018-06-14 17:23:09 PDT
Comment on attachment 342770 [details]
FIX

Clearing flags on attachment: 342770

Committed r232862: <https://trac.webkit.org/changeset/232862>
Comment 12 WebKit Commit Bot 2018-06-14 17:23:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2018-06-14 17:24:21 PDT
<rdar://problem/41145521>