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

Issue 12316075: Preventing race conditions in Google Now extension (Closed)

Created:
7 years, 10 months ago by vadimt
Modified:
7 years, 9 months ago
CC:
chromium-reviews, arv+watch_chromium.org, govind1, stromme
Visibility:
Public.

Description

Preventing race conditions in Google Now extension. Introducing a task manager. A task is an event chain that does certain work that we want to be atomic. Execution of multiple tasks is serialized. Also, adding checks for anomalous situations, such as a forever-running task keeps the event page from unloading or a task still running when the event page unloads. BUG=164227 TEST= From the JS console, execute: updateNotificationsCards(); updateNotificationsCards(); Make sure that the server request gets sent only once. Now execute: updateNotificationsCards(); Make sure that the request is sent. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=190023

Patch Set 1 #

Total comments: 26

Patch Set 2 : Rebase #

Patch Set 3 : skare@ initial comments #

Patch Set 4 : Rebase/switch to notifications.clear #

Total comments: 62

Patch Set 5 : More comments #

Patch Set 6 : More notes #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 8

Patch Set 9 : #

Patch Set 10 : Removing last reference to chrome.experimental #

Patch Set 11 : Fixing incorrect merge #

Patch Set 12 : Separating utilities into a separate file. #

Total comments: 32

Patch Set 13 : Getting rid of remaining instances of TaskName. #

Total comments: 8

Patch Set 14 : CR comments after splitting the file. #

Total comments: 14

Patch Set 15 : 3/19 comments #

Total comments: 11

