OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/metrics/chromeos/serialization_utils.h" | 5 #include "components/metrics/serialization/serialization_utils.h" |
6 | 6 |
7 #include <sys/file.h> | 7 #include <sys/file.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/files/scoped_file.h" | 14 #include "base/files/scoped_file.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
18 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "components/metrics/chromeos/metric_sample.h" | 20 #include "components/metrics/serialization/metric_sample.h" |
21 | 21 |
22 #define READ_WRITE_ALL_FILE_FLAGS \ | 22 #define READ_WRITE_ALL_FILE_FLAGS \ |
23 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) | 23 (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
24 | 24 |
25 namespace metrics { | 25 namespace metrics { |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Reads the next message from |file_descriptor| into |message|. | 28 // Reads the next message from |file_descriptor| into |message|. |
29 // | 29 // |
30 // |message| will be set to the empty string if no message could be read (EOF) | 30 // |message| will be set to the empty string if no message could be read (EOF) |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 file_descriptor.get(), msg.c_str(), msg.length()) != | 207 file_descriptor.get(), msg.c_str(), msg.length()) != |
208 static_cast<int>(msg.length())) { | 208 static_cast<int>(msg.length())) { |
209 DLOG(ERROR) << "error writing message" << errno; | 209 DLOG(ERROR) << "error writing message" << errno; |
210 return false; | 210 return false; |
211 } | 211 } |
212 | 212 |
213 return true; | 213 return true; |
214 } | 214 } |
215 | 215 |
216 } // namespace metrics | 216 } // namespace metrics |
OLD | NEW |