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

Unified Diff: ios/web/webui/mojo_facade.mm

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: rebase Created 3 years, 9 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
Index: ios/web/webui/mojo_facade.mm
diff --git a/ios/web/webui/mojo_facade.mm b/ios/web/webui/mojo_facade.mm
index 651de5ae8694f6656b6ca50cdb6bf2c280aec7cc..0761888ff8d1ce9feb9ef3112cb85bac74fd04a8 100644
--- a/ios/web/webui/mojo_facade.mm
+++ b/ios/web/webui/mojo_facade.mm
@@ -252,16 +252,17 @@ std::unique_ptr<base::Value> MojoFacade::HandleSupportWatch(
int callback_id;
CHECK(args->GetInteger("callbackId", &callback_id));
- mojo::Watcher::ReadyCallback callback = base::BindBlockArc(^(
+ mojo::SimpleWatcher::ReadyCallback callback = base::BindBlockArc(^(
MojoResult result) {
NSString* script =
[NSString stringWithFormat:@"__crWeb.mojo.signalWatch(%d, %d)",
callback_id, result];
[script_evaluator_ executeJavaScript:script completionHandler:nil];
});
- mojo::Watcher* watcher = new mojo::Watcher(FROM_HERE);
+ mojo::SimpleWatcher* watcher = new mojo::SimpleWatcher(
+ FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC);
watchers_.insert(std::make_pair(++last_watch_id_, base::WrapUnique(watcher)));
- watcher->Start(static_cast<mojo::Handle>(handle), signals, callback);
+ watcher->Watch(static_cast<mojo::Handle>(handle), signals, callback);
return ValueFromInteger(last_watch_id_);
}

Powered by Google App Engine
This is Rietveld 408576698