Patch Set 16 : arv@ comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+527 lines, -310 lines) Patch
M chrome/browser/resources/component_extension_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/google_now/background.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +369 lines, -309 lines 0 comments Download
M chrome/browser/resources/google_now/manifest.json View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/resources/google_now/utility.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +156 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
vadimt
7 years, 10 months ago (2013-02-22 20:27:51 UTC) #1
skare_
some early stylistic stuff. Will need a bit more time to dig into the main ...
7 years, 10 months ago (2013-02-22 20:53:39 UTC) #2
vadimt
https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js#newcode58 chrome/browser/resources/google_now/background.js:58: var UPDATE_CARDS_TASK_NAME = 'update-cards'; On 2013/02/22 20:53:39, Travis Skare ...
7 years, 9 months ago (2013-02-28 02:23:22 UTC) #3
skare_
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); console.assert()? https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); I didn't think alert() ...
7 years, 9 months ago (2013-03-02 00:07:05 UTC) #4
skare_
https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js#newcode65 chrome/browser/resources/google_now/background.js:65: var UPDATE_ALARM_NAME = 'UPDATE'; On 2013/02/28 02:23:22, vadimt wrote: ...
7 years, 9 months ago (2013-03-02 00:11:39 UTC) #5
rgustafson
Sorry about the delay, but you were forewarned. I'll take another close look at it ...
7 years, 9 months ago (2013-03-04 22:31:27 UTC) #6
vadimt
https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/1/chrome/browser/resources/google_now/background.js#newcode65 chrome/browser/resources/google_now/background.js:65: var UPDATE_ALARM_NAME = 'UPDATE'; On 2013/03/02 00:11:39, Travis Skare ...
7 years, 9 months ago (2013-03-06 21:04:38 UTC) #7
skare_
cool, hope the comment changes weren't too painful. https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); ...
7 years, 9 months ago (2013-03-06 22:35:57 UTC) #8
vadimt
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); On 2013/03/06 22:35:57, Travis Skare wrote: > [ok] ...
7 years, 9 months ago (2013-03-06 22:56:35 UTC) #9
skare_
'done' stuff looks good in general, just bringing a couple of points from previous patchsets ...
7 years, 9 months ago (2013-03-07 23:25:13 UTC) #10
vadimt
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); On 2013/03/07 23:25:13, Travis Skare wrote: > On ...
7 years, 9 months ago (2013-03-08 21:11:58 UTC) #11
rgustafson
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); If it's stuff that should never happen and ...
7 years, 9 months ago (2013-03-11 18:11:04 UTC) #12
skare_
some more high-level stuff https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); re: the alert() line, ...
7 years, 9 months ago (2013-03-11 18:37:12 UTC) #13
skare_
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode200 chrome/browser/resources/google_now/background.js:200: function setStep(step) { ignore setStep() naming comment; resolved in ...
7 years, 9 months ago (2013-03-11 19:46:26 UTC) #14
skare_
ok, looking good overall. maybe one high-level thing for in-person discussion, but I think I ...
7 years, 9 months ago (2013-03-11 19:53:07 UTC) #15
vadimt
https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/9002/chrome/browser/resources/google_now/background.js#newcode85 chrome/browser/resources/google_now/background.js:85: alert(errorText); On 2013/03/11 18:11:04, rgustafson wrote: > If it's ...
7 years, 9 months ago (2013-03-11 21:31:53 UTC) #16
vadimt
Moved utilities into a separate file. Please review.
7 years, 9 months ago (2013-03-14 00:17:20 UTC) #17
skare_
thanks! https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/background.js#newcode28 chrome/browser/resources/google_now/background.js:28: any reason for just one line break between ...
7 years, 9 months ago (2013-03-14 00:48:50 UTC) #18
skare_
https://codereview.chromium.org/12316075/diff/49001/chrome/browser/resources/google_now/utility.js File chrome/browser/resources/google_now/utility.js (right): https://codereview.chromium.org/12316075/diff/49001/chrome/browser/resources/google_now/utility.js#newcode110 chrome/browser/resources/google_now/utility.js:110: */ currently clients need to be aware of this ...
7 years, 9 months ago (2013-03-14 01:19:53 UTC) #19
rgustafson
https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js File chrome/browser/resources/google_now/utility.js (right): https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js#newcode19 chrome/browser/resources/google_now/utility.js:19: // TODO(vadimt): Make sure the execution doesn't continue after ...
7 years, 9 months ago (2013-03-14 19:05:20 UTC) #20
vadimt
https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/background.js#newcode28 chrome/browser/resources/google_now/background.js:28: On 2013/03/14 00:48:50, Travis Skare wrote: > any reason ...
7 years, 9 months ago (2013-03-14 22:56:05 UTC) #21
skare_
https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js File chrome/browser/resources/google_now/utility.js (right): https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js#newcode49 chrome/browser/resources/google_now/utility.js:49: * @type {Array.<Object.<TaskName, function()>>} ok... probably not an issue ...
7 years, 9 months ago (2013-03-19 18:51:39 UTC) #22
vadimt
https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js File chrome/browser/resources/google_now/utility.js (right): https://codereview.chromium.org/12316075/diff/44001/chrome/browser/resources/google_now/utility.js#newcode49 chrome/browser/resources/google_now/utility.js:49: * @type {Array.<Object.<TaskName, function()>>} On 2013/03/19 18:51:39, Travis Skare ...
7 years, 9 months ago (2013-03-19 20:01:55 UTC) #23
skare_
thanks for the edits. Probably a good idea to have an OWNER skim this, at ...
7 years, 9 months ago (2013-03-19 20:31:38 UTC) #24
rgustafson
I'm okay with passing to owner at this point also, but will keep on eye ...
7 years, 9 months ago (2013-03-19 20:36:51 UTC) #25
vadimt
arv@, please provide owner's approval.
7 years, 9 months ago (2013-03-19 20:41:44 UTC) #26
vadimt
sky@, please provide owner's review for the .grd file.
7 years, 9 months ago (2013-03-20 15:49:51 UTC) #27
sky
arv is an OWNER for the grd file too, removing myself.
7 years, 9 months ago (2013-03-20 16:35:54 UTC) #28
arv (Not doing code reviews)
https://codereview.chromium.org/12316075/diff/59001/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/59001/chrome/browser/resources/google_now/background.js#newcode84 chrome/browser/resources/google_now/background.js:84: var tasks = TaskManager(areTasksConflicting); missing new? Capital letter implies ...
7 years, 9 months ago (2013-03-21 21:40:20 UTC) #29
vadimt
https://codereview.chromium.org/12316075/diff/59001/chrome/browser/resources/google_now/background.js File chrome/browser/resources/google_now/background.js (right): https://codereview.chromium.org/12316075/diff/59001/chrome/browser/resources/google_now/background.js#newcode84 chrome/browser/resources/google_now/background.js:84: var tasks = TaskManager(areTasksConflicting); On 2013/03/21 21:40:21, arv wrote: ...
7 years, 9 months ago (2013-03-21 22:57:05 UTC) #30
arv (Not doing code reviews)
LGTM I don't mind the closure pattern but it is less efficient but you are ...
7 years, 9 months ago (2013-03-22 16:09:13 UTC) #31
rgustafson
lgtm
7 years, 9 months ago (2013-03-22 16:56:24 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/12316075/71001
7 years, 9 months ago (2013-03-22 18:11:13 UTC) #33
skare_
lgtm
7 years, 9 months ago (2013-03-22 18:52:52 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/12316075/71001
7 years, 9 months ago (2013-03-23 14:42:46 UTC) #35
commit-bot: I haz the power
Change committed as 190023
7 years, 9 months ago (2013-03-23 16:27:37 UTC) #36
vadimt
7 years, 9 months ago (2013-03-25 14:38:27 UTC) #37
Message was sent while issue was closed.
Updated TEST.

Powered by Google App Engine
This is Rietveld 408576698