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

Issue 14362009: Receive app notifications in SimpleCache, so we save our index file (Closed)

Created:
7 years, 8 months ago by felipeg
Modified:
7 years, 8 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

With this CL we can catch OnResume, OnPause, OnDestroy and OnStop notifications in SimpleCache, so we save our index before we get killed. OnPause means the app lost focus (went to the background). The idea is that we can write the index file to disk on every OnPause, and while the app is in the background we can aggressively increase the frequency we write the index file to disk. BUG=233536 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195845

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : sync #

Total comments: 20

Patch Set 7 : gavins comments #

Total comments: 38

Patch Set 8 : philippe comments #

Total comments: 44

Patch Set 9 : #

Patch Set 10 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -24 lines) Patch
A net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java View 1 2 3 4 5 6 7 8 1 chunk +72 lines, -0 lines 1 comment Download
M net/android/net_jni_registrar.cc View 1 2 2 chunks +4 lines, -1 line 0 comments Download
A net/android/simple_cache_activity_status_notifier.h View 1 2 3 4 5 6 7 8 1 chunk +62 lines, -0 lines 0 comments Download
A net/android/simple_cache_activity_status_notifier.cc View 1 2 3 4 5 6 7 8 1 chunk +54 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_index.h View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -4 lines 0 comments Download
M net/disk_cache/simple/simple_index.cc View 1 2 3 4 5 6 7 8 9 7 chunks +32 lines, -19 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
felipeg
another crazy idea guys
7 years, 8 months ago (2013-04-18 22:09:09 UTC) #1
felipeg
On 2013/04/18 22:09:09, felipeg1 wrote: > another crazy idea guys btw it works. It is ...
7 years, 8 months ago (2013-04-18 22:15:30 UTC) #2
gavinp
Nice! But what are the odds of landing this? I suspect fast shutdown is important.
7 years, 8 months ago (2013-04-19 05:52:20 UTC) #3
felipeg
Yes, we can land this. We just need an LGTM from Gavin, he is an ...
7 years, 8 months ago (2013-04-19 12:03:14 UTC) #4
gavinp
Awesome. Do not land this without a review from Philippe on the android changes at ...
7 years, 8 months ago (2013-04-19 15:58:55 UTC) #5
felipeg
https://chromiumcodereview.appspot.com/14362009/diff/19/net/android/simple_cache_activity_status_notifier.cc File net/android/simple_cache_activity_status_notifier.cc (right): https://chromiumcodereview.appspot.com/14362009/diff/19/net/android/simple_cache_activity_status_notifier.cc#newcode41 net/android/simple_cache_activity_status_notifier.cc:41: if (callback_runner_.get() && !notify_callback_.is_null()) { On 2013/04/19 15:58:55, gavinp ...
7 years, 8 months ago (2013-04-19 17:10:15 UTC) #6
felipeg
https://chromiumcodereview.appspot.com/14362009/diff/19/net/android/simple_cache_activity_status_notifier.h File net/android/simple_cache_activity_status_notifier.h (right): https://chromiumcodereview.appspot.com/14362009/diff/19/net/android/simple_cache_activity_status_notifier.h#newcode26 net/android/simple_cache_activity_status_notifier.h:26: class SimpleCacheActivityStatusNotifier { On 2013/04/19 15:58:55, gavinp wrote: > ...
7 years, 8 months ago (2013-04-19 17:13:32 UTC) #7
Philippe
Thanks Felipe! See my comment about the threading issue. We can discuss this offline to ...
7 years, 8 months ago (2013-04-22 11:35:48 UTC) #8
Philippe
https://codereview.chromium.org/14362009/diff/7005/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java File net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java (right): https://codereview.chromium.org/14362009/diff/7005/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java#newcode26 net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java:26: public SimpleCacheActivityStatusNotifier(int nativePtr) { As we discussed this constructor ...
7 years, 8 months ago (2013-04-22 11:59:34 UTC) #9
Philippe
On 2013/04/22 11:59:34, Philippe wrote: > https://codereview.chromium.org/14362009/diff/7005/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java > File > net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java > (right): > > ...
7 years, 8 months ago (2013-04-22 12:38:35 UTC) #10
felipeg
https://chromiumcodereview.appspot.com/14362009/diff/7005/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java File net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java (right): https://chromiumcodereview.appspot.com/14362009/diff/7005/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java#newcode15 net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java:15: * Used by the SimpleIndex in net/disk_cache/simple/ to listens ...
7 years, 8 months ago (2013-04-22 16:14:31 UTC) #11
gavinp
LGTM, provided pliard also gives an LGTM. https://codereview.chromium.org/14362009/diff/24001/net/android/simple_cache_activity_status_notifier.cc File net/android/simple_cache_activity_status_notifier.cc (right): https://codereview.chromium.org/14362009/diff/24001/net/android/simple_cache_activity_status_notifier.cc#newcode31 net/android/simple_cache_activity_status_notifier.cc:31: SimpleCacheActivityStatusNotifier::~SimpleCacheActivityStatusNotifier() { ...
7 years, 8 months ago (2013-04-23 11:02:03 UTC) #12
Philippe
Thanks Felipe! This looks much better now from the threading perspective. A few more nits ...
7 years, 8 months ago (2013-04-23 11:34:25 UTC) #13
felipeg
https://chromiumcodereview.appspot.com/14362009/diff/24001/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java File net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java (right): https://chromiumcodereview.appspot.com/14362009/diff/24001/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java#newcode1 net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 8 months ago (2013-04-23 13:10:12 UTC) #14
Philippe
On 2013/04/23 13:10:12, felipeg1 wrote: > https://chromiumcodereview.appspot.com/14362009/diff/24001/net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java > File > net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java > (right): > > ...
7 years, 8 months ago (2013-04-23 13:28:49 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/14362009/38002
7 years, 8 months ago (2013-04-23 13:39:27 UTC) #16
commit-bot: I haz the power
Change committed as 195845
7 years, 8 months ago (2013-04-23 18:09:53 UTC) #17
gavinp
7 years, 8 months ago (2013-04-25 08:28:27 UTC) #18
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/14362009/diff/38002/net/android/java/s...
File
net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java
(right):

https://chromiumcodereview.appspot.com/14362009/diff/38002/net/android/java/s...
net/android/java/src/org/chromium/net/SimpleCacheActivityStatusNotifier.java:31:
this.mIoLooper = Looper.myLooper();
Since the construction comes from the net thread (typically the Chrome IO
thread), there's guaranteed to be no native looper. So this code makes Chrome
crash on any activity state change notification on Android.

When we make our next upload on this, let's make sure to add an android browser
test that receives at least one activity status notification.

Powered by Google App Engine
This is Rietveld 408576698