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

Side by Side Diff: mojo/system/core.cc

Issue 423583002: Convert WriteData...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/system/core_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/system/core.h" 5 #include "mojo/system/core.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 MojoResult Core::WriteData(MojoHandle data_pipe_producer_handle, 354 MojoResult Core::WriteData(MojoHandle data_pipe_producer_handle,
355 UserPointer<const void> elements, 355 UserPointer<const void> elements,
356 UserPointer<uint32_t> num_bytes, 356 UserPointer<uint32_t> num_bytes,
357 MojoWriteDataFlags flags) { 357 MojoWriteDataFlags flags) {
358 scoped_refptr<Dispatcher> dispatcher( 358 scoped_refptr<Dispatcher> dispatcher(
359 GetDispatcher(data_pipe_producer_handle)); 359 GetDispatcher(data_pipe_producer_handle));
360 if (!dispatcher) 360 if (!dispatcher)
361 return MOJO_RESULT_INVALID_ARGUMENT; 361 return MOJO_RESULT_INVALID_ARGUMENT;
362 362
363 return dispatcher->WriteData(elements.GetPointerUnsafe(), 363 return dispatcher->WriteData(elements, num_bytes, flags);
364 num_bytes.GetPointerUnsafe(), flags);
365 } 364 }
366 365
367 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle, 366 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle,
368 UserPointer<void*> buffer, 367 UserPointer<void*> buffer,
369 UserPointer<uint32_t> buffer_num_bytes, 368 UserPointer<uint32_t> buffer_num_bytes,
370 MojoWriteDataFlags flags) { 369 MojoWriteDataFlags flags) {
371 scoped_refptr<Dispatcher> dispatcher( 370 scoped_refptr<Dispatcher> dispatcher(
372 GetDispatcher(data_pipe_producer_handle)); 371 GetDispatcher(data_pipe_producer_handle));
373 if (!dispatcher) 372 if (!dispatcher)
374 return MOJO_RESULT_INVALID_ARGUMENT; 373 return MOJO_RESULT_INVALID_ARGUMENT;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be 555 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
557 // destroyed, but this would still be required if the waiter were in TLS.) 556 // destroyed, but this would still be required if the waiter were in TLS.)
558 for (i = 0; i < num_added; i++) 557 for (i = 0; i < num_added; i++)
559 dispatchers[i]->RemoveWaiter(&waiter); 558 dispatchers[i]->RemoveWaiter(&waiter);
560 559
561 return rv; 560 return rv;
562 } 561 }
563 562
564 } // namespace system 563 } // namespace system
565 } // namespace mojo 564 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698