Commit b5830c31 authored by Renjie Tang's avatar Renjie Tang Committed by Commit Bot

In ios/chrome, migrate CallBack and Closure to Once/Repeating.

Bug:1007792

Change-Id: I5d8f3167fcb4db996258f4e2ce91b29f45eb6737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518117
Commit-Queue: Renjie Tang <renjietang@chromium.org>
Auto-Submit: Renjie Tang <renjietang@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824506}
parent a284c2cf
...@@ -103,7 +103,7 @@ class ChromeBrowserState : public web::BrowserState { ...@@ -103,7 +103,7 @@ class ChromeBrowserState : public web::BrowserState {
// Be aware that theoretically it is possible that |completion| will be // Be aware that theoretically it is possible that |completion| will be
// invoked after the Profile instance has been destroyed. // invoked after the Profile instance has been destroyed.
virtual void ClearNetworkingHistorySince(base::Time time, virtual void ClearNetworkingHistorySince(base::Time time,
const base::Closure& completion) = 0; base::OnceClosure completion) = 0;
// Returns an identifier of the browser state for debugging. // Returns an identifier of the browser state for debugging.
std::string GetDebugName(); std::string GetDebugName();
......
...@@ -219,8 +219,8 @@ net::URLRequestContextGetter* ChromeBrowserStateImpl::CreateRequestContext( ...@@ -219,8 +219,8 @@ net::URLRequestContextGetter* ChromeBrowserStateImpl::CreateRequestContext(
void ChromeBrowserStateImpl::ClearNetworkingHistorySince( void ChromeBrowserStateImpl::ClearNetworkingHistorySince(
base::Time time, base::Time time,
const base::Closure& completion) { base::OnceClosure completion) {
io_data_->ClearNetworkingHistorySince(time, completion); io_data_->ClearNetworkingHistorySince(time, std::move(completion));
} }
PrefProxyConfigTracker* ChromeBrowserStateImpl::GetProxyConfigTracker() { PrefProxyConfigTracker* ChromeBrowserStateImpl::GetProxyConfigTracker() {
......
...@@ -42,7 +42,7 @@ class ChromeBrowserStateImpl : public ChromeBrowserState { ...@@ -42,7 +42,7 @@ class ChromeBrowserStateImpl : public ChromeBrowserState {
PrefService* GetOffTheRecordPrefs() override; PrefService* GetOffTheRecordPrefs() override;
ChromeBrowserStateIOData* GetIOData() override; ChromeBrowserStateIOData* GetIOData() override;
void ClearNetworkingHistorySince(base::Time time, void ClearNetworkingHistorySince(base::Time time,
const base::Closure& completion) override; base::OnceClosure completion) override;
net::URLRequestContextGetter* CreateRequestContext( net::URLRequestContextGetter* CreateRequestContext(
ProtocolHandlerMap* protocol_handlers) override; ProtocolHandlerMap* protocol_handlers) override;
......
...@@ -53,7 +53,7 @@ class ChromeBrowserStateImplIOData : public ChromeBrowserStateIOData { ...@@ -53,7 +53,7 @@ class ChromeBrowserStateImplIOData : public ChromeBrowserStateIOData {
// Works asynchronously, however if the |completion| callback is non-null, // Works asynchronously, however if the |completion| callback is non-null,
// it will be posted on the UI thread once the removal process completes. // it will be posted on the UI thread once the removal process completes.
void ClearNetworkingHistorySince(base::Time time, void ClearNetworkingHistorySince(base::Time time,
const base::Closure& completion); base::OnceClosure completion);
private: private:
typedef std::map<base::FilePath, typedef std::map<base::FilePath,
...@@ -113,7 +113,7 @@ class ChromeBrowserStateImplIOData : public ChromeBrowserStateIOData { ...@@ -113,7 +113,7 @@ class ChromeBrowserStateImplIOData : public ChromeBrowserStateIOData {
// Works asynchronously, however if the |completion| callback is non-null, // Works asynchronously, however if the |completion| callback is non-null,
// it will be posted on the UI thread once the removal process completes. // it will be posted on the UI thread once the removal process completes.
void ClearNetworkingHistorySinceOnIOThread(base::Time time, void ClearNetworkingHistorySinceOnIOThread(base::Time time,
const base::Closure& completion); base::OnceClosure completion);
mutable std::unique_ptr<IOSChromeNetworkDelegate> network_delegate_; mutable std::unique_ptr<IOSChromeNetworkDelegate> network_delegate_;
......
...@@ -104,7 +104,7 @@ ChromeBrowserStateIOData* ChromeBrowserStateImplIOData::Handle::io_data() ...@@ -104,7 +104,7 @@ ChromeBrowserStateIOData* ChromeBrowserStateImplIOData::Handle::io_data()
void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince( void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince(
base::Time time, base::Time time,
const base::Closure& completion) { base::OnceClosure completion) {
DCHECK_CURRENTLY_ON(web::WebThread::UI); DCHECK_CURRENTLY_ON(web::WebThread::UI);
LazyInitialize(); LazyInitialize();
...@@ -112,7 +112,7 @@ void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince( ...@@ -112,7 +112,7 @@ void ChromeBrowserStateImplIOData::Handle::ClearNetworkingHistorySince(
FROM_HERE, {web::WebThread::IO}, FROM_HERE, {web::WebThread::IO},
base::BindOnce( base::BindOnce(
&ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread, &ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread,
base::Unretained(io_data_), time, completion)); base::Unretained(io_data_), time, std::move(completion)));
} }
void ChromeBrowserStateImplIOData::Handle::LazyInitialize() const { void ChromeBrowserStateImplIOData::Handle::LazyInitialize() const {
...@@ -234,15 +234,15 @@ void ChromeBrowserStateImplIOData::InitializeInternal( ...@@ -234,15 +234,15 @@ void ChromeBrowserStateImplIOData::InitializeInternal(
void ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread( void ChromeBrowserStateImplIOData::ClearNetworkingHistorySinceOnIOThread(
base::Time time, base::Time time,
const base::Closure& completion) { base::OnceClosure completion) {
DCHECK_CURRENTLY_ON(web::WebThread::IO); DCHECK_CURRENTLY_ON(web::WebThread::IO);
DCHECK(initialized()); DCHECK(initialized());
DCHECK(transport_security_state()); DCHECK(transport_security_state());
auto barrier = base::BarrierClosure( auto barrier = base::BarrierClosure(
2, base::BindOnce( 2, base::BindOnce(
[](base::Closure completion) { [](base::OnceClosure callback) {
base::PostTask(FROM_HERE, base::TaskTraits(web::WebThread::UI), base::PostTask(FROM_HERE, base::TaskTraits(web::WebThread::UI),
std::move(completion)); std::move(callback));
}, },
std::move(completion))); std::move(completion)));
......
...@@ -116,12 +116,12 @@ OffTheRecordChromeBrowserStateImpl::CreateRequestContext( ...@@ -116,12 +116,12 @@ OffTheRecordChromeBrowserStateImpl::CreateRequestContext(
void OffTheRecordChromeBrowserStateImpl::ClearNetworkingHistorySince( void OffTheRecordChromeBrowserStateImpl::ClearNetworkingHistorySince(
base::Time time, base::Time time,
const base::Closure& completion) { base::OnceClosure completion) {
// Nothing to do here, our transport security state is read-only. // Nothing to do here, our transport security state is read-only.
// Still, fire the callback to indicate we have finished, otherwise the // Still, fire the callback to indicate we have finished, otherwise the
// BrowsingDataRemover will never be destroyed and the dialog will never be // BrowsingDataRemover will never be destroyed and the dialog will never be
// closed. We must do this asynchronously in order to avoid reentrancy issues. // closed. We must do this asynchronously in order to avoid reentrancy issues.
if (!completion.is_null()) { if (!completion.is_null()) {
base::PostTask(FROM_HERE, {web::WebThread::UI}, completion); base::PostTask(FROM_HERE, {web::WebThread::UI}, std::move(completion));
} }
} }
...@@ -31,7 +31,7 @@ class OffTheRecordChromeBrowserStateImpl : public ChromeBrowserState { ...@@ -31,7 +31,7 @@ class OffTheRecordChromeBrowserStateImpl : public ChromeBrowserState {
PrefService* GetOffTheRecordPrefs() override; PrefService* GetOffTheRecordPrefs() override;
ChromeBrowserStateIOData* GetIOData() override; ChromeBrowserStateIOData* GetIOData() override;
void ClearNetworkingHistorySince(base::Time time, void ClearNetworkingHistorySince(base::Time time,
const base::Closure& completion) override; base::OnceClosure completion) override;
net::URLRequestContextGetter* CreateRequestContext( net::URLRequestContextGetter* CreateRequestContext(
ProtocolHandlerMap* protocol_handlers) override; ProtocolHandlerMap* protocol_handlers) override;
......
...@@ -53,7 +53,7 @@ class TestChromeBrowserState : public ChromeBrowserState { ...@@ -53,7 +53,7 @@ class TestChromeBrowserState : public ChromeBrowserState {
PrefService* GetOffTheRecordPrefs() override; PrefService* GetOffTheRecordPrefs() override;
ChromeBrowserStateIOData* GetIOData() override; ChromeBrowserStateIOData* GetIOData() override;
void ClearNetworkingHistorySince(base::Time time, void ClearNetworkingHistorySince(base::Time time,
const base::Closure& completion) override; base::OnceClosure completion) override;
net::URLRequestContextGetter* CreateRequestContext( net::URLRequestContextGetter* CreateRequestContext(
ProtocolHandlerMap* protocol_handlers) override; ProtocolHandlerMap* protocol_handlers) override;
......
...@@ -255,9 +255,9 @@ ChromeBrowserStateIOData* TestChromeBrowserState::GetIOData() { ...@@ -255,9 +255,9 @@ ChromeBrowserStateIOData* TestChromeBrowserState::GetIOData() {
void TestChromeBrowserState::ClearNetworkingHistorySince( void TestChromeBrowserState::ClearNetworkingHistorySince(
base::Time time, base::Time time,
const base::Closure& completion) { base::OnceClosure completion) {
if (!completion.is_null()) if (!completion.is_null())
completion.Run(); std::move(completion).Run();
} }
net::URLRequestContextGetter* TestChromeBrowserState::CreateRequestContext( net::URLRequestContextGetter* TestChromeBrowserState::CreateRequestContext(
......
...@@ -23,8 +23,10 @@ DistillerViewer::DistillerViewer( ...@@ -23,8 +23,10 @@ DistillerViewer::DistillerViewer(
dom_distiller::DomDistillerService* distillerService, dom_distiller::DomDistillerService* distillerService,
PrefService* prefs, PrefService* prefs,
const GURL& url, const GURL& url,
const DistillationFinishedCallback& callback) DistillationFinishedCallback callback)
: DistillerViewerInterface(prefs), url_(url), callback_(callback) { : DistillerViewerInterface(prefs),
url_(url),
callback_(std::move(callback)) {
DCHECK(distillerService); DCHECK(distillerService);
DCHECK(url.is_valid()); DCHECK(url.is_valid());
std::unique_ptr<dom_distiller::DistillerPage> page = std::unique_ptr<dom_distiller::DistillerPage> page =
...@@ -40,8 +42,10 @@ DistillerViewer::DistillerViewer( ...@@ -40,8 +42,10 @@ DistillerViewer::DistillerViewer(
std::unique_ptr<dom_distiller::DistillerPage> page, std::unique_ptr<dom_distiller::DistillerPage> page,
PrefService* prefs, PrefService* prefs,
const GURL& url, const GURL& url,
const DistillationFinishedCallback& callback) DistillationFinishedCallback callback)
: DistillerViewerInterface(prefs), url_(url), callback_(callback) { : DistillerViewerInterface(prefs),
url_(url),
callback_(std::move(callback)) {
DCHECK(url.is_valid()); DCHECK(url.is_valid());
SendCommonJavaScript(); SendCommonJavaScript();
distiller_ = distiller_factory->CreateDistillerForUrl(url); distiller_ = distiller_factory->CreateDistillerForUrl(url);
...@@ -65,6 +69,7 @@ void DistillerViewer::OnDistillerFinished( ...@@ -65,6 +69,7 @@ void DistillerViewer::OnDistillerFinished(
void DistillerViewer::OnArticleReady( void DistillerViewer::OnArticleReady(
const dom_distiller::DistilledArticleProto* article_proto) { const dom_distiller::DistilledArticleProto* article_proto) {
DCHECK(!callback_.is_null());
DomDistillerRequestViewBase::OnArticleReady(article_proto); DomDistillerRequestViewBase::OnArticleReady(article_proto);
bool is_empty = article_proto->pages_size() == 0 || bool is_empty = article_proto->pages_size() == 0 ||
article_proto->pages(0).html().empty(); article_proto->pages(0).html().empty();
...@@ -83,9 +88,10 @@ void DistillerViewer::OnArticleReady( ...@@ -83,9 +88,10 @@ void DistillerViewer::OnArticleReady(
std::string html_and_script(html); std::string html_and_script(html);
html_and_script += html_and_script +=
"<script> distillerOnIos = true; " + js_buffer_ + "</script>"; "<script> distillerOnIos = true; " + js_buffer_ + "</script>";
callback_.Run(url_, html_and_script, images, article_proto->title()); std::move(callback_).Run(url_, html_and_script, images,
article_proto->title());
} else { } else {
callback_.Run(url_, std::string(), {}, std::string()); std::move(callback_).Run(url_, std::string(), {}, std::string());
} }
} }
......
...@@ -30,11 +30,11 @@ class DistillerViewerInterface : public DomDistillerRequestViewBase { ...@@ -30,11 +30,11 @@ class DistillerViewerInterface : public DomDistillerRequestViewBase {
// The image data as a string. // The image data as a string.
std::string data; std::string data;
}; };
typedef base::Callback<void(const GURL& url, using DistillationFinishedCallback =
base::OnceCallback<void(const GURL& url,
const std::string& html, const std::string& html,
const std::vector<ImageInfo>& images, const std::vector<ImageInfo>& images,
const std::string& title)> const std::string& title)>;
DistillationFinishedCallback;
DistillerViewerInterface(PrefService* prefs) DistillerViewerInterface(PrefService* prefs)
: DomDistillerRequestViewBase(new DistilledPagePrefs(prefs)) {} : DomDistillerRequestViewBase(new DistilledPagePrefs(prefs)) {}
...@@ -57,7 +57,7 @@ class DistillerViewer : public DistillerViewerInterface { ...@@ -57,7 +57,7 @@ class DistillerViewer : public DistillerViewerInterface {
DistillerViewer(dom_distiller::DomDistillerService* distillerService, DistillerViewer(dom_distiller::DomDistillerService* distillerService,
PrefService* prefs, PrefService* prefs,
const GURL& url, const GURL& url,
const DistillationFinishedCallback& callback); DistillationFinishedCallback callback);
// Creates a |DistillerView| without depending on the DomDistillerService. // Creates a |DistillerView| without depending on the DomDistillerService.
// Caller must provide |distiller_factory| and |page| which cannot be null. // Caller must provide |distiller_factory| and |page| which cannot be null.
...@@ -67,7 +67,7 @@ class DistillerViewer : public DistillerViewerInterface { ...@@ -67,7 +67,7 @@ class DistillerViewer : public DistillerViewerInterface {
std::unique_ptr<dom_distiller::DistillerPage> page, std::unique_ptr<dom_distiller::DistillerPage> page,
PrefService* prefs, PrefService* prefs,
const GURL& url, const GURL& url,
const DistillationFinishedCallback& callback); DistillationFinishedCallback callback);
~DistillerViewer() override; ~DistillerViewer() override;
// DistillerViewerInterface implementation // DistillerViewerInterface implementation
...@@ -91,7 +91,7 @@ class DistillerViewer : public DistillerViewerInterface { ...@@ -91,7 +91,7 @@ class DistillerViewer : public DistillerViewerInterface {
// JavaScript buffer. // JavaScript buffer.
std::string js_buffer_; std::string js_buffer_;
// Callback to run once distillation is complete. // Callback to run once distillation is complete.
const DistillationFinishedCallback callback_; DistillationFinishedCallback callback_;
// Keep reference of the distiller_ during distillation. // Keep reference of the distiller_ during distillation.
std::unique_ptr<Distiller> distiller_; std::unique_ptr<Distiller> distiller_;
......
...@@ -17,7 +17,7 @@ TEST(InProcessJsonParserTest, TestSuccess) { ...@@ -17,7 +17,7 @@ TEST(InProcessJsonParserTest, TestSuccess) {
InProcessJsonParser::Parse( InProcessJsonParser::Parse(
R"json({"key": 1})json", R"json({"key": 1})json",
base::BindOnce( base::BindOnce(
[](base::Closure quit_closure, base::Value value) { [](base::OnceClosure quit_closure, base::Value value) {
ASSERT_TRUE(value.is_dict()); ASSERT_TRUE(value.is_dict());
ASSERT_TRUE(value.FindIntKey("key")); ASSERT_TRUE(value.FindIntKey("key"));
EXPECT_EQ(1, *value.FindIntKey("key")); EXPECT_EQ(1, *value.FindIntKey("key"));
...@@ -25,7 +25,7 @@ TEST(InProcessJsonParserTest, TestSuccess) { ...@@ -25,7 +25,7 @@ TEST(InProcessJsonParserTest, TestSuccess) {
}, },
run_loop.QuitClosure()), run_loop.QuitClosure()),
base::BindOnce( base::BindOnce(
[](base::Closure quit_closure, const std::string& error) { [](base::OnceClosure quit_closure, const std::string& error) {
EXPECT_FALSE(true) << "unexpected json parse error: " << error; EXPECT_FALSE(true) << "unexpected json parse error: " << error;
std::move(quit_closure).Run(); std::move(quit_closure).Run();
}, },
...@@ -40,13 +40,13 @@ TEST(InProcessJsonParserTest, TestFailure) { ...@@ -40,13 +40,13 @@ TEST(InProcessJsonParserTest, TestFailure) {
InProcessJsonParser::Parse( InProcessJsonParser::Parse(
R"json(invalid)json", R"json(invalid)json",
base::BindOnce( base::BindOnce(
[](base::Closure quit_closure, base::Value value) { [](base::OnceClosure quit_closure, base::Value value) {
EXPECT_FALSE(true) << "unexpected json parse success: " << value; EXPECT_FALSE(true) << "unexpected json parse success: " << value;
std::move(quit_closure).Run(); std::move(quit_closure).Run();
}, },
run_loop.QuitClosure()), run_loop.QuitClosure()),
base::BindOnce( base::BindOnce(
[](base::Closure quit_closure, const std::string& error) { [](base::OnceClosure quit_closure, const std::string& error) {
EXPECT_TRUE(!error.empty()); EXPECT_TRUE(!error.empty());
std::move(quit_closure).Run(); std::move(quit_closure).Run();
}, },
......
...@@ -154,9 +154,6 @@ class IOSChromeMetricsServiceClient : public IncognitoWebStateObserver, ...@@ -154,9 +154,6 @@ class IOSChromeMetricsServiceClient : public IncognitoWebStateObserver,
// Saved callback received from CollectFinalMetricsForLog(). // Saved callback received from CollectFinalMetricsForLog().
base::OnceClosure collect_final_metrics_done_callback_; base::OnceClosure collect_final_metrics_done_callback_;
// Callback that is called when initial metrics gathering is complete.
base::Closure finished_init_task_callback_;
// Subscription for receiving callbacks that a tab was parented. // Subscription for receiving callbacks that a tab was parented.
std::unique_ptr<base::CallbackList<void(web::WebState*)>::Subscription> std::unique_ptr<base::CallbackList<void(web::WebState*)>::Subscription>
tab_parented_subscription_; tab_parented_subscription_;
......
...@@ -74,7 +74,7 @@ IOSChromePasswordManagerClient::IOSChromePasswordManagerClient( ...@@ -74,7 +74,7 @@ IOSChromePasswordManagerClient::IOSChromePasswordManagerClient(
log_manager_ = autofill::LogManager::Create( log_manager_ = autofill::LogManager::Create(
ios::PasswordManagerLogRouterFactory::GetForBrowserState( ios::PasswordManagerLogRouterFactory::GetForBrowserState(
bridge_.browserState), bridge_.browserState),
base::Closure()); base::RepeatingClosure());
} }
IOSChromePasswordManagerClient::~IOSChromePasswordManagerClient() = default; IOSChromePasswordManagerClient::~IOSChromePasswordManagerClient() = default;
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
.get(); .get();
// Remove credentials stored during executing the test. // Remove credentials stored during executing the test.
passwordStore->RemoveLoginsCreatedBetween(base::Time(), base::Time::Now(), passwordStore->RemoveLoginsCreatedBetween(base::Time(), base::Time::Now(),
base::Closure()); base::OnceClosure());
} }
+ (void)getCredentialsInTabAtIndex:(int)index { + (void)getCredentialsInTabAtIndex:(int)index {
......
...@@ -43,8 +43,6 @@ class ReadingListDistillerPageDelegate { ...@@ -43,8 +43,6 @@ class ReadingListDistillerPageDelegate {
// and add a 2 seconds delay between loading and distillation. // and add a 2 seconds delay between loading and distillation.
class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS {
public: public:
typedef base::Callback<void(const GURL&, const GURL&)> RedirectionCallback;
// Creates a ReadingListDistillerPage to distill |url|. WebStates to download // Creates a ReadingListDistillerPage to distill |url|. WebStates to download
// the pages will be provided by web_state_dispatcher. // the pages will be provided by web_state_dispatcher.
// |browser_state|, |web_state_dispatcher| and |delegate| must not be null. // |browser_state|, |web_state_dispatcher| and |delegate| must not be null.
......
...@@ -32,7 +32,7 @@ namespace { ...@@ -32,7 +32,7 @@ namespace {
class DistillerViewerTest : public dom_distiller::DistillerViewerInterface { class DistillerViewerTest : public dom_distiller::DistillerViewerInterface {
public: public:
DistillerViewerTest(const GURL& url, DistillerViewerTest(const GURL& url,
const DistillationFinishedCallback& callback, DistillationFinishedCallback callback,
reading_list::ReadingListDistillerPageDelegate* delegate, reading_list::ReadingListDistillerPageDelegate* delegate,
const std::string& html, const std::string& html,
const GURL& redirect_url, const GURL& redirect_url,
...@@ -50,7 +50,7 @@ class DistillerViewerTest : public dom_distiller::DistillerViewerInterface { ...@@ -50,7 +50,7 @@ class DistillerViewerTest : public dom_distiller::DistillerViewerInterface {
if (!mime_type.empty()) { if (!mime_type.empty()) {
delegate->DistilledPageHasMimeType(url, mime_type); delegate->DistilledPageHasMimeType(url, mime_type);
} }
callback.Run(url, html, images, "title"); std::move(callback).Run(url, html, images, "title");
} }
void OnArticleReady( void OnArticleReady(
......
...@@ -33,7 +33,7 @@ base::RepeatingClosure GetDefaultSearchProviderChangedCallback() { ...@@ -33,7 +33,7 @@ base::RepeatingClosure GetDefaultSearchProviderChangedCallback() {
base::IgnoreResult(&rlz::RLZTracker::RecordProductEvent), rlz_lib::CHROME, base::IgnoreResult(&rlz::RLZTracker::RecordProductEvent), rlz_lib::CHROME,
rlz::RLZTracker::ChromeOmnibox(), rlz_lib::SET_TO_GOOGLE); rlz::RLZTracker::ChromeOmnibox(), rlz_lib::SET_TO_GOOGLE);
#else #else
return base::Closure(); return base::RepeatingClosure();
#endif #endif
} }
......
...@@ -20,7 +20,7 @@ class WebState; ...@@ -20,7 +20,7 @@ class WebState;
// the TAB_PARENTED notification from all sources. // the TAB_PARENTED notification from all sources.
class TabParentingGlobalObserver { class TabParentingGlobalObserver {
public: public:
typedef base::Callback<void(web::WebState*)> OnTabParentedCallback; using OnTabParentedCallback = base::RepeatingCallback<void(web::WebState*)>;
// Returns the instance of TabParentingGlobalObserver. // Returns the instance of TabParentingGlobalObserver.
static TabParentingGlobalObserver* GetInstance(); static TabParentingGlobalObserver* GetInstance();
......
...@@ -139,7 +139,7 @@ void SaveLocalPasswordForm(const GURL& url) { ...@@ -139,7 +139,7 @@ void SaveLocalPasswordForm(const GURL& url) {
// Removes all credentials stored. // Removes all credentials stored.
void ClearPasswordStore() { void ClearPasswordStore() {
GetPasswordStore()->RemoveLoginsCreatedBetween(base::Time(), base::Time(), GetPasswordStore()->RemoveLoginsCreatedBetween(base::Time(), base::Time(),
base::Closure()); base::OnceClosure());
TestStoreConsumer consumer; TestStoreConsumer consumer;
} }
......
...@@ -122,7 +122,7 @@ ChromeAutofillClientIOS::ChromeAutofillClientIOS( ...@@ -122,7 +122,7 @@ ChromeAutofillClientIOS::ChromeAutofillClientIOS(
// renderer. // renderer.
log_manager_(LogManager::Create( log_manager_(LogManager::Create(
AutofillLogRouterFactory::GetForBrowserState(browser_state), AutofillLogRouterFactory::GetForBrowserState(browser_state),
base::Closure())) {} base::RepeatingClosure())) {}
ChromeAutofillClientIOS::~ChromeAutofillClientIOS() { ChromeAutofillClientIOS::~ChromeAutofillClientIOS() {
HideAutofillPopup(PopupHidingReason::kTabGone); HideAutofillPopup(PopupHidingReason::kTabGone);
......
...@@ -45,11 +45,9 @@ class ChromeOmniboxClientIOS : public OmniboxClient { ...@@ -45,11 +45,9 @@ class ChromeOmniboxClientIOS : public OmniboxClient {
OmniboxNavigationObserver* observer) override; OmniboxNavigationObserver* observer) override;
void OnFocusChanged(OmniboxFocusState state, void OnFocusChanged(OmniboxFocusState state,
OmniboxFocusChangeReason reason) override; OmniboxFocusChangeReason reason) override;
void OnResultChanged( void OnResultChanged(const AutocompleteResult& result,
const AutocompleteResult& result, bool default_match_changed,
bool default_match_changed, const BitmapFetchedCallback& on_bitmap_fetched) override;
const base::Callback<void(int result_index, const SkBitmap& bitmap)>&
on_bitmap_fetched) override;
void DiscardNonCommittedNavigations() override; void DiscardNonCommittedNavigations() override;
const base::string16& GetTitle() const override; const base::string16& GetTitle() const override;
gfx::Image GetFavicon() const override; gfx::Image GetFavicon() const override;
......
...@@ -133,8 +133,7 @@ void ChromeOmniboxClientIOS::OnFocusChanged(OmniboxFocusState state, ...@@ -133,8 +133,7 @@ void ChromeOmniboxClientIOS::OnFocusChanged(OmniboxFocusState state,
void ChromeOmniboxClientIOS::OnResultChanged( void ChromeOmniboxClientIOS::OnResultChanged(
const AutocompleteResult& result, const AutocompleteResult& result,
bool default_match_changed, bool default_match_changed,
const base::Callback<void(int result_index, const SkBitmap& bitmap)>& const BitmapFetchedCallback& on_bitmap_fetched) {
on_bitmap_fetched) {
if (result.empty()) { if (result.empty()) {
return; return;
} }
......
...@@ -130,7 +130,7 @@ PasswordForm CreateSampleFormWithIndex(int index) { ...@@ -130,7 +130,7 @@ PasswordForm CreateSampleFormWithIndex(int index) {
bool ClearPasswordStore() { bool ClearPasswordStore() {
GetPasswordStore()->RemoveLoginsCreatedBetween(base::Time(), base::Time(), GetPasswordStore()->RemoveLoginsCreatedBetween(base::Time(), base::Time(),
base::Closure()); base::OnceClosure());
FakeStoreConsumer consumer; FakeStoreConsumer consumer;
if (!consumer.FetchStoreResults()) { if (!consumer.FetchStoreResults()) {
return false; return false;
......
...@@ -61,9 +61,9 @@ std::unique_ptr<net::test_server::HttpResponse> HandleQueryTitle( ...@@ -61,9 +61,9 @@ std::unique_ptr<net::test_server::HttpResponse> HandleQueryTitle(
// Sets up the EmbeddedTestServer as needed for tests. // Sets up the EmbeddedTestServer as needed for tests.
- (void)setUpTestServer { - (void)setUpTestServer {
self.testServer->RegisterDefaultHandler( self.testServer->RegisterDefaultHandler(base::BindRepeating(
base::Bind(net::test_server::HandlePrefixedRequest, "/querytitle", net::test_server::HandlePrefixedRequest, "/querytitle",
base::Bind(&HandleQueryTitle))); base::BindRepeating(&HandleQueryTitle)));
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start"); GREYAssertTrue(self.testServer->Start(), @"Test server failed to start");
} }
......
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