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

Side by Side Diff: headless/app/headless_shell.cc

Issue 2579773003: Use int for fgetc() result in headless_shell (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 #include <sstream> 6 #include <sstream>
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 Shutdown(); 273 Shutdown();
274 } 274 }
275 275
276 void InputExpression() { 276 void InputExpression() {
277 // Note that a real system should read user input asynchronously, because 277 // Note that a real system should read user input asynchronously, because
278 // otherwise all other browser activity is suspended (e.g., page loading). 278 // otherwise all other browser activity is suspended (e.g., page loading).
279 printf(">>> "); 279 printf(">>> ");
280 std::stringstream expression; 280 std::stringstream expression;
281 while (true) { 281 while (true) {
282 char c = fgetc(stdin); 282 int c = fgetc(stdin);
283 if (c == EOF || c == '\n') { 283 if (c == EOF || c == '\n') {
284 break; 284 break;
285 } 285 }
286 expression << c; 286 expression << c;
287 } 287 }
288 if (expression.str() == "quit") { 288 if (expression.str() == "quit") {
289 Shutdown(); 289 Shutdown();
290 return; 290 return;
291 } 291 }
292 devtools_client_->GetRuntime()->Evaluate( 292 devtools_client_->GetRuntime()->Evaluate(
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 } 470 }
471 builder.SetWindowSize(parsed_window_size); 471 builder.SetWindowSize(parsed_window_size);
472 } 472 }
473 473
474 return HeadlessBrowserMain( 474 return HeadlessBrowserMain(
475 builder.Build(), 475 builder.Build(),
476 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell))); 476 base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
477 } 477 }
478 478
479 } // namespace headless 479 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698