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

Unified Diff: chrome/browser/extensions/api/music_manager_private/device_id_linux.cc

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 2 months 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
Index: chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
diff --git a/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc b/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
index 22b55f07f1c2973c475b05baf5e743045eecbc68..bb65b59af659903fa989646d95b94e321e32e7e0 100644
--- a/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
+++ b/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
@@ -28,15 +28,15 @@ typedef base::Callback<bool(const void* bytes, size_t size)>
IsValidMacAddressCallback;
const char kDiskByUuidDirectoryName[] = "/dev/disk/by-uuid";
-const char* kDeviceNames[] = {
+const char* const kDeviceNames[] = {
"sda1", "hda1", "dm-0", "xvda1", "sda2", "hda2", "dm-1", "xvda2",
};
// Fedora 15 uses biosdevname feature where Embedded ethernet uses the
// "em" prefix and PCI cards use the p[0-9]c[0-9] format based on PCI
// slot and card information.
-const char* kNetDeviceNamePrefixes[] = {
- "eth", "em", "en", "wl", "ww", "p0", "p1", "p2", "p3", "p4", "p5", "p6",
- "p7", "p8", "p9", "wlan"
+const char* const kNetDeviceNamePrefixes[] = {
+ "eth", "em", "en", "wl", "ww", "p0", "p1", "p2", "p3", "p4", "p5", "p6",
+ "p7", "p8", "p9", "wlan"
};
// Map from device name to disk uuid
@@ -99,7 +99,7 @@ class MacAddressProcessor {
}
bool ProcessInterface(struct ifaddrs *ifaddr,
- const char* prefixes[],
+ const char* const prefixes[],
size_t prefixes_count) {
const int MAC_LENGTH = 6;
struct ifreq ifinfo;
@@ -132,7 +132,7 @@ class MacAddressProcessor {
private:
bool IsValidPrefix(const char* name,
- const char* prefixes[],
+ const char* const prefixes[],
size_t prefixes_count) {
for (size_t i = 0; i < prefixes_count; i++) {
if (strncmp(prefixes[i], name, strlen(prefixes[i])) == 0)

Powered by Google App Engine
This is Rietveld 408576698