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

Issue 1294603003: [BackgroundSync] Trigger Background Sync events when Chrome is backgrounded on Android (Closed)

Created:
5 years, 4 months ago by iclelland
Modified:
5 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, jkarlin+watch_chromium.org, maniscalco+watch_chromium.org, maxbogue+watch_chromium.org, plaree+watch_chromium.org, pvalenzuela+watch_chromium.org, tim+watch_chromium.org, zea+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[BackgroundSync] Trigger Background Sync events when Chrome is backgrounded on Android BUG=511129 Committed: https://crrev.com/a5fb97d6fb9c3831994aadebea4664e2acc3c356 Cr-Commit-Position: refs/heads/master@{#351093}

Patch Set 1 #

Patch Set 2 : Remove code for triggering the sync manager from the paused/stopped states #

Patch Set 3 : Move BackgroundSyncNetworkObserverAndroid destructor to satisfy the compiler #

Total comments: 10

Patch Set 4 : Addressing review comments #

Patch Set 5 : Rebase #

Patch Set 6 : Update browser tests to trigger network observer directly #

Total comments: 11

Patch Set 7 : Rebase #

Patch Set 8 : Hold JNI references in a dedicated class on UI thread #

Total comments: 7

Patch Set 9 : Fix weakptr threading issue #

Patch Set 10 : Addressing review comments #

Total comments: 14

Patch Set 11 : Rebase #

Patch Set 12 : Switch to single autodetect, register native observers, change observer creation pattern #

Total comments: 28

Patch Set 13 : Make BSNOA::Observer destructor private #

Patch Set 14 : Addressing review comments from PS#12 #

Patch Set 15 : Better "ignore real network state" mechanism for tests #

Total comments: 7

Patch Set 16 : Stop caching JNI environment #

Patch Set 17 : Fix Android unit tests (Isolate tests from real network status) #

Patch Set 18 : Rebase (Post-Blink-Chromium-Merge) #

Total comments: 28

Patch Set 19 : Addressing review comments #

Total comments: 2

Patch Set 20 : Register JNI methods in component unittests; stop swallowing errors #

Total comments: 2

Patch Set 21 : Rebase post-revert #

Patch Set 22 : Don't crash in embedded webview; check permissions before creating NCNAD #

Patch Set 23 : Don't register observers with nonexistant Autodetector #

