| OLD | NEW |
| 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/edk/system/core_test_base.h" | 5 #include "mojo/edk/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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "mojo/edk/embedder/simple_platform_support.h" | 12 #include "mojo/edk/embedder/simple_platform_support.h" |
| 13 #include "mojo/edk/system/configuration.h" | 13 #include "mojo/edk/system/constants.h" |
| 14 #include "mojo/edk/system/core.h" | 14 #include "mojo/edk/system/core.h" |
| 15 #include "mojo/edk/system/dispatcher.h" | 15 #include "mojo/edk/system/dispatcher.h" |
| 16 #include "mojo/edk/system/memory.h" | 16 #include "mojo/edk/system/memory.h" |
| 17 | 17 |
| 18 namespace mojo { | 18 namespace mojo { |
| 19 namespace system { | 19 namespace system { |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 MojoResult WriteMessageImplNoLock( | 45 MojoResult WriteMessageImplNoLock( |
| 46 UserPointer<const void> bytes, | 46 UserPointer<const void> bytes, |
| 47 uint32_t num_bytes, | 47 uint32_t num_bytes, |
| 48 std::vector<DispatcherTransport>* transports, | 48 std::vector<DispatcherTransport>* transports, |
| 49 MojoWriteMessageFlags /*flags*/) override { | 49 MojoWriteMessageFlags /*flags*/) override { |
| 50 info_->IncrementWriteMessageCallCount(); | 50 info_->IncrementWriteMessageCallCount(); |
| 51 lock().AssertAcquired(); | 51 lock().AssertAcquired(); |
| 52 | 52 |
| 53 if (num_bytes > GetConfiguration().max_message_num_bytes) | 53 if (num_bytes > kMaxMessageNumBytes) |
| 54 return MOJO_RESULT_RESOURCE_EXHAUSTED; | 54 return MOJO_RESULT_RESOURCE_EXHAUSTED; |
| 55 | 55 |
| 56 if (transports) | 56 if (transports) |
| 57 return MOJO_RESULT_UNIMPLEMENTED; | 57 return MOJO_RESULT_UNIMPLEMENTED; |
| 58 | 58 |
| 59 return MOJO_RESULT_OK; | 59 return MOJO_RESULT_OK; |
| 60 } | 60 } |
| 61 | 61 |
| 62 MojoResult ReadMessageImplNoLock(UserPointer<void> bytes, | 62 MojoResult ReadMessageImplNoLock(UserPointer<void> bytes, |
| 63 UserPointer<uint32_t> num_bytes, | 63 UserPointer<uint32_t> num_bytes, |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 } | 340 } |
| 341 | 341 |
| 342 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { | 342 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { |
| 343 base::AutoLock locker(lock_); | 343 base::AutoLock locker(lock_); |
| 344 cancel_all_waiters_call_count_++; | 344 cancel_all_waiters_call_count_++; |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace test | 347 } // namespace test |
| 348 } // namespace system | 348 } // namespace system |
| 349 } // namespace mojo | 349 } // namespace mojo |
| OLD | NEW |