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

Unified Diff: mojo/system/core_test_base.cc

Issue 25323003: Mojo: Optimize VerifyUserPointer(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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_impl.cc ('k') | mojo/system/memory.h » ('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 36241f8cf4a778539caa16d802834902538485d0..93b11dea4fcdaa518f25320d2e707cccdc05643f 100644
--- a/mojo/system/core_test_base.cc
+++ b/mojo/system/core_test_base.cc
@@ -51,9 +51,9 @@ class MockDispatcher : public Dispatcher {
info_->IncrementWriteMessageCallCount();
lock().AssertAcquired();
- if (!VerifyUserPointer(bytes, num_bytes, 1))
+ if (!VerifyUserPointer<void>(bytes, num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (!VerifyUserPointer(handles, num_handles, sizeof(handles[0])))
+ if (!VerifyUserPointer<MojoHandle>(handles, num_handles))
return MOJO_RESULT_INVALID_ARGUMENT;
return MOJO_RESULT_OK;
@@ -68,10 +68,10 @@ class MockDispatcher : public Dispatcher {
info_->IncrementReadMessageCallCount();
lock().AssertAcquired();
- if (num_bytes && !VerifyUserPointer(bytes, *num_bytes, 1))
+ if (num_bytes && !VerifyUserPointer<void>(bytes, *num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
if (num_handles &&
- !VerifyUserPointer(handles, *num_handles, sizeof(handles[0])))
+ !VerifyUserPointer<MojoHandle>(handles, *num_handles))
return MOJO_RESULT_INVALID_ARGUMENT;
return MOJO_RESULT_OK;
« no previous file with comments | « mojo/system/core_impl.cc ('k') | mojo/system/memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698