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

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

Issue 411253011: Convert BeginWriteData...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 364
365 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle, 365 MojoResult Core::BeginWriteData(MojoHandle data_pipe_producer_handle,
366 UserPointer<void*> buffer, 366 UserPointer<void*> buffer,
367 UserPointer<uint32_t> buffer_num_bytes, 367 UserPointer<uint32_t> buffer_num_bytes,
368 MojoWriteDataFlags flags) { 368 MojoWriteDataFlags flags) {
369 scoped_refptr<Dispatcher> dispatcher( 369 scoped_refptr<Dispatcher> dispatcher(
370 GetDispatcher(data_pipe_producer_handle)); 370 GetDispatcher(data_pipe_producer_handle));
371 if (!dispatcher) 371 if (!dispatcher)
372 return MOJO_RESULT_INVALID_ARGUMENT; 372 return MOJO_RESULT_INVALID_ARGUMENT;
373 373
374 return dispatcher->BeginWriteData(buffer.GetPointerUnsafe(), 374 return dispatcher->BeginWriteData(buffer, buffer_num_bytes, flags);
375 buffer_num_bytes.GetPointerUnsafe(), flags);
376 } 375 }
377 376
378 MojoResult Core::EndWriteData(MojoHandle data_pipe_producer_handle, 377 MojoResult Core::EndWriteData(MojoHandle data_pipe_producer_handle,
379 uint32_t num_bytes_written) { 378 uint32_t num_bytes_written) {
380 scoped_refptr<Dispatcher> dispatcher( 379 scoped_refptr<Dispatcher> dispatcher(
381 GetDispatcher(data_pipe_producer_handle)); 380 GetDispatcher(data_pipe_producer_handle));
382 if (!dispatcher) 381 if (!dispatcher)
383 return MOJO_RESULT_INVALID_ARGUMENT; 382 return MOJO_RESULT_INVALID_ARGUMENT;
384 383
385 return dispatcher->EndWriteData(num_bytes_written); 384 return dispatcher->EndWriteData(num_bytes_written);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be 554 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
556 // destroyed, but this would still be required if the waiter were in TLS.) 555 // destroyed, but this would still be required if the waiter were in TLS.)
557 for (i = 0; i < num_added; i++) 556 for (i = 0; i < num_added; i++)
558 dispatchers[i]->RemoveWaiter(&waiter); 557 dispatchers[i]->RemoveWaiter(&waiter);
559 558
560 return rv; 559 return rv;
561 } 560 }
562 561
563 } // namespace system 562 } // namespace system
564 } // namespace mojo 563 } // 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