diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-11 11:32:04 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-18 13:40:17 +0000 |
commit | 31ccca0778db85c159634478b4ec7997f6704860 (patch) | |
tree | 3d33fc3afd9d5ec95541e1bbe074a9cf8da12a0e /chromium/components/suggestions | |
parent | 248b70b82a40964d5594eb04feca0fa36716185d (diff) | |
download | qtwebengine-chromium-31ccca0778db85c159634478b4ec7997f6704860.tar.gz |
BASELINE: Update Chromium to 80.0.3987.136
Change-Id: I98e1649aafae85ba3a83e67af00bb27ef301db7b
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'chromium/components/suggestions')
4 files changed, 8 insertions, 13 deletions
diff --git a/chromium/components/suggestions/suggestions_service.h b/chromium/components/suggestions/suggestions_service.h index 1724a31d65a..bb9940fe802 100644 --- a/chromium/components/suggestions/suggestions_service.h +++ b/chromium/components/suggestions/suggestions_service.h @@ -15,17 +15,13 @@ #include "components/suggestions/proto/suggestions.pb.h" #include "url/gurl.h" -namespace gfx { -class Image; -} // namespace gfx - namespace suggestions { // An interface to fetch server suggestions asynchronously. class SuggestionsService : public KeyedService { public: - using ResponseCallback = base::Callback<void(const SuggestionsProfile&)>; - using BitmapCallback = base::Callback<void(const GURL&, const gfx::Image&)>; + using ResponseCallback = + base::RepeatingCallback<void(const SuggestionsProfile&)>; using ResponseCallbackList = base::CallbackList<void(const SuggestionsProfile&)>; diff --git a/chromium/components/suggestions/suggestions_service_impl_unittest.cc b/chromium/components/suggestions/suggestions_service_impl_unittest.cc index 1cee13c7bf7..e40bdbde00f 100644 --- a/chromium/components/suggestions/suggestions_service_impl_unittest.cc +++ b/chromium/components/suggestions/suggestions_service_impl_unittest.cc @@ -42,7 +42,7 @@ using testing::StrictMock; namespace { -const char kEmail[] = "foo_email"; +const char kEmail[] = "foo_email@gmail.com"; const char kSuggestionsUrlPath[] = "/chromesuggestions"; const char kBlacklistUrlPath[] = "/chromesuggestions/blacklist"; const char kBlacklistClearUrlPath[] = "/chromesuggestions/blacklist/clear"; diff --git a/chromium/components/suggestions/webui/suggestions_source.cc b/chromium/components/suggestions/webui/suggestions_source.cc index dad5aa26ce1..91d8bd756bc 100644 --- a/chromium/components/suggestions/webui/suggestions_source.cc +++ b/chromium/components/suggestions/webui/suggestions_source.cc @@ -100,7 +100,7 @@ SuggestionsSource::SuggestionsSource(SuggestionsService* suggestions_service, SuggestionsSource::~SuggestionsSource() {} void SuggestionsSource::StartDataRequest(const std::string& path, - const GotDataCallback& callback) { + GotDataCallback callback) { // If this was called as "chrome://suggestions/refresh", we also trigger an // async update of the suggestions. bool is_refresh = (path == kRefreshPath); @@ -108,7 +108,7 @@ void SuggestionsSource::StartDataRequest(const std::string& path, // |suggestions_service| is null for guest profiles. if (!suggestions_service_) { std::string output = RenderOutputHtmlNoSuggestions(base_url_, is_refresh); - callback.Run(base::RefCountedString::TakeString(&output)); + std::move(callback).Run(base::RefCountedString::TakeString(&output)); return; } @@ -123,7 +123,7 @@ void SuggestionsSource::StartDataRequest(const std::string& path, std::string output = !size ? RenderOutputHtmlNoSuggestions(base_url_, is_refresh) : RenderOutputHtml(base_url_, is_refresh, suggestions_profile); - callback.Run(base::RefCountedString::TakeString(&output)); + std::move(callback).Run(base::RefCountedString::TakeString(&output)); } std::string SuggestionsSource::GetMimeType(const std::string& path) const { diff --git a/chromium/components/suggestions/webui/suggestions_source.h b/chromium/components/suggestions/webui/suggestions_source.h index 60366a61e3a..6d7317f944b 100644 --- a/chromium/components/suggestions/webui/suggestions_source.h +++ b/chromium/components/suggestions/webui/suggestions_source.h @@ -25,10 +25,9 @@ class SuggestionsSource { ~SuggestionsSource(); using GotDataCallback = - base::Callback<void(scoped_refptr<base::RefCountedMemory>)>; + base::OnceCallback<void(scoped_refptr<base::RefCountedMemory>)>; - void StartDataRequest(const std::string& path, - const GotDataCallback& callback); + void StartDataRequest(const std::string& path, GotDataCallback callback); std::string GetMimeType(const std::string& path) const; private: |