Infobar material design refresh: bg color
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / pipe / pipe_event_emitter.cc
blob738a84bdaa5390f7950632200a012ad3cf318119
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 #include "nacl_io/pipe/pipe_event_emitter.h"
7 #include <algorithm>
9 namespace nacl_io {
11 PipeEventEmitter::PipeEventEmitter(size_t size)
12 : fifo_(std::max<size_t>(1, size)) {
13 UpdateStatus_Locked();
16 Error PipeEventEmitter::Read_Locked(char* data, size_t len, int* out_bytes) {
17 *out_bytes = fifo_.Read(data, len);
19 UpdateStatus_Locked();
20 return 0;
23 Error PipeEventEmitter::Write_Locked(const char* data,
24 size_t len,
25 int* out_bytes) {
26 *out_bytes = fifo_.Write(data, len);
28 UpdateStatus_Locked();
29 return 0;
32 } // namespace nacl_io