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

Unified Diff: mojo/edk/system/core.cc

Issue 2084993002: Mojo: add support for disallowing sync calls for a process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/mojo_public.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core.cc
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc
index d8d861aee90a390bbe738b2a0b01fc599f6d7ac2..aca5b25967374ef6d2b3196ba173ec32cbfbdb3c 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -377,6 +377,17 @@ MojoResult Core::AsyncWait(MojoHandle handle,
return rv;
}
+MojoResult Core::SetProperty(MojoPropertyType type, const void* value) {
+ base::AutoLock locker(property_lock_);
+ switch (type) {
+ case MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED:
+ property_sync_call_allowed_ = *static_cast<const bool*>(value);
+ return MOJO_RESULT_OK;
+ default:
+ return MOJO_RESULT_INVALID_ARGUMENT;
+ }
+}
+
MojoTimeTicks Core::GetTimeTicksNow() {
return base::TimeTicks::Now().ToInternalValue();
}
@@ -526,6 +537,17 @@ MojoResult Core::GetMessageBuffer(MojoMessageHandle message, void** buffer) {
return MOJO_RESULT_OK;
}
+MojoResult Core::GetProperty(MojoPropertyType type, void* value) {
+ base::AutoLock locker(property_lock_);
+ switch (type) {
+ case MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED:
+ *static_cast<bool*>(value) = property_sync_call_allowed_;
+ return MOJO_RESULT_OK;
+ default:
+ return MOJO_RESULT_INVALID_ARGUMENT;
+ }
+}
+
MojoResult Core::CreateWaitSet(MojoHandle* wait_set_handle) {
RequestContext request_context;
if (!wait_set_handle)
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/mojo_public.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698