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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/pipe/pipe_event_emitter.cc

Issue 303223007: [NaCl SDK] nacl_io: Run clang-format over nacl_io sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 "nacl_io/pipe/pipe_event_emitter.h" 5 #include "nacl_io/pipe/pipe_event_emitter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 namespace nacl_io { 9 namespace nacl_io {
10 10
11 PipeEventEmitter::PipeEventEmitter(size_t size) 11 PipeEventEmitter::PipeEventEmitter(size_t size)
12 : fifo_(std::max<size_t>(1, size)) { 12 : fifo_(std::max<size_t>(1, size)) {
13 UpdateStatus_Locked(); 13 UpdateStatus_Locked();
14 } 14 }
15 15
16 Error PipeEventEmitter::Read_Locked(char* data, size_t len, int* out_bytes) { 16 Error PipeEventEmitter::Read_Locked(char* data, size_t len, int* out_bytes) {
17 *out_bytes = fifo_.Read(data, len); 17 *out_bytes = fifo_.Read(data, len);
18 18
19 UpdateStatus_Locked(); 19 UpdateStatus_Locked();
20 return 0; 20 return 0;
21 } 21 }
22 22
23 Error PipeEventEmitter::Write_Locked(const char* data, size_t len, 23 Error PipeEventEmitter::Write_Locked(const char* data,
24 size_t len,
24 int* out_bytes) { 25 int* out_bytes) {
25 *out_bytes = fifo_.Write(data, len); 26 *out_bytes = fifo_.Write(data, len);
26 27
27 UpdateStatus_Locked(); 28 UpdateStatus_Locked();
28 return 0; 29 return 0;
29 } 30 }
30 31
31 } // namespace nacl_io 32 } // namespace nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698