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

Unified Diff: mojo/system/core_test_base.cc

Issue 418033005: Mojo: Change how we handle invalid pointer arguments (at the system layer). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 6 years, 5 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/system/core.cc ('k') | mojo/system/core_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/core_test_base.cc
diff --git a/mojo/system/core_test_base.cc b/mojo/system/core_test_base.cc
index c91437c42c655162be93c987331f15ec8a9f0c84..c02b1188c1204f0a3f9af4c9075db6b294bad770 100644
--- a/mojo/system/core_test_base.cc
+++ b/mojo/system/core_test_base.cc
@@ -68,8 +68,8 @@ class MockDispatcher : public Dispatcher {
virtual MojoResult ReadMessageImplNoLock(
void* bytes,
uint32_t* num_bytes,
- DispatcherVector* /*dispatchers*/,
- uint32_t* /*num_dispatchers*/,
+ DispatcherVector* dispatchers,
+ uint32_t* num_dispatchers,
MojoReadMessageFlags /*flags*/) OVERRIDE {
info_->IncrementReadMessageCallCount();
lock().AssertAcquired();
@@ -77,6 +77,14 @@ class MockDispatcher : public Dispatcher {
if (num_bytes && !VerifyUserPointerWithSize<1>(bytes, *num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
+ if (num_dispatchers) {
+ *num_dispatchers = 1;
+ if (dispatchers) {
+ // Okay to leave an invalid dispatcher.
+ dispatchers->resize(1);
+ }
+ }
+
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/system/core.cc ('k') | mojo/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698