Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Issue 1888773004: 🙅 Bind a WebAPK to its "host" browser. (Closed)

Created:
4 years, 8 months ago by Yaron
Modified:
4 years, 8 months ago
Reviewers:
Xi Han, pkotwicz
CC:
chromium-reviews, darin-cc_chromium.org, jam, pkotwicz
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Bind a WebAPK to its "host" browser. WebAPKs are now tied to the host browser which minted them. Introduces a "runtimeHost" metadata field in the AndroidManifest for WebAPKs to track parent. Centralizes logic for retrieving the host browser in a new util class in webapk common library. Logically this should've been just in the WebAPK code, but LibraryLoader which is included in the host, can run insides the WebAPK when initializing a renderer process. Eventually this will allow us to enforce that only the host browser can bind to the WebAPK BUG=524670

Patch Set 1 #

Patch Set 2 : add util class #

Patch Set 3 : add template apk #

Total comments: 8

Patch Set 4 : xi comments #

Total comments: 8

Patch Set 5 : fix tests #

Total comments: 2

Patch Set 6 : rebase #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -116 lines) Patch
A apk_minter/assets/MintingExample.template.apk View 1 2 3 4 5 6 Binary file 0 comments Download
M apk_minter/axml-enddec/src/com/axml/enddec/BinaryXML.java View 1 chunk +3 lines, -0 lines 0 comments Download
M apk_minter/axml-enddec/src/com/axml/enddec/BinaryXMLParser.java View 2 chunks +7 lines, -2 lines 0 comments Download
M apk_minter/src/org/chromium/apkminter/APKMinting.java View 1 chunk +2 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java View 3 chunks +4 lines, -25 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java View 1 2 3 5 chunks +4 lines, -15 lines 0 comments Download
M content/public/android/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/android/shell_apk/AndroidManifest.xml.jinja2 View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M web_apks/minting_example/AndroidManifest.xml View 1 chunk +1 line, -0 lines 0 comments Download
M web_apks/minting_example/BUILD.gn View 1 2 3 4 4 chunks +9 lines, -1 line 0 comments Download
M web_apks/minting_example/javatests/src/org/chromium/minting/DexLoaderTest.java View 1 2 3 4 2 chunks +2 lines, -1 line 0 comments Download
M web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java View 1 2 3 4 5 3 chunks +5 lines, -5 lines 0 comments Download
M web_apks/minting_example/libs/common/org/chromium/minting/lib/common/WebAPKConstants.java View 1 chunk +0 lines, -4 lines 0 comments Download
A web_apks/minting_example/libs/common/org/chromium/minting/lib/common/WebAPKUtils.java View 1 2 3 4 5 1 chunk +58 lines, -0 lines 0 comments Download
M web_apks/minting_example/src/org/chromium/minting/DexLoader.java View 1 chunk +0 lines, -15 lines 0 comments Download
M web_apks/minting_example/src/org/chromium/minting/MainActivity.java View 1 2 3 4 chunks +3 lines, -21 lines 0 comments Download
M web_apks/minting_example/src/org/chromium/minting/MintingApplication.java View 3 chunks +7 lines, -18 lines 0 comments Download
M web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java View 1 2 3 4 5 6 3 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Yaron
4 years, 8 months ago (2016-04-15 14:16:27 UTC) #2
Xi Han
With this patch, no matter which browser launches a WebAPK, the WebAPK always loads its ...
4 years, 8 months ago (2016-04-15 14:46:49 UTC) #4
Yaron
https://codereview.chromium.org/1888773004/diff/40001/apk_minter/axml-enddec/src/com/axml/enddec/BinaryXMLParser.java File apk_minter/axml-enddec/src/com/axml/enddec/BinaryXMLParser.java (right): https://codereview.chromium.org/1888773004/diff/40001/apk_minter/axml-enddec/src/com/axml/enddec/BinaryXMLParser.java#newcode14 apk_minter/axml-enddec/src/com/axml/enddec/BinaryXMLParser.java:14: private final byte[] buf; On 2016/04/15 14:46:49, Xi Han ...
4 years, 8 months ago (2016-04-15 15:46:58 UTC) #5
pkotwicz
https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java File web_apks/minting_example/src/org/chromium/minting/DexLoader.java (left): https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java#oldcode30 web_apks/minting_example/src/org/chromium/minting/DexLoader.java:30: public static Context getRemoteContext(Context context, String remotePackageName) { Drive ...
4 years, 8 months ago (2016-04-15 15:51:31 UTC) #7
Yaron
https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java File web_apks/minting_example/src/org/chromium/minting/DexLoader.java (left): https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java#oldcode30 web_apks/minting_example/src/org/chromium/minting/DexLoader.java:30: public static Context getRemoteContext(Context context, String remotePackageName) { On ...
4 years, 8 months ago (2016-04-15 15:58:07 UTC) #8
Yaron
tests fixed, thanks for the catch https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java File web_apks/minting_example/src/org/chromium/minting/DexLoader.java (left): https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/src/org/chromium/minting/DexLoader.java#oldcode30 web_apks/minting_example/src/org/chromium/minting/DexLoader.java:30: public static Context ...
4 years, 8 months ago (2016-04-15 16:12:00 UTC) #9
Xi Han
lgtm https://codereview.chromium.org/1888773004/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java File chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java (right): https://codereview.chromium.org/1888773004/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java#newcode65 chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java:65: * an intent to the host browser.*/ It ...
4 years, 8 months ago (2016-04-15 17:33:04 UTC) #10
pkotwicz
https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java File web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java (right): https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java#newcode37 web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java:37: intent.putExtra(EXTRA_CALLER_PACKAGE_NAME, callerPackageName); Just checking: You're making use of EXTRA_CALLER_PACKAGE_NAME ...
4 years, 8 months ago (2016-04-15 17:59:43 UTC) #11
Yaron
4 years, 8 months ago (2016-04-15 21:58:11 UTC) #12
https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_exampl...
File
web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java
(right):

https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_exampl...
web_apks/minting_example/libs/client/org/chromium/minting/lib/client/NavigationClient.java:37:
intent.putExtra(EXTRA_CALLER_PACKAGE_NAME, callerPackageName);
On 2016/04/15 17:59:43, pkotwicz wrote:
> Just checking: You're making use of EXTRA_CALLER_PACKAGE_NAME in a follow up
CL?

oops. good catch, removed

https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_exampl...
File
web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java
(right):

https://codereview.chromium.org/1888773004/diff/60001/web_apks/minting_exampl...
web_apks/minting_example/src/org/chromium/minting/MintingServiceFactory.java:52:

On 2016/04/15 17:59:43, pkotwicz wrote:
> Nit: nuke the extraneous new line

Done.

https://codereview.chromium.org/1888773004/diff/80001/web_apks/minting_exampl...
File
web_apks/minting_example/libs/common/org/chromium/minting/lib/common/WebAPKUtils.java
(right):

https://codereview.chromium.org/1888773004/diff/80001/web_apks/minting_exampl...
web_apks/minting_example/libs/common/org/chromium/minting/lib/common/WebAPKUtils.java:14:
private static final String DEFAULT_CHROME_PACKAGE_NAME =
"com.google.android.apps.chrome";
On 2016/04/15 17:59:43, pkotwicz wrote:
> Nit: new line

Done.

Powered by Google App Engine
This is Rietveld 408576698