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

Issue 2473553004: Request Picker task (Closed)

Created:
4 years, 1 month ago by Pete Williamson
Modified:
4 years, 1 month ago
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Request Picker task We are refactoring the Background Loading system to use async tasks. The advantage of this is that tasks can finish uninterrupted by other tasks which might interfere with them (better correctness, get rid of those pesky race conditions). To avoid circular header file dependencies, I moved several results objects from request_queue.h to a new file, queue_results.h, and the rename ended up touching quite a few files. This change refactors the RequestPicker to use a task object. BUG=651238 Committed: https://crrev.com/3113e19fb5a58ae8dd2bbc7af58c7584486120c0 Cr-Commit-Position: refs/heads/master@{#431617}

Patch Set 1 #

Total comments: 9

Patch Set 2 : CR fixes per DougArnett #

Total comments: 21

Patch Set 3 : merge so we can do a CQ dry run #

Patch Set 4 : CR fixes per DougArnett and FGorski #

Total comments: 8

Patch Set 5 : Use RequestQueueStore instead of RequestQueue in the picker task #

Patch Set 6 : merge #

Total comments: 2

Patch Set 7 : Fix unit test failures after merge #

Patch Set 8 : Rename queue_status.h to request_queue_status.h #

Total comments: 2

Patch Set 9 : Missed a few places to convert back, take another merge #

Total comments: 2

Patch Set 10 : Replace use of header file with forward declare for enum #

Total comments: 67

Patch Set 11 : CR feedback per EStade, FGorski, and DougArnett #

Total comments: 7

Patch Set 12 : Fix unit tests #

Patch Set 13 : merge with latest #

