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

Side by Side Diff: src/platform/metrics/metrics_library.cc

Issue 1650006: Unify metrics_collection and metrics_daemon into metrics. (Closed)
Patch Set: PTAL -- further cleanup based on the ebuild cleanup. Created 10 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/platform/metrics/metrics_library.h ('k') | src/platform/metrics/network_states.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 /* 5 /*
6 * metrics_library.cc 6 * metrics_library.cc
7 * 7 *
8 * Created on: Dec 1, 2009 8 * Created on: Dec 1, 2009
9 * Author: sosa 9 * Author: sosa
10 */ 10 */
11 11
12 #include "platform/metrics_collection/metrics_library.h" 12 #include "metrics_library.h"
13 13
14 #include <errno.h> 14 #include <errno.h>
15 #include <sys/file.h> 15 #include <sys/file.h>
16 #include <string.h> 16 #include <string.h>
17 #include <stdio.h> 17 #include <stdio.h>
18 18
19 #define READ_WRITE_ALL_FILE_FLAGS \ 19 #define READ_WRITE_ALL_FILE_FLAGS \
20 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) 20 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
21 21
22 static const char kAutotestPath[] = "/tmp/.chromeos-metrics-autotest"; 22 static const char kAutotestPath[] = "/tmp/.chromeos-metrics-autotest";
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 curr_ptr += name.length() + 1; 91 curr_ptr += name.length() + 1;
92 strncpy(curr_ptr, value.c_str(), value.length()); 92 strncpy(curr_ptr, value.c_str(), value.length());
93 if (write(chrome_fd, message, message_length) != message_length) 93 if (write(chrome_fd, message, message_length) != message_length)
94 PrintError("write", kChromePath, errno); 94 PrintError("write", kChromePath, errno);
95 95
96 // Release the file lock and close file 96 // Release the file lock and close file
97 if (flock(chrome_fd, LOCK_UN) < 0) 97 if (flock(chrome_fd, LOCK_UN) < 0)
98 PrintError("unlock", kChromePath, errno); 98 PrintError("unlock", kChromePath, errno);
99 close(chrome_fd); 99 close(chrome_fd);
100 } 100 }
OLDNEW
« no previous file with comments | « src/platform/metrics/metrics_library.h ('k') | src/platform/metrics/network_states.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698