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

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_store.cc

Issue 16950028: Move file_util::Delete 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/policy/cloud/user_cloud_policy_store.h" 5 #include "chrome/browser/policy/cloud/user_cloud_policy_store.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 "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" 9 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h"
10 #include "chrome/browser/policy/proto/cloud/device_management_local.pb.h" 10 #include "chrome/browser/policy/proto/cloud/device_management_local.pb.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 weak_factory_.InvalidateWeakPtrs(); 115 weak_factory_.InvalidateWeakPtrs();
116 // Load the policy from disk... 116 // Load the policy from disk...
117 PolicyLoadResult result = LoadPolicyFromDisk(backing_file_path_); 117 PolicyLoadResult result = LoadPolicyFromDisk(backing_file_path_);
118 // ...and install it, reporting success/failure to any observers. 118 // ...and install it, reporting success/failure to any observers.
119 PolicyLoaded(false, result); 119 PolicyLoaded(false, result);
120 } 120 }
121 121
122 void UserCloudPolicyStore::Clear() { 122 void UserCloudPolicyStore::Clear() {
123 content::BrowserThread::PostTask( 123 content::BrowserThread::PostTask(
124 content::BrowserThread::FILE, FROM_HERE, 124 content::BrowserThread::FILE, FROM_HERE,
125 base::Bind(base::IgnoreResult(&file_util::Delete), 125 base::Bind(base::IgnoreResult(&base::Delete),
126 backing_file_path_, 126 backing_file_path_,
127 false)); 127 false));
128 policy_.reset(); 128 policy_.reset();
129 policy_map_.Clear(); 129 policy_map_.Clear();
130 NotifyStoreLoaded(); 130 NotifyStoreLoaded();
131 } 131 }
132 132
133 void UserCloudPolicyStore::Load() { 133 void UserCloudPolicyStore::Load() {
134 DVLOG(1) << "Initiating policy load from disk"; 134 DVLOG(1) << "Initiating policy load from disk";
135 // Cancel any pending Load/Store/Validate operations. 135 // Cancel any pending Load/Store/Validate operations.
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 content::BrowserThread::PostTask( 250 content::BrowserThread::PostTask(
251 content::BrowserThread::FILE, FROM_HERE, 251 content::BrowserThread::FILE, FROM_HERE,
252 base::Bind(&StorePolicyToDiskOnFileThread, 252 base::Bind(&StorePolicyToDiskOnFileThread,
253 backing_file_path_, *validator->policy())); 253 backing_file_path_, *validator->policy()));
254 InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass()); 254 InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
255 status_ = STATUS_OK; 255 status_ = STATUS_OK;
256 NotifyStoreLoaded(); 256 NotifyStoreLoaded();
257 } 257 }
258 258
259 } // namespace policy 259 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/cloud/resource_cache.cc ('k') | chrome/browser/printing/print_dialog_cloud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698