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

Side by Side Diff: chrome/browser/chromeos/policy/user_policy_disk_cache.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) 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/chromeos/policy/user_policy_disk_cache.h" 5 #include "chrome/browser/chromeos/policy/user_policy_disk_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (!base::CreateDirectory(backing_file_path_.DirName())) { 124 if (!base::CreateDirectory(backing_file_path_.DirName())) {
125 LOG(WARNING) << "Failed to create directory " 125 LOG(WARNING) << "Failed to create directory "
126 << backing_file_path_.DirName().value(); 126 << backing_file_path_.DirName().value();
127 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy, 127 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy,
128 kMetricPolicyStoreFailed, 128 kMetricPolicyStoreFailed,
129 policy::kMetricPolicySize); 129 policy::kMetricPolicySize);
130 return; 130 return;
131 } 131 }
132 132
133 int size = data.size(); 133 int size = data.size();
134 if (file_util::WriteFile(backing_file_path_, data.c_str(), size) != size) { 134 if (base::WriteFile(backing_file_path_, data.c_str(), size) != size) {
135 LOG(WARNING) << "Failed to write " << backing_file_path_.value(); 135 LOG(WARNING) << "Failed to write " << backing_file_path_.value();
136 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy, 136 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy,
137 kMetricPolicyStoreFailed, 137 kMetricPolicyStoreFailed,
138 policy::kMetricPolicySize); 138 policy::kMetricPolicySize);
139 return; 139 return;
140 } 140 }
141 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy, 141 UMA_HISTOGRAM_ENUMERATION(policy::kMetricPolicy,
142 kMetricPolicyStoreSucceeded, 142 kMetricPolicyStoreSucceeded,
143 policy::kMetricPolicySize); 143 policy::kMetricPolicySize);
144 } 144 }
145 145
146 } // namespace policy 146 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698