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

Issue 2529283002: Save favicon during reading list distillation (Closed)

Created:
4 years ago by gambard
Modified:
4 years ago
CC:
chromium-reviews, sdefresne+watch_chromium.org, pkl (ping after 24h if needed), mac-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Save favicon during reading list distillation As the lifespan of the DistillerPage is shorter than the one needed by the WebState to download the favicon, the WebState needs to outlive the DistillerPage. As the favicon download should not impact too much the distillation time, the next distillation should be launch before the previous one is finished. This Dispatcher will makes sure the WebState survive long enough to download the Favicon after it is returned. BUG=664988 Committed: https://crrev.com/59fe574e35aecc8732b382751257bfef883514e2 Cr-Commit-Position: refs/heads/master@{#440065}

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Add a comment #

Total comments: 17

Patch Set 4 : Test using the WebObserver #

Patch Set 5 : Rename classes #

Patch Set 6 : Add comments #

Patch Set 7 : Using web state #

Total comments: 32

Patch Set 8 : Use WebState pool #

Total comments: 2

Patch Set 9 : Use dispatcher #

Patch Set 10 : Cleanup #

Total comments: 10

Patch Set 11 : Address olivierrobin's comments #

Patch Set 12 : Add DependsOn #

Total comments: 7

Patch Set 13 : Address comments #

Patch Set 14 : Fix constructor #

Total comments: 4

Patch Set 15 : Adding tests #

Patch Set 16 : Fix BUILD.gn #

Patch Set 17 : Add constructor comments #

Total comments: 29

Patch Set 18 : Address comments #

Total comments: 28

Patch Set 19 : Change map to vector #

Total comments: 17

Patch Set 20 : Address comments #

Patch Set 21 : Fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+357 lines, -70 lines) Patch
M components/dom_distiller/ios/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M components/dom_distiller/ios/DEPS View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/dom_distiller/ios/distiller_page_factory_ios.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +8 lines, -6 lines 0 comments Download
M components/dom_distiller/ios/distiller_page_factory_ios.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +7 lines, -5 lines 0 comments Download
M components/dom_distiller/ios/distiller_page_ios.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -11 lines 0 comments Download
M components/dom_distiller/ios/distiller_page_ios.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +47 lines, -26 lines 0 comments Download
A components/dom_distiller/ios/favicon_web_state_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +34 lines, -0 lines 0 comments Download
M ios/chrome/browser/dom_distiller/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +26 lines, -1 line 0 comments Download
M ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +30 lines, -19 lines 0 comments Download
A ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +44 lines, -0 lines 0 comments Download
A ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +77 lines, -0 lines 0 comments Download
A ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +76 lines, -0 lines 0 comments Download
M ios/chrome/test/BUILD.gn 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

Messages

