Skip to content

Commit

Permalink
Check request handle existence in MatchQuery.
Browse files Browse the repository at this point in the history
Request_handles are null in DownloadItems generated from the history; 
any methods that may be called on such download items need to work with
null request handles.

BUG=102933


Review URL: http://codereview.chromium.org/8465001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108653 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rdsmith@chromium.org committed Nov 4, 2011
1 parent f4390b2 commit c2acd30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/browser/download/download_item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ bool DownloadItem::MatchesQuery(const string16& query) const {
// L"/\x4f60\x597d\x4f60\x597d",
// "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD"
std::string languages;
TabContents* tab = request_handle_->GetTabContents();
TabContents* tab = (request_handle_.get() ?
request_handle_->GetTabContents() : NULL);
if (tab)
languages = content::GetContentClient()->browser()->GetAcceptLangs(tab);
string16 url_formatted(net::FormatUrl(GetURL(), languages));
Expand Down

0 comments on commit c2acd30

Please sign in to comment.