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

Side by Side Diff: mojo/system/handle_signals_state.h

Issue 339193005: Mojo: Rename (Mojo)WaitFlagsState -> (Mojo)HandleSignalsState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/data_pipe.cc ('k') | mojo/system/local_data_pipe.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef MOJO_SYSTEM_WAIT_FLAGS_STATE_H_ 5 #ifndef MOJO_SYSTEM_HANDLE_SIGNALS_STATE_H_
6 #define MOJO_SYSTEM_WAIT_FLAGS_STATE_H_ 6 #define MOJO_SYSTEM_HANDLE_SIGNALS_STATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "mojo/public/c/system/types.h" 9 #include "mojo/public/c/system/types.h"
10 #include "mojo/system/system_impl_export.h" 10 #include "mojo/system/system_impl_export.h"
11 11
12 namespace mojo { 12 namespace mojo {
13 namespace system { 13 namespace system {
14 14
15 // Just "add" some constructors and methods to the C struct |MojoWaitFlagsState| 15 // Just "add" some constructors and methods to the C struct
16 // (for convenience). This should add no overhead. 16 // |MojoHandleSignalsState| (for convenience). This should add no overhead.
17 struct MOJO_SYSTEM_IMPL_EXPORT WaitFlagsState : public MojoWaitFlagsState { 17 struct MOJO_SYSTEM_IMPL_EXPORT HandleSignalsState
18 WaitFlagsState() { 18 : public MojoHandleSignalsState {
19 HandleSignalsState() {
19 satisfied_signals = MOJO_HANDLE_SIGNAL_NONE; 20 satisfied_signals = MOJO_HANDLE_SIGNAL_NONE;
20 satisfiable_signals = MOJO_HANDLE_SIGNAL_NONE; 21 satisfiable_signals = MOJO_HANDLE_SIGNAL_NONE;
21 } 22 }
22 WaitFlagsState(MojoHandleSignals satisfied, MojoHandleSignals satisfiable) { 23 HandleSignalsState(MojoHandleSignals satisfied,
24 MojoHandleSignals satisfiable) {
23 satisfied_signals = satisfied; 25 satisfied_signals = satisfied;
24 satisfiable_signals = satisfiable; 26 satisfiable_signals = satisfiable;
25 } 27 }
26 28
27 bool equals(const WaitFlagsState& other) const { 29 bool equals(const HandleSignalsState& other) const {
28 return satisfied_signals == other.satisfied_signals && 30 return satisfied_signals == other.satisfied_signals &&
29 satisfiable_signals == other.satisfiable_signals; 31 satisfiable_signals == other.satisfiable_signals;
30 } 32 }
31 33
32 bool satisfies(MojoHandleSignals signals) const { 34 bool satisfies(MojoHandleSignals signals) const {
33 return !!(satisfied_signals & signals); 35 return !!(satisfied_signals & signals);
34 } 36 }
35 37
36 bool can_satisfy(MojoHandleSignals signals) const { 38 bool can_satisfy(MojoHandleSignals signals) const {
37 return !!(satisfiable_signals & signals); 39 return !!(satisfiable_signals & signals);
38 } 40 }
39 41
40 // (Copy and assignment allowed.) 42 // (Copy and assignment allowed.)
41 }; 43 };
42 COMPILE_ASSERT(sizeof(WaitFlagsState) == sizeof(MojoWaitFlagsState), 44 COMPILE_ASSERT(sizeof(HandleSignalsState) == sizeof(MojoHandleSignalsState),
43 WaitFlagsState_should_add_no_overhead); 45 HandleSignalsState_should_add_no_overhead);
44 46
45 } // namespace system 47 } // namespace system
46 } // namespace mojo 48 } // namespace mojo
47 49
48 #endif // MOJO_SYSTEM_WAIT_FLAGS_STATE_H_ 50 #endif // MOJO_SYSTEM_HANDLE_SIGNALS_STATE_H_
OLDNEW
« no previous file with comments | « mojo/system/data_pipe.cc ('k') | mojo/system/local_data_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698