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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc

Issue 66343004: [NaCl SDK] ppapi_simple: Allow initial terminal size to to be set on startup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | native_client_sdk/src/libraries/ppapi_simple/ps_instance.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 (c) 2013 The Chromium Authors. All rights reserved. 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 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/mount_node_tty.h" 5 #include "nacl_io/mount_node_tty.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <signal.h> 9 #include <signal.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 // This ioctl is used to deliver data from the user to this tty node's 250 // This ioctl is used to deliver data from the user to this tty node's
251 // input buffer. 251 // input buffer.
252 struct tioc_nacl_input_string* message = 252 struct tioc_nacl_input_string* message =
253 va_arg(args, struct tioc_nacl_input_string*); 253 va_arg(args, struct tioc_nacl_input_string*);
254 return ProcessInput(message); 254 return ProcessInput(message);
255 } 255 }
256 case TIOCSWINSZ: { 256 case TIOCSWINSZ: {
257 struct winsize* size = va_arg(args, struct winsize*); 257 struct winsize* size = va_arg(args, struct winsize*);
258 { 258 {
259 AUTO_LOCK(node_lock_); 259 AUTO_LOCK(node_lock_);
260 if (rows_ == size->ws_row && cols_ == size->ws_col)
261 return 0;
260 rows_ = size->ws_row; 262 rows_ = size->ws_row;
261 cols_ = size->ws_col; 263 cols_ = size->ws_col;
262 } 264 }
263 kill(getpid(), SIGWINCH); 265 kill(getpid(), SIGWINCH);
264 { 266 {
265 // Wake up any thread waiting on Read with POLLERR then immediate 267 // Wake up any thread waiting on Read with POLLERR then immediate
266 // clear it to signal EINTR. 268 // clear it to signal EINTR.
267 AUTO_LOCK(emitter_->GetLock()) 269 AUTO_LOCK(emitter_->GetLock())
268 emitter_->RaiseEvents_Locked(POLLERR); 270 emitter_->RaiseEvents_Locked(POLLERR);
269 emitter_->ClearEvents_Locked(POLLERR); 271 emitter_->ClearEvents_Locked(POLLERR);
(...skipping 18 matching lines...) Expand all
288 } 290 }
289 291
290 Error MountNodeTty::Tcsetattr(int optional_actions, 292 Error MountNodeTty::Tcsetattr(int optional_actions,
291 const struct termios *termios_p) { 293 const struct termios *termios_p) {
292 AUTO_LOCK(node_lock_); 294 AUTO_LOCK(node_lock_);
293 termios_ = *termios_p; 295 termios_ = *termios_p;
294 return 0; 296 return 0;
295 } 297 }
296 298
297 } 299 }
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/ppapi_simple/ps_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698