Total messages: 73 (19 generated)
gambard
PTAL. https://codereview.chromium.org/2529283002/diff/40001/components/dom_distiller/ios/distiller_page_ios.mm File components/dom_distiller/ios/distiller_page_ios.mm (right): https://codereview.chromium.org/2529283002/diff/40001/components/dom_distiller/ios/distiller_page_ios.mm#newcode24 components/dom_distiller/ios/distiller_page_ios.mm:24: std::string favicon_script_ = This script is the same ...
4 years ago (2016-11-28 10:20:04 UTC) #2
gambard
+kkhorimoto@ as eugene is OOO. PTAL.
4 years ago (2016-11-28 16:49:30 UTC) #4
kkhorimoto
High level comment: I'm not exactly sure what this CL is changing. It looks like ...
4 years ago (2016-11-28 23:48:26 UTC) #5
gambard
Thanks for your comments. I am just addressing the high level comment. Yes, we want ...
4 years ago (2016-11-30 10:59:43 UTC) #6
gambard
I am doing a new approach in this CL: https://codereview.chromium.org/2541093002 following the recommendation of not ...
4 years ago (2016-11-30 17:12:24 UTC) #7
kkhorimoto
I took a look at your other CL. It looks like you're following my advice ...
4 years ago (2016-11-30 18:27:16 UTC) #8
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2529283002/diff/40001/components/dom_distiller/ios/distiller_favicon_ios.h File components/dom_distiller/ios/distiller_favicon_ios.h (right): https://codereview.chromium.org/2529283002/diff/40001/components/dom_distiller/ios/distiller_favicon_ios.h#newcode21 components/dom_distiller/ios/distiller_favicon_ios.h:21: virtual void HandleFaviconURL(std::vector<web::FaviconURL> urls, Optional nit: Per C+++ Style ...
4 years ago (2016-11-30 18:51:31 UTC) #9
gambard
This is a new version, based on the high level feedbacks provided. PTAL.
4 years ago (2016-12-02 16:36:57 UTC) #10
Eugene But (OOO till 7-30)
Our architectural goal is to remove WebControllerProvider/WebControllerProviderFactory etc... So I don't think we should write ...
4 years ago (2016-12-02 16:44:41 UTC) #11
kkhorimoto
On 2016/12/02 16:44:41, Eugene But wrote: > Our architectural goal is to remove > WebControllerProvider/WebControllerProviderFactory ...
4 years ago (2016-12-02 21:48:14 UTC) #12
gambard
On 2016/12/02 21:48:14, kkhorimoto_ wrote: > On 2016/12/02 16:44:41, Eugene But wrote: > > Our ...
4 years ago (2016-12-05 10:15:54 UTC) #13
Eugene But (OOO till 7-30)
On 2016/12/05 10:15:54, gambard wrote: > On 2016/12/02 21:48:14, kkhorimoto_ wrote: > > On 2016/12/02 ...
4 years ago (2016-12-05 17:42:40 UTC) #14
kkhorimoto
On 2016/12/05 17:42:40, Eugene But wrote: > On 2016/12/05 10:15:54, gambard wrote: > > On ...
4 years ago (2016-12-05 18:04:52 UTC) #15
Eugene But (OOO till 7-30)
On 2016/12/05 18:04:52, kkhorimoto_ wrote: > On 2016/12/05 17:42:40, Eugene But wrote: > > On ...
4 years ago (2016-12-05 19:02:23 UTC) #16
gambard
Thanks, I tried using NavigationController's loadURLWithParams but it does not works because it's calling CRWWebController's ...
4 years ago (2016-12-06 15:23:32 UTC) #17
Eugene But (OOO till 7-30)
On 2016/12/06 15:23:32, gambard wrote: > Thanks, I tried using NavigationController's loadURLWithParams but it does ...
4 years ago (2016-12-06 15:55:56 UTC) #18
gambard
Thanks for the comments, I have made a new version using WebState. PTAL, high level ...
4 years ago (2016-12-08 15:01:42 UTC) #19
Eugene But (OOO till 7-30)
On 2016/12/08 15:01:42, gambard wrote: > Thanks for the comments, I have made a new ...
4 years ago (2016-12-08 15:26:21 UTC) #20
Eugene But (OOO till 7-30)
Thank you for refactoring! High level this looks good. SO I just commented on everything. ...
4 years ago (2016-12-08 15:34:54 UTC) #21
Olivier
I am not sure if this works but it may be worth trying this. https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/distiller_page_ios.h ...
4 years ago (2016-12-08 18:28:02 UTC) #23
kkhorimoto
https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/distiller_page_factory_ios.mm File components/dom_distiller/ios/distiller_page_factory_ios.mm (right): https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/distiller_page_factory_ios.mm#newcode19 components/dom_distiller/ios/distiller_page_factory_ios.mm:19: web_state_ = web::WebState::Create(webStateCreateParams); As per higher level discussion on ...
4 years ago (2016-12-08 22:15:24 UTC) #24
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/distiller_page_ios.mm File components/dom_distiller/ios/distiller_page_ios.mm (right): https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/distiller_page_ios.mm#newcode21 components/dom_distiller/ios/distiller_page_ios.mm:21: #include "ios/web/public/web_state/web_state.h" On 2016/12/08 22:15:24, kkhorimoto_ wrote: > On ...
4 years ago (2016-12-08 22:45:34 UTC) #25
gambard
Thanks, PTAL! https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/DEPS File components/dom_distiller/ios/DEPS (right): https://codereview.chromium.org/2529283002/diff/120001/components/dom_distiller/ios/DEPS#newcode3 components/dom_distiller/ios/DEPS:3: "+ios/public/provider/web", On 2016/12/08 15:34:53, Eugene But wrote: ...
4 years ago (2016-12-12 15:04:26 UTC) #26
Eugene But (OOO till 7-30)
Resource Pools are used when resource creation is time consuming operation (like threads creation) and ...
4 years ago (2016-12-12 16:15:49 UTC) #27
gambard
Thanks. I have updated the CL description to explain what I am doing. The pool ...
4 years ago (2016-12-12 16:58:06 UTC) #29
Eugene But (OOO till 7-30)
On 2016/12/12 16:58:06, gambard wrote: > Thanks. > I have updated the CL description to ...
4 years ago (2016-12-12 17:19:30 UTC) #30
gambard
Thanks, PTAL.
4 years ago (2016-12-13 10:39:52 UTC) #32
Olivier
https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/distiller_page_factory_ios.mm File components/dom_distiller/ios/distiller_page_factory_ios.mm (right): https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/distiller_page_factory_ios.mm#newcode24 components/dom_distiller/ios/distiller_page_factory_ios.mm:24: DistillerPageFactoryIOS::~DistillerPageFactoryIOS() {} before CreateDistillerPage https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/web_state_dispatcher.h File components/dom_distiller/ios/web_state_dispatcher.h (right): https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/web_state_dispatcher.h#newcode19 ...
4 years ago (2016-12-13 14:29:10 UTC) #33
gambard
Thanks, PTAL. https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/distiller_page_factory_ios.mm File components/dom_distiller/ios/distiller_page_factory_ios.mm (right): https://codereview.chromium.org/2529283002/diff/180001/components/dom_distiller/ios/distiller_page_factory_ios.mm#newcode24 components/dom_distiller/ios/distiller_page_factory_ios.mm:24: DistillerPageFactoryIOS::~DistillerPageFactoryIOS() {} On 2016/12/13 14:29:10, Olivier Robin ...
4 years ago (2016-12-13 16:25:53 UTC) #34
Eugene But (OOO till 7-30)
Looks like the logic of icon download is shared between 2 classes dispatcher (which manages ...
4 years ago (2016-12-13 16:31:19 UTC) #35
Olivier
https://codereview.chromium.org/2529283002/diff/180001/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc File ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc (right): https://codereview.chromium.org/2529283002/diff/180001/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc#newcode69 ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc:69: : BrowserStateKeyedServiceFactory( On 2016/12/13 16:25:53, gambard wrote: > On ...
4 years ago (2016-12-13 16:31:21 UTC) #36
kkhorimoto
lgtm
4 years ago (2016-12-13 19:38:24 UTC) #37
noyau (Ping after 24h)
All this code in in dom_distiller. lgtm.
4 years ago (2016-12-16 09:25:25 UTC) #39
gambard
https://codereview.chromium.org/2529283002/diff/180001/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc File ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc (right): https://codereview.chromium.org/2529283002/diff/180001/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc#newcode69 ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc:69: : BrowserStateKeyedServiceFactory( On 2016/12/13 16:31:21, Olivier Robin wrote: > ...
4 years ago (2016-12-16 10:26:47 UTC) #40
Olivier
https://codereview.chromium.org/2529283002/diff/220001/components/dom_distiller/ios/distiller_page_factory_ios.h File components/dom_distiller/ios/distiller_page_factory_ios.h (right): https://codereview.chromium.org/2529283002/diff/220001/components/dom_distiller/ios/distiller_page_factory_ios.h#newcode32 components/dom_distiller/ios/distiller_page_factory_ios.h:32: std::unique_ptr<WebStateDispatcher> web_state_dispatcher_; NIT: disallow copy https://codereview.chromium.org/2529283002/diff/220001/components/dom_distiller/ios/web_state_dispatcher.h File components/dom_distiller/ios/web_state_dispatcher.h (right): ...
4 years ago (2016-12-16 10:31:31 UTC) #41
gambard
Thanks, PTAL. https://codereview.chromium.org/2529283002/diff/220001/components/dom_distiller/ios/distiller_page_factory_ios.h File components/dom_distiller/ios/distiller_page_factory_ios.h (right): https://codereview.chromium.org/2529283002/diff/220001/components/dom_distiller/ios/distiller_page_factory_ios.h#newcode32 components/dom_distiller/ios/distiller_page_factory_ios.h:32: std::unique_ptr<WebStateDispatcher> web_state_dispatcher_; On 2016/12/16 10:31:31, Olivier Robin ...
4 years ago (2016-12-16 13:49:19 UTC) #42
Olivier
https://codereview.chromium.org/2529283002/diff/220001/ios/chrome/browser/dom_distiller/web_state_dispatcher_impl.mm File ios/chrome/browser/dom_distiller/web_state_dispatcher_impl.mm (right): https://codereview.chromium.org/2529283002/diff/220001/ios/chrome/browser/dom_distiller/web_state_dispatcher_impl.mm#newcode52 ios/chrome/browser/dom_distiller/web_state_dispatcher_impl.mm:52: (int64_t)(kMaxDelayFavicon * NSEC_PER_SEC)), On 2016/12/16 13:49:19, gambard wrote: > ...
4 years ago (2016-12-16 14:10:50 UTC) #43
Eugene But (OOO till 7-30)
Thank you for your patience. lgtm. Could you please add a unittest for WebStateDispatcher? https://codereview.chromium.org/2529283002/diff/260001/components/dom_distiller/ios/web_state_dispatcher.h ...
4 years ago (2016-12-16 15:03:50 UTC) #44
gambard
Thanks, PTAL. Tests added. https://codereview.chromium.org/2529283002/diff/260001/components/dom_distiller/ios/web_state_dispatcher.h File components/dom_distiller/ios/web_state_dispatcher.h (right): https://codereview.chromium.org/2529283002/diff/260001/components/dom_distiller/ios/web_state_dispatcher.h#newcode14 components/dom_distiller/ios/web_state_dispatcher.h:14: // Dispatcher for WebState with ...
4 years ago (2016-12-19 09:09:08 UTC) #45
gambard
+sdefresne for DEPS include
4 years ago (2016-12-19 13:24:06 UTC) #47
Olivier
LGTM one suggestion. https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_ios.mm File components/dom_distiller/ios/distiller_page_ios.mm (right): https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_ios.mm#newcode201 components/dom_distiller/ios/distiller_page_ios.mm:201: void DistillerPageIOS::HandleJavaScriptResult(id result) { Early return ...
4 years ago (2016-12-19 14:05:32 UTC) #48
Eugene But (OOO till 7-30)
Thank you for the test! https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_factory_ios.h File components/dom_distiller/ios/distiller_page_factory_ios.h (right): https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_factory_ios.h#newcode21 components/dom_distiller/ios/distiller_page_factory_ios.h:21: DistillerPageFactoryIOS( explicit https://codereview.chromium.org/2529283002/diff/320001/ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl.h File ...
4 years ago (2016-12-19 17:30:07 UTC) #49
gambard
Thanks! https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_factory_ios.h File components/dom_distiller/ios/distiller_page_factory_ios.h (right): https://codereview.chromium.org/2529283002/diff/320001/components/dom_distiller/ios/distiller_page_factory_ios.h#newcode21 components/dom_distiller/ios/distiller_page_factory_ios.h:21: DistillerPageFactoryIOS( On 2016/12/19 17:30:06, Eugene But wrote: > ...
4 years ago (2016-12-20 08:54:23 UTC) #50
sdefresne
https://codereview.chromium.org/2529283002/diff/340001/components/dom_distiller/ios/distiller_page_factory_ios.mm File components/dom_distiller/ios/distiller_page_factory_ios.mm (right): https://codereview.chromium.org/2529283002/diff/340001/components/dom_distiller/ios/distiller_page_factory_ios.mm#newcode22 components/dom_distiller/ios/distiller_page_factory_ios.mm:22: return base::WrapUnique<DistillerPage>( nit: please use base::MakeUnique<> here (or add ...
4 years ago (2016-12-20 15:41:00 UTC) #55
gambard
Thanks, sdefresne@: PTAL, specifically the map->vector change. https://codereview.chromium.org/2529283002/diff/340001/components/dom_distiller/ios/distiller_page_factory_ios.mm File components/dom_distiller/ios/distiller_page_factory_ios.mm (right): https://codereview.chromium.org/2529283002/diff/340001/components/dom_distiller/ios/distiller_page_factory_ios.mm#newcode22 components/dom_distiller/ios/distiller_page_factory_ios.mm:22: return base::WrapUnique<DistillerPage>( ...
4 years ago (2016-12-20 17:11:43 UTC) #56
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2529283002/diff/320001/ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm File ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm (right): https://codereview.chromium.org/2529283002/diff/320001/ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm#newcode32 ios/chrome/browser/dom_distiller/favicon_web_state_dispatcher_impl_unittest.mm:32: web::TestWebThreadBundle thread_bundle_; On 2016/12/20 08:54:22, gambard wrote: > On ...
4 years ago (2016-12-20 17:36:18 UTC) #57
sdefresne
lgtm with some suggestions https://codereview.chromium.org/2529283002/diff/360001/components/dom_distiller/ios/distiller_page_ios.mm File components/dom_distiller/ios/distiller_page_ios.mm (right): https://codereview.chromium.org/2529283002/diff/360001/components/dom_distiller/ios/distiller_page_ios.mm#newcode156 components/dom_distiller/ios/distiller_page_ios.mm:156: nit: I think using early ...
4 years ago (2016-12-20 18:05:31 UTC) #58
Eugene But (OOO till 7-30)
And just to clarify, you have my lgtm already... These were just follow up nits. ...
4 years ago (2016-12-20 18:59:02 UTC) #59
gambard
Thanks! https://codereview.chromium.org/2529283002/diff/360001/components/dom_distiller/ios/distiller_page_ios.mm File components/dom_distiller/ios/distiller_page_ios.mm (right): https://codereview.chromium.org/2529283002/diff/360001/components/dom_distiller/ios/distiller_page_ios.mm#newcode156 components/dom_distiller/ios/distiller_page_ios.mm:156: On 2016/12/20 18:05:31, sdefresne wrote: > nit: I ...
4 years ago (2016-12-21 08:42:52 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/2529283002/380001
4 years ago (2016-12-21 08:42:55 UTC) #63
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/126532)
4 years ago (2016-12-21 08:48:57 UTC) #65
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/2529283002/400001
4 years ago (2016-12-21 08:56:00 UTC) #68
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years ago (2016-12-21 10:07:00 UTC) #71
commit-bot: I haz the power
4 years ago (2016-12-21 10:10:13 UTC) #73
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/59fe574e35aecc8732b382751257bfef883514e2
Cr-Commit-Position: refs/heads/master@{#440065}

Powered by Google App Engine
This is Rietveld 408576698