Unified diffs Side-by-side diffs Delta from patch set Stats (+393 lines, -25 lines) Patch
M chrome/test/android/unit_tests_apk/AndroidManifest.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M components/test/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +2 lines, -0 lines 0 comments Download
M components/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +4 lines, -0 lines 0 comments Download
A content/browser/android/background_sync_network_observer_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +80 lines, -0 lines 0 comments Download
A content/browser/android/background_sync_network_observer_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +86 lines, -0 lines 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +35 lines, -15 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +7 lines, -0 lines 0 comments Download
M content/browser/background_sync/background_sync_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +16 lines, -1 line 0 comments Download
M content/browser/background_sync/background_sync_network_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +19 lines, -4 lines 0 comments Download
M content/browser/background_sync/background_sync_network_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +22 lines, -5 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_jni.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1 chunk +109 lines, -0 lines 0 comments Download
M testing/android/native_test/java/AndroidManifest.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 60 (9 generated)
iclelland
jkarlin, PTAL -- compare and contrast with cr/1282993005/ Thanks!
5 years, 4 months ago (2015-08-18 16:55:08 UTC) #2
jkarlin
I really like where this is going. There is one piece missing though. If the ...
5 years, 4 months ago (2015-08-18 18:04:40 UTC) #3
iclelland
On 2015/08/18 18:04:40, jkarlin wrote: > I really like where this is going. There is ...
5 years, 3 months ago (2015-08-27 17:42:25 UTC) #4
iclelland
On 2015/08/27 17:42:25, iclelland wrote: > On 2015/08/18 18:04:40, jkarlin wrote: > > I really ...
5 years, 3 months ago (2015-08-27 18:52:58 UTC) #5
jkarlin
Looking very good! Some nits. The browsertests are going to need some work in the ...
5 years, 3 months ago (2015-08-28 01:19:48 UTC) #6
iclelland
Comments mostly addressed; I'm updating the browser tests (in the next patch) https://codereview.chromium.org/1294603003/diff/40001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc ...
5 years, 3 months ago (2015-08-31 16:00:52 UTC) #7
jkarlin
Are you still planning to add tests to this?
5 years, 3 months ago (2015-09-08 15:08:30 UTC) #8
iclelland
On 2015/09/08 15:08:30, jkarlin wrote: > Are you still planning to add tests to this? ...
5 years, 3 months ago (2015-09-10 15:52:58 UTC) #9
jkarlin
Almost there. https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc#newcode21 content/browser/android/background_sync_network_observer_android.cc:21: DCHECK_CURRENTLY_ON(BrowserThread::IO); I'm pretty tired so I may ...
5 years, 3 months ago (2015-09-11 00:05:23 UTC) #11
iclelland
https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc#newcode21 content/browser/android/background_sync_network_observer_android.cc:21: DCHECK_CURRENTLY_ON(BrowserThread::IO); On 2015/09/11 00:05:23, jkarlin wrote: > I'm pretty ...
5 years, 3 months ago (2015-09-11 14:42:15 UTC) #12
jkarlin
https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc#newcode21 content/browser/android/background_sync_network_observer_android.cc:21: DCHECK_CURRENTLY_ON(BrowserThread::IO); On 2015/09/11 14:42:15, iclelland wrote: > On 2015/09/11 ...
5 years, 3 months ago (2015-09-11 15:16:06 UTC) #13
jkarlin
https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/120001/content/browser/android/background_sync_network_observer_android.cc#newcode21 content/browser/android/background_sync_network_observer_android.cc:21: DCHECK_CURRENTLY_ON(BrowserThread::IO); On 2015/09/11 15:16:06, jkarlin wrote: > On 2015/09/11 ...
5 years, 3 months ago (2015-09-11 20:58:56 UTC) #14
iclelland
I've added a new class, just for the purpose of holding the Java references and ...
5 years, 3 months ago (2015-09-16 17:17:11 UTC) #15
jkarlin
https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc#newcode19 content/browser/android/background_sync_network_observer_android.cc:19: : callback_(callback) { DCHECK on UI thread https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc#newcode33 content/browser/android/background_sync_network_observer_android.cc:33: ...
5 years, 3 months ago (2015-09-16 17:39:44 UTC) #16
iclelland
https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc#newcode54 content/browser/android/background_sync_network_observer_android.cc:54: weak_ptr_factory_.GetWeakPtr(), On 2015/09/16 17:39:44, jkarlin wrote: > You can't ...
5 years, 3 months ago (2015-09-16 17:47:38 UTC) #17
iclelland
https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/160001/content/browser/android/background_sync_network_observer_android.cc#newcode19 content/browser/android/background_sync_network_observer_android.cc:19: : callback_(callback) { On 2015/09/16 17:39:44, jkarlin wrote: > ...
5 years, 3 months ago (2015-09-16 19:14:16 UTC) #18
iclelland
+r yfriedman -- can you take a look at the code under /content/*/android/ ? Especially ...
5 years, 3 months ago (2015-09-16 19:18:20 UTC) #20
jkarlin
https://codereview.chromium.org/1294603003/diff/200001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/200001/content/browser/android/background_sync_network_observer_android.cc#newcode20 content/browser/android/background_sync_network_observer_android.cc:20: DCHECK_CURRENTLY_ON(BrowserThread::IO); It seems like the code here and below ...
5 years, 3 months ago (2015-09-16 20:13:26 UTC) #21
Yaron
https://codereview.chromium.org/1294603003/diff/200001/content/browser/android/background_sync_network_observer_android.h File content/browser/android/background_sync_network_observer_android.h (right): https://codereview.chromium.org/1294603003/diff/200001/content/browser/android/background_sync_network_observer_android.h#newcode55 content/browser/android/background_sync_network_observer_android.h:55: base::android::ScopedJavaLocalRef<jobject> observer_; Nit: rename j_observer_ (to help distinguish between ...
5 years, 3 months ago (2015-09-16 22:04:36 UTC) #22
iclelland
yfriedman -- thanks for the review! PTAL at the updates to the design. jkarlin, PTAL, ...
5 years, 3 months ago (2015-09-18 15:46:28 UTC) #23
jkarlin
Looks like there is a check failure on android in some unittests. https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/70995/steps/content_unittests%20%28with%20patch%29/logs/stdio https://codereview.chromium.org/1294603003/diff/240001/content/browser/android/background_sync_network_observer_android.cc File ...
5 years, 3 months ago (2015-09-19 00:16:07 UTC) #24
iclelland
https://codereview.chromium.org/1294603003/diff/240001/content/browser/android/background_sync_network_observer_android.cc File content/browser/android/background_sync_network_observer_android.cc (right): https://codereview.chromium.org/1294603003/diff/240001/content/browser/android/background_sync_network_observer_android.cc#newcode45 content/browser/android/background_sync_network_observer_android.cc:45: env_, j_observer_.obj(), reinterpret_cast<jlong>(this)); On 2015/09/19 00:16:06, jkarlin wrote: > ...
5 years, 3 months ago (2015-09-21 18:49:30 UTC) #25
iclelland
https://codereview.chromium.org/1294603003/diff/240001/content/browser/background_sync/background_sync_browsertest.cc File content/browser/background_sync/background_sync_browsertest.cc (right): https://codereview.chromium.org/1294603003/diff/240001/content/browser/background_sync/background_sync_browsertest.cc#newcode117 content/browser/background_sync/background_sync_browsertest.cc:117: BackgroundSyncNetworkObserverAndroid::DisableNotificationForTesting(); On 2015/09/21 18:49:30, iclelland wrote: > On 2015/09/19 ...
5 years, 3 months ago (2015-09-22 13:18:15 UTC) #26
Yaron
lgtm assuming I'm on the right track with my question. Sorry for the slow review ...
5 years, 3 months ago (2015-09-22 21:20:35 UTC) #27
Yaron
lgtm assuming I'm on the right track with my question. Sorry for the slow review ...
5 years, 3 months ago (2015-09-22 21:20:38 UTC) #28
jkarlin
Looking good! Note that the Android tests are still failing. https://codereview.chromium.org/1294603003/diff/300001/content/browser/background_sync/background_sync_network_observer.cc File content/browser/background_sync/background_sync_network_observer.cc (right): https://codereview.chromium.org/1294603003/diff/300001/content/browser/background_sync/background_sync_network_observer.cc#newcode63 ...
5 years, 3 months ago (2015-09-24 17:51:30 UTC) #29
jkarlin
https://codereview.chromium.org/1294603003/diff/300001/content/browser/background_sync/background_sync_network_observer.cc File content/browser/background_sync/background_sync_network_observer.cc (right): https://codereview.chromium.org/1294603003/diff/300001/content/browser/background_sync/background_sync_network_observer.cc#newcode63 content/browser/background_sync/background_sync_network_observer.cc:63: if (ignore_network_change_notifier_) On 2015/09/24 17:51:30, jkarlin wrote: > No ...
5 years, 3 months ago (2015-09-24 17:53:40 UTC) #30
jkarlin
https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_browsertest.cc File content/browser/background_sync/background_sync_browsertest.cc (right): https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_browsertest.cc#newcode32 content/browser/background_sync/background_sync_browsertest.cc:32: #if defined(OS_ANDROID) Remove this block
5 years, 3 months ago (2015-09-24 17:55:19 UTC) #31
iclelland
Android tests may have been failing due to manifest permissions in the unit_tests APK. I've ...
5 years, 3 months ago (2015-09-24 20:37:20 UTC) #32
jkarlin
lgtm provided the try/catches are removed https://codereview.chromium.org/1294603003/diff/360001/content/browser/android/background_sync_network_observer_android.h File content/browser/android/background_sync_network_observer_android.h (right): https://codereview.chromium.org/1294603003/diff/360001/content/browser/android/background_sync_network_observer_android.h#newcode35 content/browser/android/background_sync_network_observer_android.h:35: class Observer : ...
5 years, 3 months ago (2015-09-24 23:33:12 UTC) #33
iclelland
https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_manager_unittest.cc File content/browser/background_sync/background_sync_manager_unittest.cc (right): https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_manager_unittest.cc#newcode318 content/browser/background_sync/background_sync_manager_unittest.cc:318: network_observer->NotifyManagerIfNetworkChanged(connection_type); On 2015/09/24 23:33:12, jkarlin wrote: > On 2015/09/24 ...
5 years, 2 months ago (2015-09-25 13:05:01 UTC) #34
jkarlin
https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_manager_unittest.cc File content/browser/background_sync/background_sync_manager_unittest.cc (right): https://codereview.chromium.org/1294603003/diff/360001/content/browser/background_sync/background_sync_manager_unittest.cc#newcode318 content/browser/background_sync/background_sync_manager_unittest.cc:318: network_observer->NotifyManagerIfNetworkChanged(connection_type); On 2015/09/25 13:05:01, iclelland wrote: > On 2015/09/24 ...
5 years, 2 months ago (2015-09-25 13:08:57 UTC) #35
Yaron
https://codereview.chromium.org/1294603003/diff/300001/content/browser/android/background_sync_network_observer_android.h File content/browser/android/background_sync_network_observer_android.h (right): https://codereview.chromium.org/1294603003/diff/300001/content/browser/android/background_sync_network_observer_android.h#newcode67 content/browser/android/background_sync_network_observer_android.h:67: JNIEnv* env_; On 2015/09/24 20:37:19, iclelland wrote: > On ...
5 years, 2 months ago (2015-09-25 18:43:03 UTC) #36
iclelland
https://codereview.chromium.org/1294603003/diff/380001/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java File content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java (right): https://codereview.chromium.org/1294603003/diff/380001/content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java#newcode69 content/public/android/java/src/org/chromium/content/browser/BackgroundSyncNetworkObserver.java:69: // This may fail in unit tests, if the ...
5 years, 2 months ago (2015-09-26 05:03:31 UTC) #37
jkarlin
slgtm though you'll need an owner for the components/ changes
5 years, 2 months ago (2015-09-28 11:42:43 UTC) #38
iclelland
On 2015/09/28 11:42:43, jkarlin wrote: > slgtm though you'll need an owner for the components/ ...
5 years, 2 months ago (2015-09-28 12:31:59 UTC) #40
Yaron
lgtm https://codereview.chromium.org/1294603003/diff/400001/components/test/run_all_unittests.cc File components/test/run_all_unittests.cc (right): https://codereview.chromium.org/1294603003/diff/400001/components/test/run_all_unittests.cc#newcode29 components/test/run_all_unittests.cc:29: #include "content/browser/android/browser_jni_registrar.h" sorry about you having to deal ...
5 years, 2 months ago (2015-09-28 14:19:23 UTC) #41
jochen (gone - plz use gerrit)
lgtm
5 years, 2 months ago (2015-09-28 17:17:55 UTC) #42
iclelland
https://codereview.chromium.org/1294603003/diff/400001/components/test/run_all_unittests.cc File components/test/run_all_unittests.cc (right): https://codereview.chromium.org/1294603003/diff/400001/components/test/run_all_unittests.cc#newcode29 components/test/run_all_unittests.cc:29: #include "content/browser/android/browser_jni_registrar.h" On 2015/09/28 14:19:23, Yaron wrote: > sorry ...
5 years, 2 months ago (2015-09-28 17:25:57 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1294603003/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1294603003/400001
5 years, 2 months ago (2015-09-28 17:27:56 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/104316)
5 years, 2 months ago (2015-09-28 17:40:41 UTC) #48
iclelland
+r mmenke -- Can I get a review for the change in components/test/DEPS? (See the ...
5 years, 2 months ago (2015-09-28 17:54:16 UTC) #50
mmenke
On 2015/09/28 17:54:16, iclelland wrote: > +r mmenke -- Can I get a review for ...
5 years, 2 months ago (2015-09-28 18:00:39 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1294603003/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1294603003/400001
5 years, 2 months ago (2015-09-28 18:07:34 UTC) #53
commit-bot: I haz the power
Committed patchset #20 (id:400001)
5 years, 2 months ago (2015-09-28 19:14:42 UTC) #54
commit-bot: I haz the power
Patchset 20 (id:??) landed as https://crrev.com/a5fb97d6fb9c3831994aadebea4664e2acc3c356 Cr-Commit-Position: refs/heads/master@{#351093}
5 years, 2 months ago (2015-09-28 19:15:22 UTC) #55
iclelland
A revert of this CL (patchset #20 id:400001) has been created in https://codereview.chromium.org/1376563003/ by iclelland@chromium.org. ...
5 years, 2 months ago (2015-09-29 19:44:36 UTC) #56
iclelland
On 2015/09/29 19:44:36, iclelland wrote: > A revert of this CL (patchset #20 id:400001) has ...
5 years, 2 months ago (2015-10-01 02:33:01 UTC) #57
jkarlin
On 2015/10/01 02:33:01, iclelland wrote: > On 2015/09/29 19:44:36, iclelland wrote: > > A revert ...
5 years, 2 months ago (2015-10-01 14:05:56 UTC) #58
iclelland
On 2015/10/01 14:05:56, jkarlin wrote: > On 2015/10/01 02:33:01, iclelland wrote: > > On 2015/09/29 ...
5 years, 2 months ago (2015-10-01 15:02:31 UTC) #59
mmenke
5 years, 2 months ago (2015-10-01 17:05:17 UTC) #60
Message was sent while issue was closed.
Just FYI:  I'm closing this issue again.

Powered by Google App Engine
This is Rietveld 408576698