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

Issue 2974573002: Refactor WebApkServiceConnectionManager. (Closed)

Created:
3 years, 5 months ago by Xi Han
Modified:
3 years, 4 months ago
CC:
chromium-reviews, Peter Beverloo, zpeng+watch_chromium.org, mlamouri+watch-notifications_chromium.org, awdf+watch_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor WebApkServiceConnectionManager. This is the 2/3 patch of fixing bug "The WebApkService shouldn't be shared between different browsers". In this CL, we did the following things: 1) refactor WebApkServiceConnectionManager to connect to any kind of services. 2) introduce WebApkServiceClient and WebApkIdentityServiceClient that manages communication between Chrome and WebAPK service/WebAPK Identity service respectively. The refactoring of WebApkServiceConnectionManager also fixes notification issue reported in crbug.com/740614. BUG=720077, 740614 TBR=peter@chromium.org Review-Url: https://codereview.chromium.org/2974573002 Cr-Commit-Position: refs/heads/master@{#489454} Committed: https://chromium.googlesource.com/chromium/src/+/fb0b8d2f550e397f6c609273d4e4ad9a9e440705

Patch Set 1 #

Total comments: 36

Patch Set 2 : Rebase #

Total comments: 8

Patch Set 3 : Refactoring. #

Total comments: 63

Patch Set 4 #

Patch Set 5 : Fix the state changes. #

Patch Set 6 : Check bindService()'s return value. #

Total comments: 14

Patch Set 7 : Call the callback on UI thread if bindService() fails. #

Total comments: 35

Patch Set 8 : yfriedman@'s comments. #

Total comments: 19

Patch Set 9 : Clean up #

Patch Set 10 : WebApkServiceConnectionManager is no longer a base class. #

Patch Set 11 : Clean up. #

Total comments: 7

Patch Set 12 : yfriedman@'s comments. #

Total comments: 52

Patch Set 13 : Try to fix the illegal including in the tests. #

Total comments: 8

Patch Set 14 : pkotwicz@‘s comments. #

Total comments: 20

Patch Set 15 : Update tests and nits. #

Patch Set 16 : Rebase. #

Total comments: 14

Patch Set 17 : Split CL as 2/3. #

Total comments: 18

Patch Set 18 : Nits. #

Patch Set 19 : Nits. #

Total comments: 2

Patch Set 20 : yfriedman@'s comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+481 lines, -198 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +4 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -100 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +1 line, -4 lines 0 comments Download
A + chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkServiceClient.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +45 lines, -18 lines 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +1 line, -1 line 0 comments Download
M chrome/android/webapk/libs/client/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/android/webapk/libs/client/junit/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClientTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +171 lines, -0 lines 0 comments Download
M chrome/android/webapk/libs/client/junit/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManagerTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +15 lines, -8 lines 0 comments Download
A chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +148 lines, -0 lines 0 comments Download
M chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkServiceConnectionManager.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +92 lines, -65 lines 0 comments Download

Messages

Total messages: 108 (72 generated)
Xi Han
Hi Yaron and Peter, We need the Identity Service for different Chrome channels, even if ...
3 years, 5 months ago (2017-07-07 19:22:47 UTC) #8
Yaron
https://codereview.chromium.org/2974573002/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java File chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java (right): https://codereview.chromium.org/2974573002/diff/100001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode83 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:83: if (ChromeWebApkHost.isEnabled()) { you need to rebase - this ...
3 years, 5 months ago (2017-07-10 18:09:07 UTC) #9
pkotwicz
Your CL looks mostly good. My main suggestion is putting more of the logic into ...
3 years, 5 months ago (2017-07-10 19:06:06 UTC) #10
Xi Han
Hi Yaron and Peter, I change the WebApkServiceConnectionManager as a base class, and introduce two ...
3 years, 5 months ago (2017-07-12 13:49:15 UTC) #19
Yaron
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java (right): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java#newcode167 chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java:167: WebApkIdentityServiceClient.CheckRuntimeHostCallback callback = per discussion let's move this to ...
3 years, 5 months ago (2017-07-12 18:14:58 UTC) #22
pkotwicz
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java File chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java (right): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode92 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:92: Each method should have a method comment https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode156 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:156: ...
3 years, 5 months ago (2017-07-12 19:58:00 UTC) #23
pkotwicz
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java File chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java (right): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode92 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:92: Each method should have a method comment https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode156 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:156: ...
3 years, 5 months ago (2017-07-12 19:58:00 UTC) #24
Xi Han
Hi Yaron and Peter, PTAL, thanks! https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java File chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java (right): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java#newcode92 chrome/android/java/src/org/chromium/chrome/browser/ServiceTabLauncher.java:92: On 2017/07/12 19:57:58, ...
3 years, 5 months ago (2017-07-13 21:05:06 UTC) #29
Xi Han
I upload a new patch to fix the notification bug (crbug.com/740614) in the WebApkServiceConnectionManager, PTAL, ...
3 years, 5 months ago (2017-07-14 19:35:12 UTC) #35
Yaron
https://codereview.chromium.org/2974573002/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java File chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java (right): https://codereview.chromium.org/2974573002/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java#newcode213 chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java:213: ChromeWebApkHost.initializeWithNative(); i think this is doing it too broadly. ...
3 years, 5 months ago (2017-07-14 19:52:04 UTC) #36
Xi Han
PTAL, thanks! https://codereview.chromium.org/2974573002/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java File chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java (right): https://codereview.chromium.org/2974573002/diff/360001/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java#newcode213 chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java:213: ChromeWebApkHost.initializeWithNative(); On 2017/07/14 19:52:04, Yaron wrote: > ...
3 years, 5 months ago (2017-07-14 22:00:56 UTC) #38
pkotwicz
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java (left): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java#oldcode78 chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java:78: public static void cancelNotification( In this case we can ...
3 years, 5 months ago (2017-07-14 23:20:06 UTC) #39
Yaron
you may want to add notification folk to look at the notification changes https://codereview.chromium.org/2974573002/diff/420001/chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java File ...
3 years, 5 months ago (2017-07-17 14:34:30 UTC) #40
Xi Han
I think I have addressed all of the comments. PTAL, thanks! https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java (left): ...
3 years, 5 months ago (2017-07-17 20:45:33 UTC) #41
Xi Han
I am now working on making WebApkServiceConnectionManager as a member variable in WebApkIdentityServiceClient and WebApkServiceClient. ...
3 years, 5 months ago (2017-07-18 13:45:58 UTC) #43
Xi Han
PTAL, thanks!
3 years, 5 months ago (2017-07-18 14:43:29 UTC) #46
pkotwicz
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java (left): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java#oldcode78 chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java:78: public static void cancelNotification( Fair enough. The merged file ...
3 years, 5 months ago (2017-07-18 17:30:47 UTC) #53
Yaron
https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java (left): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java#oldcode78 chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java:78: public static void cancelNotification( On 2017/07/18 17:30:46, pkotwicz wrote: ...
3 years, 5 months ago (2017-07-18 19:25:46 UTC) #54
Xi Han
+peter@chromium.org: Please review changes in *notification* directory. Thanks! https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java File chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java (left): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java#oldcode78 chrome/android/java/src/org/chromium/chrome/browser/notifications/WebApkNotificationClient.java:78: public ...
3 years, 5 months ago (2017-07-18 22:36:51 UTC) #57
Xi Han
I upload a new patch to address Yaron's comments about unbinding the connections in AsyncTask. ...
3 years, 5 months ago (2017-07-19 14:06:42 UTC) #62
pkotwicz
Mostly nits https://codereview.chromium.org/2974573002/diff/260001/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java File chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java (right): https://codereview.chromium.org/2974573002/diff/260001/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java#newcode190 chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/WebApkUtils.java:190: StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites(); The strict mode ...
3 years, 5 months ago (2017-07-19 16:09:14 UTC) #65
pkotwicz
https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode33 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:33: * or clear a browser's data that makes the ...
3 years, 5 months ago (2017-07-20 01:32:05 UTC) #67
pkotwicz
https://codereview.chromium.org/2974573002/diff/620001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/620001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode122 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:122: if (metadata.getInt(WebApkMetaDataKeys.SHELL_APK_VERSION) In case you haven't done so, you ...
3 years, 5 months ago (2017-07-21 19:24:27 UTC) #68
Xi Han
I have fixed the tests issue, PTAL, thanks! https://codereview.chromium.org/2974573002/diff/360001/chrome/browser/notifications/notification_platform_bridge_android.h File chrome/browser/notifications/notification_platform_bridge_android.h (right): https://codereview.chromium.org/2974573002/diff/360001/chrome/browser/notifications/notification_platform_bridge_android.h#newcode67 chrome/browser/notifications/notification_platform_bridge_android.h:67: void ...
3 years, 5 months ago (2017-07-21 20:36:35 UTC) #77
Xi Han
I am splitting this CL, please hold off reviewing. I will make this CL as ...
3 years, 5 months ago (2017-07-24 17:22:02 UTC) #80
Xi Han
I only keep the refactoring of WebApkConnectionManger part in this CL. PTAL, thanks!
3 years, 5 months ago (2017-07-24 18:23:27 UTC) #87
pkotwicz
https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode33 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:33: * or clear a browser's data that makes the ...
3 years, 5 months ago (2017-07-24 18:31:32 UTC) #88
Xi Han
PTAL, thanks! https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode33 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:33: * or clear a browser's data that ...
3 years, 5 months ago (2017-07-24 19:31:41 UTC) #89
pkotwicz
LGTM with nits! https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/560001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode33 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:33: * or clear a browser's data ...
3 years, 5 months ago (2017-07-24 19:59:49 UTC) #90
Xi Han
Hi Yaron, do you have any opinion about using "org.webapk.IDENTITY_SERVICE_API" for the action to bind ...
3 years, 5 months ago (2017-07-24 20:36:15 UTC) #91
Yaron
https://codereview.chromium.org/2974573002/diff/720001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/720001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode42 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:42: private static final String ACTION_WEBAPK_IDENTITY_SERVICE = "org.webapk.IDENTITY_SERVICE_API"; On 2017/07/24 ...
3 years, 4 months ago (2017-07-25 17:00:26 UTC) #92
Xi Han
Hi Yaron, PTAL, thanks! https://codereview.chromium.org/2974573002/diff/720001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java File chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java (right): https://codereview.chromium.org/2974573002/diff/720001/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java#newcode42 chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkIdentityServiceClient.java:42: private static final String ACTION_WEBAPK_IDENTITY_SERVICE ...
3 years, 4 months ago (2017-07-25 18:20:40 UTC) #94
Yaron
lgtm
3 years, 4 months ago (2017-07-25 18:24:05 UTC) #95
Xi Han
Hi Peter B, could you please take a look at file: - chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java Thanks!
3 years, 4 months ago (2017-07-25 18:27:14 UTC) #96
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2974573002/800001
3 years, 4 months ago (2017-07-25 21:48:39 UTC) #104
commit-bot: I haz the power
3 years, 4 months ago (2017-07-25 21:54:35 UTC) #108
Message was sent while issue was closed.
Committed patchset #20 (id:800001) as
https://chromium.googlesource.com/chromium/src/+/fb0b8d2f550e397f6c609273d4e4...

Powered by Google App Engine
This is Rietveld 408576698