Native and Java CommandLine objects disagree on which flags are set |
|||
Issue descriptionI'm trying to append "--webview-enable-safebrowsing-support" in aw_main_delegate.cc, but this isn't seen by the Java side (CommandLine.getInstance()) in AwSafeBrowsingConfigHelper.java. Is this a bug? Is there a better way to add a flag for WebView by default? An obvious workaround is to change the default logic to do what I want, but it'd be nice to enable by CLI switch. --- Paul, do both native and Java pick up finch switches? Tentatively blocking the finch bug until we get an answer.
,
Nov 7 2017
The java command line implementation changes at run time, from java-only to java-native. Once it's switched to java-native, each hasSwitch call should just delegate to the native one, which should show native AppendSwitch. So the question is what triggers the implementation switch exactly..
,
Nov 7 2017
Handling of CommandLine was changed recently here: https://chromium-review.googlesource.com/#/c/chromium/src/+/698304/ Possibly related? Is this bug a regression? (does your same change work if you undo that CL?)
,
Nov 7 2017
The switchover happens in CommandLine.enableNativeProxy(), called by LibraryLoader.ensureCommandLineSwitchedAlreadyLocked(), which is for WebView called by LibraryLoader.switchCommandLineForWebView(). In principle that should happen right after the library is loaded, so before any other native code runs. What does CommandLine.getInstance().isNativeImplementation() return? If it returns false, the switchover hasn't happened yet.
,
Nov 8 2017
Ah, so it looks like my Java function was called before we load aw_main_delegate.cc (so the likely reason is just that the flag wasn't set yet). I think an OK fix for me is to put the Safe Browsing method call [1] below the startBrowserProcessesSync call [2]. I'll close this and open a bug to reorder these lines for Safe Browsing. Unblocking the finch bug, since I don't think this will impact it. [1] https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java?type=cs&q=maybeEnableSafeBrowsingFromManifest&sq=package:chromium&l=115 [2] https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java?type=cs&q=maybeEnableSafeBrowsingFromManifest&sq=package:chromium&l=119 |
|||
►
Sign in to add a comment |
|||
Comment 1 by ntfschr@chromium.org
, Nov 7 2017