Use proper versions of base::Bind/Callback/Closure in spellchecker code
This is also a preparation patch for mojofying spellchecker IPC
(crrev.com/c/846370), to stop getting upload warnings.
Bug: 714018
Change-Id: I48e3e563f33691a0e6698d5cc32043a6728ea3ff
Reviewed-on: https://chromium-review.googlesource.com/847294
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Rachel Blum <[email protected]>
Commit-Queue: Xiaocheng Hu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#528394}
diff --git a/components/spellcheck/browser/spelling_service_client.h b/components/spellcheck/browser/spelling_service_client.h
index 29971d7..c3d4c08 100644
--- a/components/spellcheck/browser/spelling_service_client.h
+++ b/components/spellcheck/browser/spelling_service_client.h
@@ -50,8 +50,8 @@
// void MyTextCheck(BrowserContext* context, const base::string16& text) {
// client_.reset(new SpellingServiceClient);
// client_->RequestTextCheck(context, 0, text,
-// base::Bind(&MyClient::OnTextCheckComplete,
-// base::Unretained(this));
+// base::BindOnce(&MyClient::OnTextCheckComplete,
+// base::Unretained(this));
// }
// private:
// std::unique_ptr<SpellingServiceClient> client_;
@@ -69,11 +69,11 @@
SUGGEST = 1,
SPELLCHECK = 2,
};
- typedef base::Callback<void(
+ typedef base::OnceCallback<void(
bool /* success */,
const base::string16& /* text */,
const std::vector<SpellCheckResult>& /* results */)>
- TextCheckCompleteCallback;
+ TextCheckCompleteCallback;
SpellingServiceClient();
~SpellingServiceClient() override;
@@ -85,7 +85,7 @@
bool RequestTextCheck(content::BrowserContext* context,
ServiceType type,
const base::string16& text,
- const TextCheckCompleteCallback& callback);
+ TextCheckCompleteCallback callback);
// Returns whether the specified service is available for the given context.
static bool IsAvailable(content::BrowserContext* context, ServiceType type);
@@ -98,7 +98,7 @@
private:
struct TextCheckCallbackData {
TextCheckCallbackData(std::unique_ptr<net::URLFetcher> fetcher,
- TextCheckCompleteCallback callback,
+ TextCheckCompleteCallback&& callback,
base::string16 text);
~TextCheckCallbackData();