DescriptionOptimization: not sending answer server requests for voice queries.
This is because launcher closes after voice queries.
Also fixing a bug where a voice query was treated as a non-voice query for some short period of time. This happened because while "is voice query" flag was cleared, the query text remained non-empty. This caused, in particular, unnecessary answer server queries after the voice query is over. Stack example (with "is voice" already cleared, and query text is still non-empty):
0 app_list::SearchAnswerWebContentsDelegate::Update (this=0x48a03b686e0, is_voice_query=<optimized out>) at ../../chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc:93
1 0x000064441d08df8a in AppListViewDelegate::OnTemplateURLServiceChanged (this=0x48a046fa000) at ../../chrome/browser/ui/app_list/app_list_view_delegate.cc:534
2 0x000064441c687230 in TemplateURLService::NotifyObservers (this=<optimized out>) at ../../components/search_engines/template_url_service.cc:2124
3 0x000064441c68ec06 in Update (this=0x48a0265a340, existing_turl=0x48a0350d600, new_values=...) at ../../components/search_engines/template_url_service.cc:1713
4 TemplateURLService::UpdateTemplateURLVisitTime (this=0x48a0265a340, url=0x48a0350d600) at ../../components/search_engines/template_url_service.cc:1787
5 0x000064441c689375 in TemplateURLService::UpdateKeywordSearchTermsForURL (this=0x48a0265a340, details=...) at ../../components/search_engines/template_url_service.cc:1781
6 0x000064441af6bb4f in non-virtual thunk to ChromeTemplateURLServiceClient::OnURLVisited(history::HistoryService*, ui::PageTransition, history::URLRow const&, std::vector<GURL, std::allocator<GURL> > const&, base::Time) ()
at ../../chrome/browser/search_engines/chrome_template_url_service_client.cc:85
7 0x000064441c62bf32 in history::HistoryService::NotifyURLVisited (this=0x48a027df500, transition=805306373, row=..., redirects=std::vector of length 0, capacity 0, visit_time=...) at ../../components/history/core/browser/history_service.cc:1092
......
Some frames may be optimized away due to inlining.
Also other optimizations and cleanups; as a result, we now have exactly as many expensive requests (such as server queries) as necessary.
Bug=712331
Review-Url: https://codereview.chromium.org/2846733004
Cr-Commit-Position: refs/heads/master@{#468469}
Committed: https://chromium.googlesource.com/chromium/src/+/9815502de37719154e0e2f2bc8ad4caa7b5561fd
Patch Set 1 #
Total comments: 4
Patch Set 2 : Moved voice flag to search box model. #Patch Set 3 : Fixing test compile error #Patch Set 4 : Fixing broken tests. #
Total comments: 6
Patch Set 5 : Last nits #Messages
Total messages: 27 (18 generated)
|