|
|
DescriptionRemove useless FaviconHandler::PageChangedSinceFaviconWasRequested()
Remove FaviconHandler::PageChangedSinceFaviconWasRequested() since both
- FaviconHandler::url_ changes (FaviconHandler::FetchFavicon())
- The NavigationController's last committed URL changes
(NavigationControllerImpl::RendererDidNavigate())
only as a result of NavigatorImpl::DidNavigate()
BUG=517089
TEST=None
Committed: https://crrev.com/38c2b85c4d3f1426e6abab4990779d10edb0e550
Cr-Commit-Position: refs/heads/master@{#351113}
Patch Set 1 : #
Total comments: 1
Patch Set 2 : #Patch Set 3 : #
Total comments: 1
Patch Set 4 : #
Total comments: 1
Patch Set 5 : #
Total comments: 4
Patch Set 6 : #
Total comments: 5
Patch Set 7 : #Patch Set 8 : #
Total comments: 4
Patch Set 9 : #Patch Set 10 : #Dependent Patchsets: Messages
Total messages: 76 (21 generated)
Patchset #1 (id:1) has been deleted
pkotwicz@chromium.org changed reviewers: + stevenjb@chromium.org
Steven can you please take a look? I am writing this CL because the FaviconHandler code was been rotting away and people have been duplicating its functionality I do not understand the fix to http://crbug.com/119437. Do you remember why the fix worked? I have confirmed that the bug does not reproduce with my change FaviconHandler::PageChangedSinceFaviconWasRequested() is no longer needed as a result of using NavigationController::GetLastCommittedEntry() instead of NavigationController::GetActiveEntry() in FaviconHandler. This change was made in https://codereview.chromium.org/1211993005 A couple of things I checked: - Subframe navigations can occur without FaviconHandler knowing about them. NavigationEntry::GetURL() for subframe navigations is the URL of the main page - The history.pushState() JS call causes FaviconHandler::OnUpdateFaviconURL() to be called
On 2015/08/05 22:29:54, pkotwicz wrote: > Steven can you please take a look? > > I am writing this CL because the FaviconHandler code was been rotting away and > people have been duplicating its functionality > > I do not understand the fix to http://crbug.com/119437. Do you remember why the > fix worked? I have confirmed that the bug does not reproduce with my change > > FaviconHandler::PageChangedSinceFaviconWasRequested() is no longer needed as a > result of using NavigationController::GetLastCommittedEntry() instead of > NavigationController::GetActiveEntry() in FaviconHandler. This change was made > in https://codereview.chromium.org/1211993005 > > A couple of things I checked: > - Subframe navigations can occur without FaviconHandler knowing about them. > NavigationEntry::GetURL() for subframe navigations is the URL of the main page > - The history.pushState() JS call causes FaviconHandler::OnUpdateFaviconURL() to > be called It's been a long time since I looked at the favicon code, but looking at that CL (which no longer appears to resemble the current code) it looks like there were two bugs addressed there: 1) If there was no current candidate we weren't returning true when there was an exact match, potentially causing an incorrect additional request. 2) We weren't correctly identifying http://foo?bar=1 is the same page as http://foo?bar=2 PageChangedSinceFaviconWasRequested() is new to me. It appears to have been added in https://codereview.chromium.org/261403003. You should probably get jif@ or blundell@ to review this.
pkotwicz@chromium.org changed reviewers: + sky@chromium.org
Scott, can you please take a look?
Update: It looks like changing window.location.hash does not cause FaviconHandler::OnUpdateFaviconURL() to get called. I still believe that this CL is correct I now better understand the fix to http://crbug.com/119437
Where does the code now handle the case of the url changing after we start download/query history.
Scott, I do not understand comment #8. I have tried changing the if statement in UrlMatches() in favicon_handler.cc to a CHECK() and downloading a couple of files and did not get a crash. I am unsure what you mean by "query history". Do you mean navigating history via Javascript?
What I meant was we start the query for history and then the page url changes. Say a new navigation happens. At one point the code dealt with trying to save the favicon, but that was disabled. Where do we handle the case of the url changing now? -Scott On Thu, Aug 6, 2015 at 2:49 PM, <pkotwicz@chromium.org> wrote: > Scott, I do not understand comment #8. > > I have tried changing the if statement in UrlMatches() in favicon_handler.cc > to > a CHECK() and downloading a couple of files and did not get a crash. I am > unsure > what you mean by "query history". Do you mean navigating history via > Javascript? > > https://codereview.chromium.org/1272413002/ To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
LGTM https://codereview.chromium.org/1272413002/diff/20001/components/favicon/core... File components/favicon/core/favicon_handler.h (right): https://codereview.chromium.org/1272413002/diff/20001/components/favicon/core... components/favicon/core/favicon_handler.h:237: bool PageChangedSinceFaviconWasRequested(); remove this.
Patchset #2 (id:40001) has been deleted
The CQ bit was checked by pkotwicz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from sky@chromium.org Link to the patchset: https://codereview.chromium.org/1272413002/#ps60001 (title: " ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1272413002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1272413002/60001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
pkotwicz@chromium.org changed reviewers: + sdefresne@chromium.org
sdefresne@ can you please take a look at whether this CL is ok w.r.t to iOS? I know that the CL is ok on desktop Chrome
Patchset #3 (id:80001) has been deleted
Patchset #3 (id:100001) has been deleted
stuartmorgan@ can you please take a look? I have changed the CL so that it does not change the current behavior on iOS. https://codereview.chromium.org/1272413002/diff/120001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/120001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:103: // changes as a result of CRWSessionController::goToEntry(). FaviconHandler FetchFavicon() is called by CRWUIWebViewWebController::checkForUnexpectedURLChange() asynchronously as a result of CRWSessionController::goToEntry()
Patchset #4 (id:140001) has been deleted
Patchset #4 (id:160001) has been deleted
pkotwicz@chromium.org changed reviewers: + rohitrao@chromium.org
eugenebut@ can you please take a look at the iOS changes in this CL? It looks like stuartmorgan@ is OOO this week.
pkotwicz@chromium.org changed reviewers: + stuartmorgan@chromium.org
rohitrao@ can you please take a look at the iOS changes in this CL? (Sorry, I included the wrong LDAP in comment #22) It looks like stuartmorgan@ is OOO this week.
sorry this review fell through my inbox, lgtm https://codereview.chromium.org/1272413002/diff/180001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/180001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:81: return ActiveURLChangedSinceFetchFavicon() ? false : GetFaviconStatus().valid; nit (optional): return !ActiveURLChangedSinceFetchFavicon() && GetFaviconStatus().valid;
rohitrao@ ping!
Two general questions, since the overall correctness of this isn't clear to me (not to say it's wrong, just that I don't understand from just the CL why it's necessarily right): - What's the answer to comment 10? - More generally, why is having the initial call be at the same time as a URL change enough to remove all the URL tracking, given that the fetch is async? https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:98: // has changed. Could you add a TODO (you can put me as the reference) to eliminate this once iOS only triggers favicon fetches synchronously, matching other platforms? https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:106: return GetActiveURL() != fetch_favicon_url_; Why drop the fragment-trimming logic?
Patchset #6 (id:220001) has been deleted
Patchset #6 (id:240001) has been deleted
stuartmorgan@ can you please take another look? > Two general questions, since the overall correctness of this isn't clear to me > (not to say it's wrong, just that I don't understand from just the CL why it's > necessarily right): > - What's the answer to comment 10? > - More generally, why is having the initial call be at the same time as a URL > change enough to remove all the URL tracking, given that the fetch is async? FaviconHandler::FetchFavicon(): - starts a fetch for the favicon for the passed in URL - cancels any in-progress fetches Because FaviconHandler::FetchFavicon() cancels any in progress fetches, we can remove all of the URL tracking as long as the FaviconHandler::FetchFavicon() call occurs at the same time as the when the return value of FaviconDriver::GetActiveURL() changes Answer to comment 10: FaviconHandler::FetchFavicon() did not always cancel in-progress fetches. https://codereview.chromium.org/1084473002 (landed 4 months ago) started cancelling in-progress fetches because there were long standing bugs w.r.t to processing in-progress fetches. From offline conversation with sky@, my understanding is that sky@'s comment is not valid because FaviconHandler::FetchFavicon() cancels in-progress fetches. https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:98: // has changed. On 2015/09/03 23:11:29, stuartmorgan wrote: > Could you add a TODO (you can put me as the reference) to eliminate this once > iOS only triggers favicon fetches synchronously, matching other platforms? Done. https://codereview.chromium.org/1272413002/diff/200001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:106: return GetActiveURL() != fetch_favicon_url_; I put it back in for iOS
stuartmorgan@ ping!
iOS portion LGTM
Scott, can you please take a look at the new CL? I have added the iOS handling since you last looked at it
https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... File components/favicon/core/favicon_driver.h (right): https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... components/favicon/core/favicon_driver.h:83: virtual bool ShouldSendFaviconAvailableNotifications() = 0; This feels awkward. Why not cancel the fetch? https://codereview.chromium.org/1272413002/diff/260001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/260001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:22: std::string UrlWithoutFragment(const GURL& gurl) { Return a GURL? Especially given the name you went with.
Patchset #7 (id:280001) has been deleted
Scott, can you please take another look? https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... File components/favicon/core/favicon_driver.h (right): https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... components/favicon/core/favicon_driver.h:83: virtual bool ShouldSendFaviconAvailableNotifications() = 0; It is awkward. In order to cancel the fetch we need to somehow get notified when the active URL changes. I do not know how to get notified when the active URL changes on iOS (Looking at the iOS code base this does not seem straightforward) Personally, I am ok with this awkwardness on iOS for now. The correct thing to do in the long term is to make iOS call FetchFavicon() at the same times as all of the other OSes do. Landing this CL clears the way for further simplification of FaviconHandler too https://codereview.chromium.org/1272413002/diff/260001/components/favicon/ios... File components/favicon/ios/web_favicon_driver.cc (right): https://codereview.chromium.org/1272413002/diff/260001/components/favicon/ios... components/favicon/ios/web_favicon_driver.cc:22: std::string UrlWithoutFragment(const GURL& gurl) { On 2015/09/11 15:27:15, sky wrote: > Return a GURL? Especially given the name you went with. Done.
https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... File components/favicon/core/favicon_driver.h (right): https://codereview.chromium.org/1272413002/diff/260001/components/favicon/cor... components/favicon/core/favicon_driver.h:83: virtual bool ShouldSendFaviconAvailableNotifications() = 0; On 2015/09/11 17:39:58, pkotwicz wrote: > It is awkward. In order to cancel the fetch we need to somehow get notified when > the active URL changes. I do not know how to get notified when the active URL > changes on iOS (Looking at the iOS code base this does not seem straightforward) I'm not familiar with the iOS code. Might rohitrao know the answer? > Personally, I am ok with this awkwardness on iOS for now. The correct thing to > do in the long term is to make iOS call FetchFavicon() at the same times as all > of the other OSes do. Landing this CL clears the way for further simplification > of FaviconHandler too
stuartmorgan@: Is there a way that WebFaviconDriver can be notified when NavigationManager::GetVisibleItem() changes?
stuartmorgan@: Is there a way that WebFaviconDriver can be notified when NavigationManager::GetVisibleItem() changes? (I am asking w.r.t to sky@'s comment #41)
On 2015/09/11 20:28:35, pkotwicz wrote: > stuartmorgan@: Is there a way that WebFaviconDriver can be notified when > NavigationManager::GetVisibleItem() changes? (I am asking w.r.t to sky@'s > comment #41) I believe if you registered as a WebSateObserver and looked at the URL when either of NavigationItemCommitted or ProvisionalNavigationStarted is called that should cover it. (I guess technically there could also be a transient entry that would change visible URL, but it's not clear to me that matters for this case.)
Capturing from some discussion: my basic feeling is that what's being done for the content side is fragile--the client code must always call into the favicon code exactly when, and every time, the URL changes, otherwise the favicon code will potentially assign favicons to the wrong navigation entry--and I'm not really excited about trying to replicate it onto iOS. Temporarily doing what's in the current CL on iOS in order to simplify the core code if that will make it easier to get to a more sane system (i.e., actually keeping track of what navigation entry the request is associated with in some explicit way instead of having to ensure that only one is in flight so that we can correctly infer which entry it goes with in a totally stateless way) is okay with me, since it doesn't spread beyond the component, which is why I lg'd it. If it's going to spread out into ios/web/, then I'd like to step back and ask why we can't just implement a tracking system in the favicon code now.
On Fri, Sep 11, 2015 at 3:38 PM, <stuartmorgan@chromium.org> wrote: > Capturing from some discussion: my basic feeling is that what's being done > for > the content side is fragile--the client code must always call into the > favicon > code exactly when, and every time, the URL changes, otherwise the favicon > code > will potentially assign favicons to the wrong navigation entry--and I'm not > really excited about trying to replicate it onto iOS. All code has expectations about how it is used. > Temporarily doing what's in the current CL on iOS in order to simplify the > core > code if that will make it easier to get to a more sane system (i.e., > actually > keeping track of what navigation entry the request is associated with in > some > explicit way instead of having to ensure that only one is in flight so that > we > can correctly infer which entry it goes with in a totally stateless way) is > okay > with me, since it doesn't spread beyond the component, which is why I lg'd > it. > If it's going to spread out into ios/web/, then I'd like to step back and > ask > why we can't just implement a tracking system in the favicon code now. Would it make more sense for the ios side to create a WebFaviconDriver per navigation? -Scott To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
I think that what stuartmorgan@ would like it if there was a method FaviconDriver::SetNavigationEntryFavicon(const GURL& page_url, const GURL icon_url, gfx::Image& image) which replaces FaviconDriver::SetActiveFaviconURL() and FaviconDriver::SetActiveFaviconImage() FaviconDriver::SetNavigationEntryFavicon() would update the NavigationEntries / NavigationItems which match the passed in page URL. This has the benefit of: - Protecting Chrome in the unlikely case that FaviconDriver goes rogue - Moving the ugliness entirely into iOS. We would be able to remove FaviconDriver::ShouldSendFaviconAvailableNotifications(). However, WebFaviconDriver::FaviconUrlUpdated(), would still need to check WebFaviconDriver::ActiveURLChangedSinceFetchFavicon() (WebFaviconDriver::GetActiveFaviconValidity() and WebFaviconDriver::GetActiveFaviconURL() would still need to too but those methods will disappear soonish)
I spent a lot of time thinking. - This CL is now less awkward. It checks whether FaviconHandler's version of the page URL is different from the active page URL in FaviconHandler::NotifyFaviconAvailable() In a future CL, I will remove WebFaviconDriver::ActiveURLChangedSinceFetchFavicon() (and WebFaviconDriver::GetActiveFaviconValidity() and WebFaviconDriver::GetActiveFaviconURL()) - There is now a DCHECK() which clearly indicates that the active page URL should not change between calls to FaviconHandler::FaviconFavicon() on non-iOS (Otherwise there will be people like me who will wonder why the if statement is there. In the past I have tried to figure out why if statements got added 3 - 4 years ago and it is extremely difficult. The fragment stripping logic in FaviconHandler::PageChangedSinceFaviconWasRequested() is one such example.) - This CL now protects against FaviconHandler going haywire on all OSes because the page URL is passed in FaviconHandler::NotifyFaviconAvailable() - FaviconHandler::NotifyFaviconAvailable() does not check the equality of URLs with the fragment stripped on iOS. - I have checked and http://crbug.com/119437 does not occur with fragment stripping logic removed on the desktop - I do not understand why we added the fragment stripping logic in the first place. Maybe the logic was added to handle how Gmail used to behave but no longer does? (It was added in https://codereview.chromium.org/9852012) - Favicons are completely busted as a result of fragment navigations on iOS with or without this CL. See http://crbug.com/531267 stuartmorgan@ I know that you were hoping that one day FaviconHandler::FetchFavicon() will not cancel the previous request. This is a feature request, and I do not foresee working on it this year.
sky@ and stuartmorgan@ can you please take another look? I spent a lot of time thinking. - This CL is now less awkward. It checks whether FaviconHandler's version of the page URL is different from the active page URL in FaviconHandler::NotifyFaviconAvailable() In a future CL, I will remove WebFaviconDriver::ActiveURLChangedSinceFetchFavicon() (and WebFaviconDriver::GetActiveFaviconValidity() and WebFaviconDriver::GetActiveFaviconURL()) - There is now a DCHECK() which clearly indicates that the active page URL should not change between calls to FaviconHandler::FaviconFavicon() on non-iOS (Otherwise there will be people like me who will wonder why the if statement is there. In the past I have tried to figure out why if statements got added 3 - 4 years ago and it is extremely difficult. The fragment stripping logic in FaviconHandler::PageChangedSinceFaviconWasRequested() is one such example.) - This CL now protects against FaviconHandler going haywire on all OSes because the page URL is passed in FaviconHandler::NotifyFaviconAvailable() - FaviconHandler::NotifyFaviconAvailable() does not check the equality of URLs with the fragment stripped on iOS. - I have checked and http://crbug.com/119437 does not occur with fragment stripping logic removed on the desktop - I do not understand why we added the fragment stripping logic in the first place. Maybe the logic was added to handle how Gmail used to behave but no longer does? (It was added in https://codereview.chromium.org/9852012) - Favicons are completely busted as a result of fragment navigations on iOS with or without this CL. See http://crbug.com/531267 stuartmorgan@ I know that you were hoping that one day FaviconHandler::FetchFavicon() will not cancel the previous request. This is a feature request, and I do not foresee working on it this year.
Patchset #8 (id:320001) has been deleted
Patchset #8 (id:340001) has been deleted
sky@ Ping!
https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... File components/favicon/core/favicon_driver_impl.cc (right): https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... components/favicon/core/favicon_driver_impl.cc:113: if (page_url != GetActiveURL()) Shouldn't this be an a #else?
https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... File components/favicon/core/favicon_driver_impl.cc (right): https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... components/favicon/core/favicon_driver_impl.cc:113: if (page_url != GetActiveURL()) I still check this on non-IOS in the case that FaviconHandler goes rogue. I have seen this pattern DCHECK(should_be_true); if (should_be_true) { } in a few places in the codebase.
https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... File components/favicon/core/favicon_driver_impl.cc (right): https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... components/favicon/core/favicon_driver_impl.cc:113: if (page_url != GetActiveURL()) On 2015/09/16 15:17:56, pkotwicz wrote: > I have seen this pattern > DCHECK(should_be_true); > if (should_be_true) { > } > > in a few places in the codebase. It's explicitly against Chromium's style guide.
sky@ and stuartmorgan@ can you please take another look? https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... File components/favicon/core/favicon_driver_impl.cc (right): https://codereview.chromium.org/1272413002/diff/360001/components/favicon/cor... components/favicon/core/favicon_driver_impl.cc:113: if (page_url != GetActiveURL()) Fixed now. You are right it is specifically mentioned in the style guide
On 2015/09/11 23:22:14, sky wrote: > On Fri, Sep 11, 2015 at 3:38 PM, <mailto:stuartmorgan@chromium.org> wrote: > > Capturing from some discussion: my basic feeling is that what's being done > > for > > the content side is fragile--the client code must always call into the > > favicon > > code exactly when, and every time, the URL changes, otherwise the favicon > > code > > will potentially assign favicons to the wrong navigation entry--and I'm not > > really excited about trying to replicate it onto iOS. > > All code has expectations about how it is used. Sure, but code where the expectation is that anyone ever making any changes to the navigation system must know about the implementation details of the favicon service is, IMO, a poor expectation for it to create. Good API is hard to use wrong, and an API that will essentially corrupt data if you ever forget to call part of it at the exact right time is easy to use wrong. I think a request that's specific to a navigation entry should be tracked in a way that binds back to that entry, rather than requiring that global state be in exactly the state it wants when it finishes.
I will defer to sky@ for design/architecture guidance. I will implement the design that stuartmorgan@ and sky@ agree upon.
On Wed, Sep 16, 2015 at 11:55 AM, <stuartmorgan@chromium.org> wrote: > On 2015/09/11 23:22:14, sky wrote: >> >> On Fri, Sep 11, 2015 at 3:38 PM, <mailto:stuartmorgan@chromium.org> >> wrote: >> > Capturing from some discussion: my basic feeling is that what's being >> > done >> > for >> > the content side is fragile--the client code must always call into the >> > favicon >> > code exactly when, and every time, the URL changes, otherwise the >> > favicon >> > code >> > will potentially assign favicons to the wrong navigation entry--and I'm >> > not >> > really excited about trying to replicate it onto iOS. > > >> All code has expectations about how it is used. > > > Sure, but code where the expectation is that anyone ever making any changes > to > the navigation system must know about the implementation details of the > favicon > service is, IMO, a poor expectation for it to create. Good API is hard to > use > wrong, and an API that will essentially corrupt data if you ever forget to > call > part of it at the exact right time is easy to use wrong. Agreed. > I think a request that's specific to a navigation entry should be tracked in > a > way that binds back to that entry, rather than requiring that global state > be in > exactly the state it wants when it finishes. Agreed. IMO these problems are because of how the favicon code was refactored. It could really use a cleanup. -Scott To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
sky@ and stuartmorgan@ can you please take another look? I agree that it is not obvious that the active entry's URL changes only when WebContentsObserver::DidNavigateMainFrame() is called. I added checking whether the active URL changed under us in FaviconDriverImpl::OnFaviconAvailable() for all OSes Favicon handling will forever be coupled tightly to navigations. We rely on the web contents to send us the icon URLs for the page. The correct favicon for the page cannot be determined till we get this information from the renderer. (We get this information when the page stops loading) It should not be necessary for FaviconHandler to know anything about NavigationEntries. If the current request needs to be cancelled, we can have a FaviconHandler::Cancel() method. Right now things are super confusing because FaviconHandler does not own its state. It stores its state in the NavigationEntry which is super confusing. I am trying to remove this coupling.
Ping!
I'm not sure I'm understanding the current patch; if you're checking for URL changes on all platforms, why does there need to be iOS-specific tracking of the URL that was requested?
The iOS-specific tracking is because FaviconHandler currently checks WebFaviconDriver::GetActiveFaviconValidity() and WebFaviconDriver::GetActiveFaviconURL(). I have a CL which removes WebFaviconDriver::GetActiveFaviconValidity() and WebFaviconDriver::GetActiveFaviconURL() Unfortunately, that CL is blocked on this one landing.
Okay, iOS lgtm then.
Scott, can you please take another look?
Can you provide an outline of the changes you're planning on doing?
My goal is to make the code in FaviconHandler more understandable. The end goal is not to fix any bugs but for the code to be simpler and clearer. I am not planning any major changes but rather to make lots of small changes which help readability. (My thinking is that if the code is simpler, it will be easier for others to fix bugs) I am planning on: - Making FaviconHandler not call FaviconDriver::GetActiveFaviconValidity() and not call FaviconDriver::GetActiveFaviconURL(). FaviconHandler should not know about the NavigationEntry. This looks easy to do. - Make FaviconHandler::OnFaviconDataForInitialURLFromFaviconService() and FaviconHandler::ProcessCurrentUrl() share code - Add an early exit so that if FaviconHandler::OnUpdateFaviconURL() is called twice with the same URLs that the second call is a no-op - Figure out why FaviconDriverImpl::OnFaviconAvailable() has the early exit if the passed in gfx::Image is empty and write a comment as to why the early exit is there - Look into whether the notification dispatching code in FaviconHandler::OnUpdateFaviconURL() can be simplified. (Why do we have two methods: FaviconDriverObserver::OnFaviconAvailable() and FaviconDriverObserver::OnFaviconUpdated() ?)
For instance, https://codereview.chromium.org/1295733002/ implements: "Add an early exit so that if FaviconHandler::OnUpdateFaviconURL() is called twice with the same URLs that the second call is a no-op"
I think FaviconHandler should be changed to focus on a single url. By that I mean you create a FaviconHandler with the url to get the icons for (FetchFavicon is nuked, the url is moved to the constructor). I think doing this would result in much less error prone class. I imagine this will entail lots of changes (for the better) to the surrounding classes as well. -Scott On Tue, Sep 22, 2015 at 5:34 PM, <pkotwicz@chromium.org> wrote: > My goal is to make the code in FaviconHandler more understandable. The end > goal > is not to fix any bugs but for the code to be simpler and clearer. I am not > planning any major changes but rather to make lots of small changes which > help > readability. (My thinking is that if the code is simpler, it will be easier > for > others to fix bugs) > I am planning on: > - Making FaviconHandler not call FaviconDriver::GetActiveFaviconValidity() > and > not call FaviconDriver::GetActiveFaviconURL(). FaviconHandler should not > know > about the NavigationEntry. This looks easy to do. > - Make FaviconHandler::OnFaviconDataForInitialURLFromFaviconService() and > FaviconHandler::ProcessCurrentUrl() share code > - Add an early exit so that if FaviconHandler::OnUpdateFaviconURL() is > called > twice with the same URLs that the second call is a no-op > - Figure out why FaviconDriverImpl::OnFaviconAvailable() has the early exit > if > the passed in gfx::Image is empty and write a comment as to why the early > exit > is there > - Look into whether the notification dispatching code in > FaviconHandler::OnUpdateFaviconURL() can be simplified. (Why do we have two > methods: FaviconDriverObserver::OnFaviconAvailable() and > FaviconDriverObserver::OnFaviconUpdated() ?) > > https://codereview.chromium.org/1272413002/ To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Making FaviconHandler take a single URL in the constructor is reasonable. I think that this CL moves us towards that goal. After this CL: - We need to make FaviconHandler not call FaviconDriver::GetActiveFaviconValidity() and FaviconDriver::GetActiveFaviconURL() - Do some minor refactoring such that FaviconHandler takes the page URL in the constructor
LGTM
The CQ bit was checked by pkotwicz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from sdefresne@chromium.org Link to the patchset: https://codereview.chromium.org/1272413002/#ps390001 (title: " ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1272413002/390001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1272413002/390001
Message was sent while issue was closed.
Committed patchset #10 (id:390001)
Message was sent while issue was closed.
Patchset 10 (id:??) landed as https://crrev.com/38c2b85c4d3f1426e6abab4990779d10edb0e550 Cr-Commit-Position: refs/heads/master@{#351113} |