Commit dc4c4386 authored by Thanh Nguyen's avatar Thanh Nguyen Committed by Commit Bot

[cros-search-service] Add ClearIndex to mojom interface

This CL adds ClearIndex function to the mojom interface IndexProxy.

Bug: 1132170
Change-Id: Iaa1a3c2846bcc8c94bd758fa784e736b953e3a63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437835Reviewed-by: default avatarJia Meng <jiameng@chromium.org>
Reviewed-by: default avatarSam McNally <sammc@chromium.org>
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812514}
parent 48e85688
...@@ -50,5 +50,10 @@ void IndexProxy::Find(const base::string16& query, ...@@ -50,5 +50,10 @@ void IndexProxy::Find(const base::string16& query,
} }
} }
void IndexProxy::ClearIndex(ClearIndexCallback callback) {
index_->ClearIndex();
std::move(callback).Run();
}
} // namespace local_search_service } // namespace local_search_service
} // namespace chromeos } // namespace chromeos
...@@ -33,6 +33,7 @@ class IndexProxy : public mojom::IndexProxy { ...@@ -33,6 +33,7 @@ class IndexProxy : public mojom::IndexProxy {
void Find(const base::string16& query, void Find(const base::string16& query,
uint32_t max_results, uint32_t max_results,
FindCallback callback) override; FindCallback callback) override;
void ClearIndex(ClearIndexCallback callback) override;
private: private:
Index* const index_; Index* const index_;
......
...@@ -53,4 +53,7 @@ interface IndexProxy { ...@@ -53,4 +53,7 @@ interface IndexProxy {
// code via a callback. |results| will be null if there is an error. // code via a callback. |results| will be null if there is an error.
Find(mojo_base.mojom.String16 query, uint32 max_results) Find(mojo_base.mojom.String16 query, uint32 max_results)
=> (ResponseStatus status, array<Result>? results); => (ResponseStatus status, array<Result>? results);
// Clears all data stored by the index.
ClearIndex() => ();
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment