| 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/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 12 matching lines...) Expand all Loading... |
| 23 // MockDispatcher -------------------------------------------------------------- | 23 // MockDispatcher -------------------------------------------------------------- |
| 24 | 24 |
| 25 class MockDispatcher : public Dispatcher { | 25 class MockDispatcher : public Dispatcher { |
| 26 public: | 26 public: |
| 27 explicit MockDispatcher(CoreTestBase::MockHandleInfo* info) | 27 explicit MockDispatcher(CoreTestBase::MockHandleInfo* info) |
| 28 : info_(info) { | 28 : info_(info) { |
| 29 CHECK(info_); | 29 CHECK(info_); |
| 30 info_->IncrementCtorCallCount(); | 30 info_->IncrementCtorCallCount(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 virtual Type GetType() OVERRIDE { |
| 34 return kTypeUnknown; |
| 35 } |
| 36 |
| 33 private: | 37 private: |
| 34 friend class base::RefCountedThreadSafe<MockDispatcher>; | 38 friend class base::RefCountedThreadSafe<MockDispatcher>; |
| 35 virtual ~MockDispatcher() { | 39 virtual ~MockDispatcher() { |
| 36 info_->IncrementDtorCallCount(); | 40 info_->IncrementDtorCallCount(); |
| 37 } | 41 } |
| 38 | 42 |
| 39 // |Dispatcher| implementation/overrides: | 43 // |Dispatcher| implementation/overrides: |
| 40 virtual MojoResult CloseImplNoLock() OVERRIDE { | 44 virtual MojoResult CloseImplNoLock() OVERRIDE { |
| 41 info_->IncrementCloseCallCount(); | 45 info_->IncrementCloseCallCount(); |
| 42 lock().AssertAcquired(); | 46 lock().AssertAcquired(); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 } | 341 } |
| 338 | 342 |
| 339 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { | 343 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { |
| 340 base::AutoLock locker(lock_); | 344 base::AutoLock locker(lock_); |
| 341 cancel_all_waiters_call_count_++; | 345 cancel_all_waiters_call_count_++; |
| 342 } | 346 } |
| 343 | 347 |
| 344 } // namespace test | 348 } // namespace test |
| 345 } // namespace system | 349 } // namespace system |
| 346 } // namespace mojo | 350 } // namespace mojo |
| OLD | NEW |