diff options
author | rockot <rockot@chromium.org> | 2016-03-02 21:17:34 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-03 05:18:30 +0000 |
commit | a26c55926c2f7d4640691b571e21d14e635e531a (patch) | |
tree | f4574770d54caa94bd5791531c330e0356eaf997 /mojo/public | |
parent | 464574d96d15eeb2c984fcd025d5f1cb7da34594 (diff) | |
download | chromium_src-a26c55926c2f7d4640691b571e21d14e635e531a.zip chromium_src-a26c55926c2f7d4640691b571e21d14e635e531a.tar.gz chromium_src-a26c55926c2f7d4640691b571e21d14e635e531a.tar.bz2 |
[mojo] Add missing Watch/CancelWatch system thunks
Needed for Mojo apps to be able to use the new MojoWatch and
MojoCancelWatch APIs.
BUG=None
R=amistry@chromium.org
Review URL: https://codereview.chromium.org/1760093002
Cr-Commit-Position: refs/heads/master@{#378962}
Diffstat (limited to 'mojo/public')
-rw-r--r-- | mojo/public/platform/native/system_thunks.cc | 13 | ||||
-rw-r--r-- | mojo/public/platform/native/system_thunks.h | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/mojo/public/platform/native/system_thunks.cc b/mojo/public/platform/native/system_thunks.cc index 3af7d58..fd14d48 100644 --- a/mojo/public/platform/native/system_thunks.cc +++ b/mojo/public/platform/native/system_thunks.cc @@ -187,6 +187,19 @@ MojoResult MojoGetReadyHandles(MojoHandle wait_set, signals_states); } +MojoResult MojoWatch(MojoHandle handle, + MojoHandleSignals signals, + MojoWatchCallback callback, + uintptr_t context) { + assert(g_thunks.Watch); + return g_thunks.Watch(handle, signals, callback, context); +} + +MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) { + assert(g_thunks.CancelWatch); + return g_thunks.CancelWatch(handle, context); +} + extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( const MojoSystemThunks* system_thunks) { if (system_thunks->size >= sizeof(g_thunks)) diff --git a/mojo/public/platform/native/system_thunks.h b/mojo/public/platform/native/system_thunks.h index 393ee40..b50970e 100644 --- a/mojo/public/platform/native/system_thunks.h +++ b/mojo/public/platform/native/system_thunks.h @@ -114,6 +114,11 @@ struct MojoSystemThunks { MojoHandle* handles, MojoResult* results, struct MojoHandleSignalsState* signals_states); + MojoResult (*Watch)(MojoHandle handle, + MojoHandleSignals signals, + MojoWatchCallback callback, + uintptr_t context); + MojoResult (*CancelWatch)(MojoHandle handle, uintptr_t context); }; #pragma pack(pop) @@ -144,7 +149,9 @@ inline MojoSystemThunks MojoMakeSystemThunks() { MojoCreateWaitSet, MojoAddHandle, MojoRemoveHandle, - MojoGetReadyHandles}; + MojoGetReadyHandles, + MojoWatch, + MojoCancelWatch}; return system_thunks; } #endif |