Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / stream / stream_event_emitter.h
blob703cf996343c589fffa511b434b540a23e5fcfb9
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
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_STREAM_STREAM_EVENT_EMITTER_H_
6 #define LIBRARIES_NACL_IO_STREAM_STREAM_EVENT_EMITTER_H_
8 #include "nacl_io/event_emitter.h"
10 #include "sdk_util/macros.h"
11 #include "sdk_util/scoped_ref.h"
13 namespace nacl_io {
15 class FIFOInterface;
16 class StreamEventEmitter;
17 class StreamNode;
19 typedef sdk_util::ScopedRef<StreamEventEmitter> ScopedStreamEventEmitter;
21 class StreamEventEmitter : public EventEmitter {
22 public:
23 StreamEventEmitter();
25 void AttachStream(StreamNode* stream);
26 void DetachStream();
28 StreamNode* stream() { return stream_; }
30 protected:
31 virtual FIFOInterface* in_fifo() = 0;
32 virtual FIFOInterface* out_fifo() = 0;
33 void UpdateStatus_Locked();
35 protected:
36 StreamNode* stream_;
37 DISALLOW_COPY_AND_ASSIGN(StreamEventEmitter);
40 } // namespace nacl_io
42 #endif // LIBRARIES_NACL_IO_STREAM_STREAM_EVENT_EMITTER_H_