diff options
Diffstat (limited to 'mojo/public/cpp/system/watcher.cc')
-rw-r--r-- | mojo/public/cpp/system/watcher.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mojo/public/cpp/system/watcher.cc b/mojo/public/cpp/system/watcher.cc new file mode 100644 index 0000000000..0c62ba8e20 --- /dev/null +++ b/mojo/public/cpp/system/watcher.cc @@ -0,0 +1,20 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mojo/public/cpp/system/watcher.h" + +#include "mojo/public/c/system/functions.h" + +namespace mojo { + +MojoResult CreateWatcher(MojoWatcherCallback callback, + ScopedWatcherHandle* watcher_handle) { + MojoHandle handle; + MojoResult rv = MojoCreateWatcher(callback, &handle); + if (rv == MOJO_RESULT_OK) + watcher_handle->reset(WatcherHandle(handle)); + return rv; +} + +} // namespace mojo |