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

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

Issue 2056763003: EDK: Change Awakable::Awake()'s context, etc., to be a uint64_t. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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/edk/system/core_test_base.cc » ('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 1eff33b1ed96e1112164e3dddc5083d17a4dcc0b..f762c8cc482f91f2e9d6587e743d395384aa02b7 100644
--- a/mojo/edk/system/core.cc
+++ b/mojo/edk/system/core.cc
@@ -4,6 +4,7 @@
#include "mojo/edk/system/core.h"
+#include <limits>
#include <memory>
#include <utility>
#include <vector>
@@ -240,7 +241,7 @@ MojoResult Core::Wait(MojoHandle handle,
MojoHandleSignals signals,
MojoDeadline deadline,
UserPointer<MojoHandleSignalsState> signals_state) {
- uint32_t unused = static_cast<uint32_t>(-1);
+ uint64_t unused = static_cast<uint64_t>(-1);
HandleSignalsState hss;
MojoResult result = WaitManyInternal(&handle, &signals, 1, deadline, &unused,
signals_state.IsNull() ? nullptr : &hss);
@@ -263,7 +264,7 @@ MojoResult Core::WaitMany(UserPointer<const MojoHandle> handles,
UserPointer<const MojoHandle>::Reader handles_reader(handles, num_handles);
UserPointer<const MojoHandleSignals>::Reader signals_reader(signals,
num_handles);
- uint32_t index = static_cast<uint32_t>(-1);
+ uint64_t index = static_cast<uint64_t>(-1);
MojoResult result;
if (signals_states.IsNull()) {
result = WaitManyInternal(handles_reader.GetPointer(),
@@ -281,8 +282,10 @@ MojoResult Core::WaitMany(UserPointer<const MojoHandle> handles,
if (result != MOJO_RESULT_INVALID_ARGUMENT)
signals_states_writer.Commit();
}
- if (index != static_cast<uint32_t>(-1) && !result_index.IsNull())
- result_index.Put(index);
+ if (index != static_cast<uint64_t>(-1) && !result_index.IsNull()) {
+ DCHECK_LE(index, std::numeric_limits<uint32_t>::max());
+ result_index.Put(static_cast<uint32_t>(index));
+ }
return result;
}
@@ -755,10 +758,10 @@ MojoResult Core::WaitManyInternal(const MojoHandle* handles,
const MojoHandleSignals* signals,
uint32_t num_handles,
MojoDeadline deadline,
- uint32_t* result_index,
+ uint64_t* result_index,
HandleSignalsState* signals_states) {
DCHECK_GT(num_handles, 0u);
- DCHECK_EQ(*result_index, static_cast<uint32_t>(-1));
+ DCHECK_EQ(*result_index, static_cast<uint64_t>(-1));
DispatcherVector dispatchers;
dispatchers.reserve(num_handles);
« no previous file with comments | « mojo/edk/system/core.h ('k') | mojo/edk/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698