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

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

Issue 2001673003: EDK: Add Core::DuplicateHandleWithReducedRights(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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/mock_simple_dispatcher.h ('k') | mojo/edk/system/shared_buffer_dispatcher.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mock_simple_dispatcher.h" 5 #include "mojo/edk/system/mock_simple_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/edk/util/thread_annotations.h" 8 #include "mojo/edk/util/thread_annotations.h"
9 9
10 using mojo::util::MakeRefCounted; 10 using mojo::util::MakeRefCounted;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 MockSimpleDispatcher::MockSimpleDispatcher( 58 MockSimpleDispatcher::MockSimpleDispatcher(
59 MojoHandleSignals satisfied_signals, 59 MojoHandleSignals satisfied_signals,
60 MojoHandleSignals satisfiable_signals) 60 MojoHandleSignals satisfiable_signals)
61 : state_(satisfied_signals, satisfiable_signals) {} 61 : state_(satisfied_signals, satisfiable_signals) {}
62 62
63 MockSimpleDispatcher::MockSimpleDispatcher(const HandleSignalsState& state) 63 MockSimpleDispatcher::MockSimpleDispatcher(const HandleSignalsState& state)
64 : state_(state) {} 64 : state_(state) {}
65 65
66 MockSimpleDispatcher::~MockSimpleDispatcher() {} 66 MockSimpleDispatcher::~MockSimpleDispatcher() {}
67 67
68 MojoResult MockSimpleDispatcher::DuplicateDispatcherImplNoLock(
69 util::RefPtr<Dispatcher>* new_dispatcher) {
70 *new_dispatcher = MakeRefCounted<MockSimpleDispatcher>(state_);
71 return MOJO_RESULT_OK;
72 }
73
68 RefPtr<Dispatcher> 74 RefPtr<Dispatcher>
69 MockSimpleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( 75 MockSimpleDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock(
70 MessagePipe* /*message_pipe*/, 76 MessagePipe* /*message_pipe*/,
71 unsigned /*port*/) MOJO_NO_THREAD_SAFETY_ANALYSIS { 77 unsigned /*port*/) MOJO_NO_THREAD_SAFETY_ANALYSIS {
72 CancelAllAwakablesNoLock(); 78 CancelAllAwakablesNoLock();
73 return MakeRefCounted<MockSimpleDispatcher>(state_); 79 return MakeRefCounted<MockSimpleDispatcher>(state_);
74 } 80 }
75 81
76 HandleSignalsState MockSimpleDispatcher::GetHandleSignalsStateImplNoLock() 82 HandleSignalsState MockSimpleDispatcher::GetHandleSignalsStateImplNoLock()
77 const { 83 const {
78 mutex().AssertHeld(); 84 mutex().AssertHeld();
79 return state_; 85 return state_;
80 } 86 }
81 87
82 } // namespace test 88 } // namespace test
83 } // namespace system 89 } // namespace system
84 } // namespace mojo 90 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/mock_simple_dispatcher.h ('k') | mojo/edk/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698