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

Side by Side Diff: chrome/browser/diagnostics/recon_diagnostics.cc

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 RecordFailure(DIAG_RECON_FILE_TOO_LARGE, 271 RecordFailure(DIAG_RECON_FILE_TOO_LARGE,
272 "Path contents too large (" + printable_size + ") for: " + 272 "Path contents too large (" + printable_size + ") for: " +
273 UTF16ToUTF8(dir_or_file.LossyDisplayName())); 273 UTF16ToUTF8(dir_or_file.LossyDisplayName()));
274 return true; 274 return true;
275 } 275 }
276 } 276 }
277 if (g_install_type->system_level() && !path_info_.test_writable) { 277 if (g_install_type->system_level() && !path_info_.test_writable) {
278 RecordSuccess("Path exists"); 278 RecordSuccess("Path exists");
279 return true; 279 return true;
280 } 280 }
281 if (!file_util::PathIsWritable(dir_or_file)) { 281 if (!base::PathIsWritable(dir_or_file)) {
282 RecordFailure(DIAG_RECON_NOT_WRITABLE, 282 RecordFailure(DIAG_RECON_NOT_WRITABLE,
283 "Path is not writable: " + 283 "Path is not writable: " +
284 UTF16ToUTF8(dir_or_file.LossyDisplayName())); 284 UTF16ToUTF8(dir_or_file.LossyDisplayName()));
285 return true; 285 return true;
286 } 286 }
287 RecordSuccess("Path exists and is writable: " + printable_size); 287 RecordSuccess("Path exists and is writable: " + printable_size);
288 return true; 288 return true;
289 } 289 }
290 290
291 private: 291 private:
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 DiagnosticsTest* MakeLocalStateTest() { 420 DiagnosticsTest* MakeLocalStateTest() {
421 base::FilePath path; 421 base::FilePath path;
422 PathService::Get(chrome::DIR_USER_DATA, &path); 422 PathService::Get(chrome::DIR_USER_DATA, &path);
423 path = path.Append(chrome::kLocalStateFilename); 423 path = path.Append(chrome::kLocalStateFilename);
424 return new JSONTest( 424 return new JSONTest(
425 path, kJSONLocalStateTest, "Local State JSON", 50 * kOneKilobyte); 425 path, kJSONLocalStateTest, "Local State JSON", 50 * kOneKilobyte);
426 } 426 }
427 427
428 } // namespace diagnostics 428 } // namespace diagnostics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698