Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: ui/app_list/search_provider.h

Issue 2701123002: AppList Performance Optimization 2 (Closed)
Patch Set: Cache the tokenized name Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/search_controller.cc ('k') | ui/app_list/search_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search_provider.h
diff --git a/ui/app_list/search_provider.h b/ui/app_list/search_provider.h
index 22f0f2c1e53207693284af461812e70485766c9c..406b4cf545239c637cf710aa422a9f9fbe8111fd 100644
--- a/ui/app_list/search_provider.h
+++ b/ui/app_list/search_provider.h
@@ -6,10 +6,10 @@
#define UI_APP_LIST_SEARCH_PROVIDER_H_
#include <memory>
+#include <vector>
#include "base/callback.h"
#include "base/macros.h"
-#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
#include "ui/app_list/app_list_export.h"
@@ -19,8 +19,8 @@ class SearchResult;
class APP_LIST_EXPORT SearchProvider {
public:
- typedef ScopedVector<SearchResult> Results;
- typedef base::Closure ResultChangedCallback;
+ using Results = std::vector<std::unique_ptr<SearchResult>>;
+ using ResultChangedCallback = base::Closure;
SearchProvider();
virtual ~SearchProvider();
@@ -40,6 +40,12 @@ class APP_LIST_EXPORT SearchProvider {
protected:
// Interface for the derived class to generate search results.
void Add(std::unique_ptr<SearchResult> result);
+
+ // Swaps the internal results with |new_results|.
+ // This is useful when multiple results will be added, and the notification is
+ // desired to be done only once when all results are added.
+ void SwapResults(Results* new_results);
+
void ClearResults();
private:
« no previous file with comments | « ui/app_list/search_controller.cc ('k') | ui/app_list/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698