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

Unified Diff: mojo/system/data_pipe_producer_dispatcher.cc

Issue 304303006: Mojo: Specify/check alignment of pointers more carefully. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix msvs Created 6 years, 7 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/data_pipe_consumer_dispatcher.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/data_pipe_producer_dispatcher.cc
diff --git a/mojo/system/data_pipe_producer_dispatcher.cc b/mojo/system/data_pipe_producer_dispatcher.cc
index 574a0c2b0d0b6ffc1db5a22a66dcabf525e37ccd..617f231a11411ccdc2b3ab962f191f2668e266fd 100644
--- a/mojo/system/data_pipe_producer_dispatcher.cc
+++ b/mojo/system/data_pipe_producer_dispatcher.cc
@@ -56,9 +56,9 @@ MojoResult DataPipeProducerDispatcher::WriteDataImplNoLock(
MojoWriteDataFlags flags) {
lock().AssertAcquired();
- if (!VerifyUserPointer<uint32_t>(num_bytes, 1))
+ if (!VerifyUserPointer<uint32_t>(num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (!VerifyUserPointer<void>(elements, *num_bytes))
+ if (!VerifyUserPointerWithSize<1>(elements, *num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
return data_pipe_->ProducerWriteData(
@@ -71,9 +71,9 @@ MojoResult DataPipeProducerDispatcher::BeginWriteDataImplNoLock(
MojoWriteDataFlags flags) {
lock().AssertAcquired();
- if (!VerifyUserPointer<void*>(buffer, 1))
+ if (!VerifyUserPointerWithCount<void*>(buffer, 1))
return MOJO_RESULT_INVALID_ARGUMENT;
- if (!VerifyUserPointer<uint32_t>(buffer_num_bytes, 1))
+ if (!VerifyUserPointer<uint32_t>(buffer_num_bytes))
return MOJO_RESULT_INVALID_ARGUMENT;
return data_pipe_->ProducerBeginWriteData(
« no previous file with comments | « mojo/system/data_pipe_consumer_dispatcher.cc ('k') | mojo/system/memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698