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

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

Issue 419973005: Convert WriteMessage...() to use the new user pointer handling (see r285350). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.cc ('k') | mojo/system/core_unittest.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_test_base.h" 5 #include "mojo/system/core_test_base.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 29 matching lines...) Expand all
40 info_->IncrementDtorCallCount(); 40 info_->IncrementDtorCallCount();
41 } 41 }
42 42
43 // |Dispatcher| protected methods: 43 // |Dispatcher| protected methods:
44 virtual void CloseImplNoLock() OVERRIDE { 44 virtual void CloseImplNoLock() OVERRIDE {
45 info_->IncrementCloseCallCount(); 45 info_->IncrementCloseCallCount();
46 lock().AssertAcquired(); 46 lock().AssertAcquired();
47 } 47 }
48 48
49 virtual MojoResult WriteMessageImplNoLock( 49 virtual MojoResult WriteMessageImplNoLock(
50 const void* bytes, 50 UserPointer<const void> bytes,
51 uint32_t num_bytes, 51 uint32_t num_bytes,
52 std::vector<DispatcherTransport>* transports, 52 std::vector<DispatcherTransport>* transports,
53 MojoWriteMessageFlags /*flags*/) OVERRIDE { 53 MojoWriteMessageFlags /*flags*/) OVERRIDE {
54 info_->IncrementWriteMessageCallCount(); 54 info_->IncrementWriteMessageCallCount();
55 lock().AssertAcquired(); 55 lock().AssertAcquired();
56 56
57 if (!VerifyUserPointerWithSize<1>(bytes, num_bytes))
58 return MOJO_RESULT_INVALID_ARGUMENT;
59 if (num_bytes > kMaxMessageNumBytes) 57 if (num_bytes > kMaxMessageNumBytes)
60 return MOJO_RESULT_RESOURCE_EXHAUSTED; 58 return MOJO_RESULT_RESOURCE_EXHAUSTED;
61 59
62 if (transports) 60 if (transports)
63 return MOJO_RESULT_UNIMPLEMENTED; 61 return MOJO_RESULT_UNIMPLEMENTED;
64 62
65 return MOJO_RESULT_OK; 63 return MOJO_RESULT_OK;
66 } 64 }
67 65
68 virtual MojoResult ReadMessageImplNoLock( 66 virtual MojoResult ReadMessageImplNoLock(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 343 }
346 344
347 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { 345 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() {
348 base::AutoLock locker(lock_); 346 base::AutoLock locker(lock_);
349 cancel_all_waiters_call_count_++; 347 cancel_all_waiters_call_count_++;
350 } 348 }
351 349
352 } // namespace test 350 } // namespace test
353 } // namespace system 351 } // namespace system
354 } // namespace mojo 352 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/core.cc ('k') | mojo/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698