New issue
Advanced search Search tips

Issue 661733 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Impl of SuggestionsSource::MessageLoopForRequestPath() is contradictory

Project Member Reported by gab@chromium.org, Nov 2 2016

Issue description

The 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.
 

Comment 1 by ma...@chromium.org, Nov 2 2016

Cc: -treib@chromium.org ma...@chromium.org
Owner: treib@chromium.org
Thanks for looking into this. Marc is now the best owner for this issue.

Comment 2 by treib@chromium.org, 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!

Comment 3 by treib@chromium.org, Nov 8 2016

Status: Started (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Comment 5 by treib@chromium.org, Nov 8 2016

Status: Fixed (was: Started)

Sign in to add a comment