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

Unified Diff: components/policy/core/common/cloud/user_cloud_policy_store.cc

Issue 1719983005: base: Stop overloading ReadFileToString() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix errors Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/accelerometer/accelerometer_reader.cc ('k') | components/tracing/trace_config_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/cloud/user_cloud_policy_store.cc
diff --git a/components/policy/core/common/cloud/user_cloud_policy_store.cc b/components/policy/core/common/cloud/user_cloud_policy_store.cc
index 9240d06ec0823f82a88770e12902da06c2c15248..6df361975d4f4f708f4e39b89d6c12abc6e82191 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_store.cc
@@ -86,7 +86,8 @@ policy::PolicyLoadResult LoadPolicyFromDisk(
}
std::string data;
- if (!base::ReadFileToString(policy_path, &data, kPolicySizeLimit) ||
+ if (!base::ReadFileToStringWithMaxSize(policy_path, &data,
+ kPolicySizeLimit) ||
!result.policy.ParseFromString(data)) {
LOG(WARNING) << "Failed to read or parse policy data from "
<< policy_path.value();
@@ -94,7 +95,7 @@ policy::PolicyLoadResult LoadPolicyFromDisk(
return result;
}
- if (!base::ReadFileToString(key_path, &data, kKeySizeLimit) ||
+ if (!base::ReadFileToStringWithMaxSize(key_path, &data, kKeySizeLimit) ||
!result.key.ParseFromString(data)) {
// Log an error on missing key data, but do not trigger a load failure
// for now since there are still old unsigned cached policy blobs in the
« no previous file with comments | « chromeos/accelerometer/accelerometer_reader.cc ('k') | components/tracing/trace_config_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698