New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 782068 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Native and Java CommandLine objects disagree on which flags are set

Project Member Reported by ntfschr@chromium.org, Nov 7 2017

Issue description

I'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.
 
Er, I meant something more like "until we investigate and answer our question" (not pinning this on Paul, just making sure it's on the radar).

Comment 2 by boliu@chromium.org, 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..

Comment 3 by torne@chromium.org, Nov 7 2017

Cc: bauerb@chromium.org
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?)
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.
Blocking: -678288
Status: WontFix (was: Untriaged)
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