Impl of SuggestionsSource::MessageLoopForRequestPath() is contradictory |
|||
Issue descriptionThe impl's comment says: // This can be accessed from the IO thread. but then it returns return content::URLDataSource::MessageLoopForRequestPath(path); whose documentation is: // Returns the MessageLoop on which the delegate wishes to have // StartDataRequest called to handle the request for |path|. The default // implementation returns BrowserThread::UI. If the delegate does not care // which thread StartDataRequest is called on, this should return nullptr. // It may be beneficial to return nullptr for requests that are safe to handle // directly on the IO thread. This can improve performance by satisfying such // requests more rapidly when there is a large amount of UI thread contention. // Or the delegate can return a specific thread's Messageloop if they wish. i.e. comment says it should run on IO thread but it returns something which asks for it to run on UI thread..? If it doesn't care then it should return nullptr per documentation.
,
Nov 7 2016
I think the "This can be accessed from the IO thread." comment is just poorly formulated. I read it to mean "This method may be called on the IO thread [but we want StartDataRequest to happen on the UI thread instead]". Of course, then it's pointless to overload the method in the first place. I'll send a CL to fix that shortly. Thanks!
,
Nov 8 2016
,
Nov 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b818840a8c8b23730a0485839ab9a7782a1b238b commit b818840a8c8b23730a0485839ab9a7782a1b238b Author: treib <treib@chromium.org> Date: Tue Nov 08 13:40:36 2016 SuggestionsSource cleanup: Remove TaskRunnerForRequestPath implementation It's identical to the base class implementation, so it's pointless and confusing to have it. BUG= 661733 Review-Url: https://codereview.chromium.org/2485633003 Cr-Commit-Position: refs/heads/master@{#430597} [modify] https://crrev.com/b818840a8c8b23730a0485839ab9a7782a1b238b/chrome/browser/search/suggestions/suggestions_ui.cc
,
Nov 8 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ma...@chromium.org
, Nov 2 2016Owner: treib@chromium.org