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

Side by Side Diff: chrome/browser/google/google_update_settings_posix.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/installer/util/google_update_settings.h" 5 #include "chrome/installer/util/google_update_settings.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 30 matching lines...) Expand all
41 if (!base::DirectoryExists(consent_dir)) 41 if (!base::DirectoryExists(consent_dir))
42 return false; 42 return false;
43 43
44 base::FilePath consent_file = consent_dir.AppendASCII(kConsentToSendStats); 44 base::FilePath consent_file = consent_dir.AppendASCII(kConsentToSendStats);
45 if (consented) { 45 if (consented) {
46 if ((!base::PathExists(consent_file)) || 46 if ((!base::PathExists(consent_file)) ||
47 (base::PathExists(consent_file) && 47 (base::PathExists(consent_file) &&
48 !google_update::posix_guid().empty())) { 48 !google_update::posix_guid().empty())) {
49 const char* c_str = google_update::posix_guid().c_str(); 49 const char* c_str = google_update::posix_guid().c_str();
50 int size = google_update::posix_guid().size(); 50 int size = google_update::posix_guid().size();
51 return file_util::WriteFile(consent_file, c_str, size) == size; 51 return base::WriteFile(consent_file, c_str, size) == size;
52 } 52 }
53 } else { 53 } else {
54 google_update::posix_guid().clear(); 54 google_update::posix_guid().clear();
55 return base::DeleteFile(consent_file, false); 55 return base::DeleteFile(consent_file, false);
56 } 56 }
57 return true; 57 return true;
58 } 58 }
59 59
60 // static 60 // static
61 bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) { 61 bool GoogleUpdateSettings::GetMetricsId(std::string* metrics_id) {
(...skipping 22 matching lines...) Expand all
84 84
85 // static 85 // static
86 int GoogleUpdateSettings::GetLastRunTime() { 86 int GoogleUpdateSettings::GetLastRunTime() {
87 return -1; 87 return -1;
88 } 88 }
89 89
90 // static 90 // static
91 bool GoogleUpdateSettings::SetLastRunTime() { 91 bool GoogleUpdateSettings::SetLastRunTime() {
92 return false; 92 return false;
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run/first_run_internal_win.cc ('k') | chrome/browser/history/history_backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698