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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/event_emitter_signal.h

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge emitter changes Created 7 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef LIBRARIES_NACL_IO_EVENT_EMITTER_SIGNAL_H_
6 #define LIBRARIES_NACL_IO_EVENT_EMITTER_SIGNAL_H_
7
8 #include <poll.h>
9
10 #include "nacl_io/event_emitter.h"
11 #include "sdk_util/auto_lock.h"
12 #include "sdk_util/scoped_ref.h"
13
14 namespace nacl_io {
15
16 class EventEmitterSignal;
17 typedef sdk_util::ScopedRef<EventEmitterSignal> ScopedEmitterSignal;
18
19 class EventEmitterSignal : public EventEmitter {
20 public:
21 EventEmitterSignal() : events_(0) {};
binji 2013/09/12 01:47:56 semicolon is unecessary
22
23 virtual uint32_t GetEventStatus() { return events_; }
24
25 void Raise(uint32_t events) {
26 AUTO_LOCK(emitter_lock_);
27 events_ |= events;
28 RaiseEvents_Locked(POLLERR);
29 }
30
31 void Clear(uint32_t events) {
32 AUTO_LOCK(emitter_lock_);
33 events_ &= ~events;
34 }
35
36 protected:
binji 2013/09/12 01:47:56 I prefer member variables are private
37 uint32_t events_;
38 };
39
40 } // namespace nacl_io
41
42 #endif // LIBRARIES_NACL_IO_EVENT_EMITTER_SIGNAL_H_
43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698