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

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

Issue 425523002: Mojo: Convert MemoryTest.Valid to 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 | « mojo/system/core.h ('k') | mojo/system/entrypoints.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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 base::AutoLock locker(mapping_table_lock_); 493 base::AutoLock locker(mapping_table_lock_);
494 result = mapping_table_.AddMapping(mapping.Pass()); 494 result = mapping_table_.AddMapping(mapping.Pass());
495 } 495 }
496 if (result != MOJO_RESULT_OK) 496 if (result != MOJO_RESULT_OK)
497 return result; 497 return result;
498 498
499 buffer.Put(address); 499 buffer.Put(address);
500 return MOJO_RESULT_OK; 500 return MOJO_RESULT_OK;
501 } 501 }
502 502
503 MojoResult Core::UnmapBuffer(UserPointerValue<void> buffer) { 503 MojoResult Core::UnmapBuffer(UserPointer<void> buffer) {
504 base::AutoLock locker(mapping_table_lock_); 504 base::AutoLock locker(mapping_table_lock_);
505 return mapping_table_.RemoveMapping(buffer.GetValue()); 505 return mapping_table_.RemoveMapping(buffer.GetPointerValue());
506 } 506 }
507 507
508 // Note: We allow |handles| to repeat the same handle multiple times, since 508 // Note: We allow |handles| to repeat the same handle multiple times, since
509 // different flags may be specified. 509 // different flags may be specified.
510 // TODO(vtl): This incurs a performance cost in |RemoveWaiter()|. Analyze this 510 // TODO(vtl): This incurs a performance cost in |RemoveWaiter()|. Analyze this
511 // more carefully and address it if necessary. 511 // more carefully and address it if necessary.
512 MojoResult Core::WaitManyInternal(const MojoHandle* handles, 512 MojoResult Core::WaitManyInternal(const MojoHandle* handles,
513 const MojoHandleSignals* signals, 513 const MojoHandleSignals* signals,
514 uint32_t num_handles, 514 uint32_t num_handles,
515 MojoDeadline deadline, 515 MojoDeadline deadline,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be 552 // |Wait()|/|WaitMany()| call. (Only after doing this can |waiter| be
553 // destroyed, but this would still be required if the waiter were in TLS.) 553 // destroyed, but this would still be required if the waiter were in TLS.)
554 for (i = 0; i < num_added; i++) 554 for (i = 0; i < num_added; i++)
555 dispatchers[i]->RemoveWaiter(&waiter); 555 dispatchers[i]->RemoveWaiter(&waiter);
556 556
557 return rv; 557 return rv;
558 } 558 }
559 559
560 } // namespace system 560 } // namespace system
561 } // namespace mojo 561 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/core.h ('k') | mojo/system/entrypoints.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698