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

Unified Diff: chrome/browser/policy/user_policy_disk_cache.h

Issue 12189011: Split up chrome/browser/policy subdirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, add chrome/browser/chromeos/policy/OWNERS Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/user_policy_disk_cache.h
diff --git a/chrome/browser/policy/user_policy_disk_cache.h b/chrome/browser/policy/user_policy_disk_cache.h
deleted file mode 100644
index 81466ef79f3bfacdb6370d5ea499b3839a66e0e7..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/user_policy_disk_cache.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_POLICY_USER_POLICY_DISK_CACHE_H_
-#define CHROME_BROWSER_POLICY_USER_POLICY_DISK_CACHE_H_
-
-#include "base/basictypes.h"
-#include "base/files/file_path.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-
-namespace enterprise_management {
-class CachedCloudPolicyResponse;
-}
-
-namespace policy {
-
-// Handles the on-disk cache file used by UserPolicyCache. This class handles
-// the necessary thread switching and may outlive the associated UserPolicyCache
-// instance.
-class UserPolicyDiskCache
- : public base::RefCountedThreadSafe<UserPolicyDiskCache> {
- public:
- // Indicates the status of a completed load operation.
- enum LoadResult {
- // Policy was loaded successfully.
- LOAD_RESULT_SUCCESS,
- // Cache file missing.
- LOAD_RESULT_NOT_FOUND,
- // Failed to read cache file.
- LOAD_RESULT_READ_ERROR,
- // Failed to parse cache file.
- LOAD_RESULT_PARSE_ERROR,
- };
-
- // Delegate interface for observing loads operations.
- class Delegate {
- public:
- virtual ~Delegate();
- virtual void OnDiskCacheLoaded(
- LoadResult result,
- const enterprise_management::CachedCloudPolicyResponse& policy) = 0;
- };
-
- UserPolicyDiskCache(const base::WeakPtr<Delegate>& delegate,
- const base::FilePath& backing_file_path);
-
- // Starts reading the policy cache from disk. Passes the read policy
- // information back to the hosting UserPolicyCache after a successful cache
- // load through UserPolicyCache::OnDiskCacheLoaded().
- void Load();
-
- // Triggers a write operation to the disk cache on the FILE thread.
- void Store(const enterprise_management::CachedCloudPolicyResponse& policy);
-
- private:
- friend class base::RefCountedThreadSafe<UserPolicyDiskCache>;
- ~UserPolicyDiskCache();
-
- // Tries to load the cache file on the FILE thread.
- void LoadOnFileThread();
-
- // Forwards the result to the UI thread.
- void LoadDone(LoadResult result,
- const enterprise_management::CachedCloudPolicyResponse& policy);
-
- // Passes back the successfully read policy to the cache on the UI thread.
- void ReportResultOnUIThread(
- LoadResult result,
- const enterprise_management::CachedCloudPolicyResponse& policy);
-
- // Saves a policy blob on the FILE thread.
- void StoreOnFileThread(
- const enterprise_management::CachedCloudPolicyResponse& policy);
-
- base::WeakPtr<Delegate> delegate_;
- const base::FilePath backing_file_path_;
-
- DISALLOW_COPY_AND_ASSIGN(UserPolicyDiskCache);
-};
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_USER_POLICY_DISK_CACHE_H_
« no previous file with comments | « chrome/browser/policy/user_info_fetcher_unittest.cc ('k') | chrome/browser/policy/user_policy_disk_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698