Unified diffs Side-by-side diffs Delta from patch set Stats (+762 lines, -1141 lines) Patch
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M components/offline_pages/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/background/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -3 lines 0 comments Download
M components/offline_pages/background/mark_attempt_completed_task.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
A components/offline_pages/background/pick_request_task.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +115 lines, -0 lines 0 comments Download
A + components/offline_pages/background/pick_request_task.cc View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +122 lines, -96 lines 0 comments Download
A components/offline_pages/background/pick_request_task_factory.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +48 lines, -0 lines 0 comments Download
A components/offline_pages/background/pick_request_task_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -0 lines 0 comments Download
A + components/offline_pages/background/pick_request_task_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 14 chunks +142 lines, -108 lines 0 comments Download
M components/offline_pages/background/request_coordinator.h View 1 2 3 4 5 6 7 8 6 chunks +7 lines, -17 lines 0 comments Download
M components/offline_pages/background/request_coordinator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 19 chunks +49 lines, -42 lines 0 comments Download
M components/offline_pages/background/request_coordinator_event_logger.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M components/offline_pages/background/request_coordinator_event_logger.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -6 lines 0 comments Download
M components/offline_pages/background/request_coordinator_event_logger_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M components/offline_pages/background/request_coordinator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +19 lines, -14 lines 0 comments Download
D components/offline_pages/background/request_picker.h View 1 chunk +0 lines, -110 lines 0 comments Download
D components/offline_pages/background/request_picker.cc View 1 chunk +0 lines, -276 lines 0 comments Download
D components/offline_pages/background/request_picker_unittest.cc View 1 chunk +0 lines, -422 lines 0 comments Download
M components/offline_pages/background/request_queue.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +25 lines, -21 lines 0 comments Download
M components/offline_pages/background/request_queue.cc View 1 2 3 4 5 6 7 4 chunks +23 lines, -7 lines 0 comments Download
A components/offline_pages/background/request_queue_results.h View 1 2 3 4 5 6 7 1 chunk +40 lines, -0 lines 0 comments Download
M components/offline_pages/background/request_queue_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +102 lines, -3 lines 0 comments Download
M components/offline_pages/core/task_queue.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 69 (36 generated)
Pete Williamson
4 years, 1 month ago (2016-11-03 01:08:55 UTC) #3
dougarnett
https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode73 components/offline_pages/background/pick_request_task.cc:73: ChooseRequest(std::move(valid_requests)); Consider ChooseRequestAndCallback() Or mentioning will call callback in ...
4 years, 1 month ago (2016-11-03 17:01:23 UTC) #4
Pete Williamson
https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode73 components/offline_pages/background/pick_request_task.cc:73: ChooseRequest(std::move(valid_requests)); On 2016/11/03 17:01:22, dougarnett wrote: > Consider ChooseRequestAndCallback() ...
4 years, 1 month ago (2016-11-03 19:26:29 UTC) #5
dougarnett
https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode76 components/offline_pages/background/pick_request_task.cc:76: RemoveExpiredEntries(std::move(expired_requests)); On 2016/11/03 19:26:29, Pete Williamson wrote: > On ...
4 years, 1 month ago (2016-11-03 19:56:51 UTC) #10
fgorski
Some initial comments. Pete, I was under impression that QueueResults patch will go in first. ...
4 years, 1 month ago (2016-11-03 22:00:30 UTC) #11
dougarnett
https://codereview.chromium.org/2473553004/diff/20001/components/offline_pages/background/pick_request_task.h File components/offline_pages/background/pick_request_task.h (right): https://codereview.chromium.org/2473553004/diff/20001/components/offline_pages/background/pick_request_task.h#newcode60 components/offline_pages/background/pick_request_task.h:60: // Step 2b. Handle deleting expired entries and notifying ...
4 years, 1 month ago (2016-11-03 22:33:15 UTC) #12
Pete Williamson
https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode76 components/offline_pages/background/pick_request_task.cc:76: RemoveExpiredEntries(std::move(expired_requests)); On 2016/11/03 19:56:51, dougarnett wrote: > On 2016/11/03 ...
4 years, 1 month ago (2016-11-04 18:53:37 UTC) #17
dougarnett
https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode76 components/offline_pages/background/pick_request_task.cc:76: RemoveExpiredEntries(std::move(expired_requests)); On 2016/11/04 18:53:37, Pete Williamson wrote: > On ...
4 years, 1 month ago (2016-11-04 19:28:27 UTC) #18
fgorski
https://codereview.chromium.org/2473553004/diff/20001/components/offline_pages/background/pick_request_task_builder.h File components/offline_pages/background/pick_request_task_builder.h (right): https://codereview.chromium.org/2473553004/diff/20001/components/offline_pages/background/pick_request_task_builder.h#newcode20 components/offline_pages/background/pick_request_task_builder.h:20: class PickRequestTaskBuilder { On 2016/11/04 18:53:37, Pete Williamson wrote: ...
4 years, 1 month ago (2016-11-04 21:41:29 UTC) #19
dougarnett
lgtm subject to adding TODO and addressing Filip's comments https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/1/components/offline_pages/background/pick_request_task.cc#newcode76 components/offline_pages/background/pick_request_task.cc:76: ...
4 years, 1 month ago (2016-11-07 17:09:07 UTC) #20
fgorski
Adding the comment capturing what we discussed on Friday. https://codereview.chromium.org/2473553004/diff/60001/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/60001/components/offline_pages/background/pick_request_task.cc#newcode132 components/offline_pages/background/pick_request_task.cc:132: ...
4 years, 1 month ago (2016-11-07 17:27:10 UTC) #21
Pete Williamson
estade: PTAL at offline_internals_ui_message_handler.cc/.h I split out the result types from RequestQueue into a new ...
4 years, 1 month ago (2016-11-08 00:36:45 UTC) #23
dougarnett
Looks like some tests broke with the merge
4 years, 1 month ago (2016-11-08 05:33:11 UTC) #28
Evan Stade
https://codereview.chromium.org/2473553004/diff/100001/components/offline_pages/background/queue_results.h File components/offline_pages/background/queue_results.h (right): https://codereview.chromium.org/2473553004/diff/100001/components/offline_pages/background/queue_results.h#newcode15 components/offline_pages/background/queue_results.h:15: struct QueueResults { why this struct? seems like these ...
4 years, 1 month ago (2016-11-08 14:40:30 UTC) #29
Pete Williamson
tests fixed, comments all addressed. https://codereview.chromium.org/2473553004/diff/100001/components/offline_pages/background/queue_results.h File components/offline_pages/background/queue_results.h (right): https://codereview.chromium.org/2473553004/diff/100001/components/offline_pages/background/queue_results.h#newcode15 components/offline_pages/background/queue_results.h:15: struct QueueResults { On ...
4 years, 1 month ago (2016-11-08 22:13:53 UTC) #30
Evan Stade
https://codereview.chromium.org/2473553004/diff/140001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc (right): https://codereview.chromium.org/2473553004/diff/140001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc#newcode157 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc:157: if (result == offline_pages::QueueResults::GetRequestsResult::SUCCESS) { doesn't seem this was ...
4 years, 1 month ago (2016-11-08 23:13:36 UTC) #35
Pete Williamson
estate CR feedback, and took another merge https://codereview.chromium.org/2473553004/diff/140001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc (right): https://codereview.chromium.org/2473553004/diff/140001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc#newcode157 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc:157: if (result ...
4 years, 1 month ago (2016-11-09 00:24:48 UTC) #38
Evan Stade
offline_internals_ui_message_handler.* lgtm
4 years, 1 month ago (2016-11-09 00:42:03 UTC) #39
Evan Stade
https://codereview.chromium.org/2473553004/diff/160001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h (left): https://codereview.chromium.org/2473553004/diff/160001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h#oldcode66 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h:66: offline_pages::RequestQueue::GetRequestsResult result, wait a second, enum class lets you ...
4 years, 1 month ago (2016-11-09 00:43:04 UTC) #40
Pete Williamson
https://codereview.chromium.org/2473553004/diff/160001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h (left): https://codereview.chromium.org/2473553004/diff/160001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h#oldcode66 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h:66: offline_pages::RequestQueue::GetRequestsResult result, On 2016/11/09 00:43:03, Evan Stade wrote: > ...
4 years, 1 month ago (2016-11-09 00:55:29 UTC) #41
Evan Stade
lgtm with nit https://codereview.chromium.org/2473553004/diff/180001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h (right): https://codereview.chromium.org/2473553004/diff/180001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h#newcode16 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h:16: // Forward declare the result types ...
4 years, 1 month ago (2016-11-09 01:00:30 UTC) #42
fgorski
A few more comments. (Mostly task implementation and nits) https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/mark_attempt_completed_task.h File components/offline_pages/background/mark_attempt_completed_task.h (right): https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/mark_attempt_completed_task.h#newcode12 components/offline_pages/background/mark_attempt_completed_task.h:12: ...
4 years, 1 month ago (2016-11-09 17:58:08 UTC) #43
dougarnett
https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.cc#newcode71 components/offline_pages/background/pick_request_task.cc:71: expired_request_ids.push_back(request->request_id()); this *_ids vector not actually used?
4 years, 1 month ago (2016-11-09 18:23:51 UTC) #44
dougarnett
https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.cc#newcode103 components/offline_pages/background/pick_request_task.cc:103: if (!RequestConditionsSatisfied(valid_requests[i].get())) On 2016/11/09 17:58:06, fgorski wrote: > I ...
4 years, 1 month ago (2016-11-09 18:39:56 UTC) #45
Pete Williamson
https://codereview.chromium.org/2473553004/diff/180001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h File chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h (right): https://codereview.chromium.org/2473553004/diff/180001/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h#newcode16 chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.h:16: // Forward declare the result types we use from ...
4 years, 1 month ago (2016-11-09 23:53:56 UTC) #46
fgorski
Mostly looks good. Let me know if you need help fixing the tests. https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/mark_attempt_completed_task.h File ...
4 years, 1 month ago (2016-11-10 19:15:51 UTC) #51
Pete Williamson
https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.h File components/offline_pages/background/pick_request_task.h (right): https://codereview.chromium.org/2473553004/diff/180001/components/offline_pages/background/pick_request_task.h#newcode101 components/offline_pages/background/pick_request_task.h:101: // Member variables, all pointers unowned. On 2016/11/10 19:15:50, ...
4 years, 1 month ago (2016-11-10 23:43:26 UTC) #52
fgorski
lgtm https://codereview.chromium.org/2473553004/diff/200001/components/offline_pages/background/pick_request_task.cc File components/offline_pages/background/pick_request_task.cc (right): https://codereview.chromium.org/2473553004/diff/200001/components/offline_pages/background/pick_request_task.cc#newcode106 components/offline_pages/background/pick_request_task.cc:106: // that they are scheduled when we run ...
4 years, 1 month ago (2016-11-11 00:25:22 UTC) #57
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/2473553004/220001
4 years, 1 month ago (2016-11-11 00:47:50 UTC) #60
commit-bot: I haz the power
Failed to apply patch for components/offline_pages/background/request_coordinator.cc: While running git apply --index -p1; error: patch failed: ...
4 years, 1 month ago (2016-11-11 01:53:49 UTC) #62
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/2473553004/240001
4 years, 1 month ago (2016-11-11 18:12:39 UTC) #65
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 1 month ago (2016-11-11 19:30:20 UTC) #67
commit-bot: I haz the power
4 years, 1 month ago (2016-11-11 20:00:05 UTC) #69
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/3113e19fb5a58ae8dd2bbc7af58c7584486120c0
Cr-Commit-Position: refs/heads/master@{#431617}

Powered by Google App Engine
This is Rietveld 408576698