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

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

Issue 2088833003: Add different behavior to AwakableList for "persistent" vs "one-shot" awakables. (Closed) Base URL: https://github.com/domokit/mojo.git@work793_wait_set_4.5
Patch Set: Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/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/edk/system/core_test_base.h" 5 #include "mojo/edk/system/core_test_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 MojoMapBufferFlags /*flags*/, 165 MojoMapBufferFlags /*flags*/,
166 std::unique_ptr<platform::PlatformSharedBufferMapping>* /*mapping*/) 166 std::unique_ptr<platform::PlatformSharedBufferMapping>* /*mapping*/)
167 override { 167 override {
168 info_->IncrementMapBufferCallCount(); 168 info_->IncrementMapBufferCallCount();
169 mutex().AssertHeld(); 169 mutex().AssertHeld();
170 return MOJO_RESULT_UNIMPLEMENTED; 170 return MOJO_RESULT_UNIMPLEMENTED;
171 } 171 }
172 172
173 MojoResult AddAwakableImplNoLock(Awakable* awakable, 173 MojoResult AddAwakableImplNoLock(Awakable* awakable,
174 uint64_t /*context*/, 174 uint64_t /*context*/,
175 bool /*force*/, 175 bool /*persistent*/,
176 MojoHandleSignals /*signals*/, 176 MojoHandleSignals /*signals*/,
177 HandleSignalsState* signals_state) override { 177 HandleSignalsState* signals_state) override {
178 info_->IncrementAddAwakableCallCount(); 178 info_->IncrementAddAwakableCallCount();
179 mutex().AssertHeld(); 179 mutex().AssertHeld();
180 if (signals_state) 180 if (signals_state)
181 *signals_state = HandleSignalsState(); 181 *signals_state = HandleSignalsState();
182 if (info_->IsAddAwakableAllowed()) { 182 if (info_->IsAddAwakableAllowed()) {
183 info_->AwakableWasAdded(awakable); 183 info_->AwakableWasAdded(awakable);
184 return MOJO_RESULT_OK; 184 return MOJO_RESULT_OK;
185 } 185 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 459
460 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { 460 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) {
461 MutexLocker locker(&mutex_); 461 MutexLocker locker(&mutex_);
462 added_awakables_.push_back(awakable); 462 added_awakables_.push_back(awakable);
463 } 463 }
464 464
465 } // namespace test 465 } // namespace test
466 } // namespace system 466 } // namespace system
467 } // namespace mojo 467 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/core_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698