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

Side by Side Diff: chrome/browser/chromeos/pipe_reader.cc

Issue 341044: Move chromeos code to namespace chromeos. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/chromeos/pipe_reader.h" 5 #include "chrome/browser/chromeos/pipe_reader.h"
6 6
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 8
9 namespace chromeos {
10
9 std::string PipeReader::Read(const uint32 bytes_to_read) { 11 std::string PipeReader::Read(const uint32 bytes_to_read) {
10 scoped_array<char> buffer(new char[bytes_to_read]); 12 scoped_array<char> buffer(new char[bytes_to_read]);
11 if (pipe_ || (pipe_ = fopen(pipe_name_.c_str(), "r"))) { 13 if (pipe_ || (pipe_ = fopen(pipe_name_.c_str(), "r"))) {
12 const char* to_return = fgets(buffer.get(), bytes_to_read, pipe_); 14 const char* to_return = fgets(buffer.get(), bytes_to_read, pipe_);
13 if (to_return) 15 if (to_return)
14 return to_return; // auto-coerced to a std::string. 16 return to_return; // auto-coerced to a std::string.
15 } 17 }
16 return std::string(); 18 return std::string();
17 } 19 }
20
21 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698