OLD | NEW |
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 #ifndef BASE_LINUX_UTIL_H__ | 5 #ifndef BASE_LINUX_UTIL_H__ |
6 #define BASE_LINUX_UTIL_H__ | 6 #define BASE_LINUX_UTIL_H__ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 | 14 |
| 15 static const char kFindInodeSwitch[] = "--find-inode"; |
| 16 |
15 // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. | 17 // Makes a copy of |pixels| with the ordering changed from BGRA to RGBA. |
16 // The caller is responsible for free()ing the data. If |stride| is 0, | 18 // The caller is responsible for free()ing the data. If |stride| is 0, |
17 // it's assumed to be 4 * |width|. | 19 // it's assumed to be 4 * |width|. |
18 uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); | 20 uint8_t* BGRAToRGBA(const uint8_t* pixels, int width, int height, int stride); |
19 | 21 |
20 // Get the Linux Distro if we can, or return "Unknown", similar to | 22 // Get the Linux Distro if we can, or return "Unknown", similar to |
21 // GetWinVersion() in base/win_util.h. | 23 // GetWinVersion() in base/win_util.h. |
22 std::string GetLinuxDistro(); | 24 std::string GetLinuxDistro(); |
23 | 25 |
24 // These are used to derive mocks for unittests. | 26 // These are used to derive mocks for unittests. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Return the inode number for the UNIX domain socket |fd|. | 59 // Return the inode number for the UNIX domain socket |fd|. |
58 bool FileDescriptorGetInode(ino_t* inode_out, int fd); | 60 bool FileDescriptorGetInode(ino_t* inode_out, int fd); |
59 | 61 |
60 // Find the process which holds the given socket, named by inode number. If | 62 // Find the process which holds the given socket, named by inode number. If |
61 // multiple processes hold the socket, this function returns false. | 63 // multiple processes hold the socket, this function returns false. |
62 bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode); | 64 bool FindProcessHoldingSocket(pid_t* pid_out, ino_t socket_inode); |
63 | 65 |
64 } // namespace base | 66 } // namespace base |
65 | 67 |
66 #endif // BASE_LINUX_UTIL_H__ | 68 #endif // BASE_LINUX_UTIL_H__ |
OLD | NEW |