OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/diagnostics/recon_diagnostics.h" | 5 #include "chrome/browser/diagnostics/recon_diagnostics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 return false; | 236 return false; |
237 } | 237 } |
238 if (!file_util::PathExists(dir_or_file)) { | 238 if (!file_util::PathExists(dir_or_file)) { |
239 RecordFailure(ASCIIToUTF16("Path not found: ") + | 239 RecordFailure(ASCIIToUTF16("Path not found: ") + |
240 dir_or_file.LossyDisplayName()); | 240 dir_or_file.LossyDisplayName()); |
241 return true; | 241 return true; |
242 } | 242 } |
243 | 243 |
244 int64 dir_or_file_size = 0; | 244 int64 dir_or_file_size = 0; |
245 if (path_info_.is_directory) { | 245 if (path_info_.is_directory) { |
246 dir_or_file_size = file_util::ComputeDirectorySize(dir_or_file); | 246 dir_or_file_size = base::ComputeDirectorySize(dir_or_file); |
247 } else { | 247 } else { |
248 file_util::GetFileSize(dir_or_file, &dir_or_file_size); | 248 file_util::GetFileSize(dir_or_file, &dir_or_file_size); |
249 } | 249 } |
250 if (!dir_or_file_size && !path_info_.is_optional) { | 250 if (!dir_or_file_size && !path_info_.is_optional) { |
251 RecordFailure(ASCIIToUTF16("Cannot obtain size for: ") + | 251 RecordFailure(ASCIIToUTF16("Cannot obtain size for: ") + |
252 dir_or_file.LossyDisplayName()); | 252 dir_or_file.LossyDisplayName()); |
253 return true; | 253 return true; |
254 } | 254 } |
255 string16 printable_size = ui::FormatBytes(dir_or_file_size); | 255 string16 printable_size = ui::FormatBytes(dir_or_file_size); |
256 | 256 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 path = path.Append(chrome::kBookmarksFileName); | 417 path = path.Append(chrome::kBookmarksFileName); |
418 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); | 418 return new JSONTest(path, ASCIIToUTF16("BookMarks JSON"), 2 * kOneMeg); |
419 } | 419 } |
420 | 420 |
421 DiagnosticTest* MakeLocalStateTest() { | 421 DiagnosticTest* MakeLocalStateTest() { |
422 base::FilePath path; | 422 base::FilePath path; |
423 PathService::Get(chrome::DIR_USER_DATA, &path); | 423 PathService::Get(chrome::DIR_USER_DATA, &path); |
424 path = path.Append(chrome::kLocalStateFilename); | 424 path = path.Append(chrome::kLocalStateFilename); |
425 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); | 425 return new JSONTest(path, ASCIIToUTF16("Local State JSON"), 50 * kOneKilo); |
426 } | 426 } |
OLD | NEW |