]> git.pld-linux.org Git - packages/chromium-browser.git/blame - sync-session-name.patch
update test compile patch from https://codereview.chromium.org/14813020/
[packages/chromium-browser.git] / sync-session-name.patch
CommitLineData
06e6d11b 1https://code.google.com/p/chromium/issues/detail?id=123827
effb85eb
ER
2
3Index: sync/sync_core.gypi
4===================================================================
5--- sync/sync_core.gypi (revision 198703)
6+++ sync/sync_core.gypi (revision 198704)
7@@ -181,6 +181,8 @@
8 'util/get_session_name.h',
9 'util/get_session_name_ios.mm',
10 'util/get_session_name_ios.h',
11+ 'util/get_session_name_linux.cc',
12+ 'util/get_session_name_linux.h',
13 'util/get_session_name_mac.mm',
14 'util/get_session_name_mac.h',
15 'util/get_session_name_win.cc',
16Index: sync/util/get_session_name_linux.h
17===================================================================
18--- sync/util/get_session_name_linux.h (revision 0)
19+++ sync/util/get_session_name_linux.h (revision 198704)
20@@ -0,0 +1,19 @@
21+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
22+// Use of this source code is governed by a BSD-style license that can be
23+// found in the LICENSE file.
24+
25+#ifndef SYNC_UTIL_GET_SESSION_NAME_LINUX_H_
26+#define SYNC_UTIL_GET_SESSION_NAME_LINUX_H_
27+
28+#include <string>
29+
30+namespace syncer {
31+namespace internal {
32+
33+std::string GetHostname();
34+
35+} // namespace internal
36+} // namespace syncer
37+
38+#endif // SYNC_UTIL_GET_SESSION_NAME_LINUX_H_
39+
40
41Property changes on: sync/util/get_session_name_linux.h
42___________________________________________________________________
43Added: svn:eol-style
44## -0,0 +1 ##
45+LF
46\ No newline at end of property
47Index: sync/util/get_session_name.cc
48===================================================================
49--- sync/util/get_session_name.cc (revision 198703)
50+++ sync/util/get_session_name.cc (revision 198704)
51@@ -15,7 +15,7 @@
52 #include "base/command_line.h"
53 #include "chromeos/chromeos_switches.h"
54 #elif defined(OS_LINUX)
55-#include "base/linux_util.h"
56+#include "sync/util/get_session_name_linux.h"
57 #elif defined(OS_IOS)
58 #include "sync/util/get_session_name_ios.h"
59 #elif defined(OS_MACOSX)
60@@ -60,7 +60,7 @@
06e6d11b
ER
61 // "CHROMEOS_RELEASE_BOARD" line in chrome://system.
62 session_name = board.substr(0, 6) == "stumpy" ? "Chromebox" : "Chromebook";
63 #elif defined(OS_LINUX)
64- session_name = base::GetLinuxDistro();
effb85eb 65+ session_name = internal::GetHostname();
06e6d11b
ER
66 #elif defined(OS_IOS)
67 session_name = internal::GetComputerName();
68 #elif defined(OS_MACOSX)
effb85eb
ER
69Index: sync/util/get_session_name_linux.cc
70===================================================================
71--- sync/util/get_session_name_linux.cc (revision 0)
72+++ sync/util/get_session_name_linux.cc (revision 198704)
73@@ -0,0 +1,24 @@
74+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
75+// Use of this source code is governed by a BSD-style license that can be
76+// found in the LICENSE file.
77+
78+#include "sync/util/get_session_name_linux.h"
79+
80+#include <limits.h> // for HOST_NAME_MAX
81+#include <unistd.h> // for gethostname()
82+
83+#include "base/linux_util.h"
84+
85+namespace syncer {
86+namespace internal {
87+
88+std::string GetHostname() {
89+ char hostname[HOST_NAME_MAX];
90+ if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success.
91+ return hostname;
92+ return base::GetLinuxDistro();
93+}
94+
95+} // namespace internal
96+} // namespace syncer
97+
98
99Property changes on: sync/util/get_session_name_linux.cc
100___________________________________________________________________
101Added: svn:eol-style
102## -0,0 +1 ##
103+LF
104\ No newline at end of property
This page took 0.042983 seconds and 4 git commands to generate.