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

Unified Diff: remoting/base/util.cc

Issue 112353002: Move remoting::GetUsername() from remoting/base to remoting/host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/util.h ('k') | remoting/host/pam_authorization_factory_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/util.cc
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index d27b651e4f2fb555f207a9945b9c392467daf8b5..8102cb9bf5bdd7b3c1f3b8c6591f9619b0c3955f 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -14,12 +14,6 @@
#include "third_party/libyuv/include/libyuv/convert.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
-#if defined(OS_POSIX)
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#endif // defined(OS_POSIX)
-
using media::VideoFrame;
namespace remoting {
@@ -313,25 +307,6 @@ bool StringIsUtf8(const char* data, size_t length) {
return true;
}
-std::string GetUsername() {
-#if defined(OS_ANDROID)
- struct passwd* passwd = getpwuid(getuid());
- return passwd ? passwd->pw_name : std::string();
-#elif defined(OS_POSIX)
- long buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
- if (buf_size <= 0)
- return std::string();
-
- scoped_ptr<char[]> buf(new char[buf_size]);
- struct passwd passwd;
- struct passwd* passwd_result = NULL;
- getpwuid_r(getuid(), &passwd, buf.get(), buf_size, &passwd_result);
- return passwd_result ? passwd_result->pw_name : std::string();
-#else // !defined(OS_POSIX)
- return std::string();
-#endif // defined(OS_POSIX)
-}
-
bool DoesRectContain(const webrtc::DesktopRect& a,
const webrtc::DesktopRect& b) {
webrtc::DesktopRect intersection(a);
« no previous file with comments | « remoting/base/util.h ('k') | remoting/host/pam_authorization_factory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698