| OLD | NEW |
| 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/browser/policy/user_policy_cache.h" | 5 #include "chrome/browser/policy/user_policy_cache.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 DCHECK(CalledOnValidThread()); | 69 DCHECK(CalledOnValidThread()); |
| 70 SetUnmanagedInternal(base::Time::NowFromSystemTime()); | 70 SetUnmanagedInternal(base::Time::NowFromSystemTime()); |
| 71 | 71 |
| 72 em::CachedCloudPolicyResponse cached_policy; | 72 em::CachedCloudPolicyResponse cached_policy; |
| 73 cached_policy.set_unmanaged(true); | 73 cached_policy.set_unmanaged(true); |
| 74 cached_policy.set_timestamp(base::Time::NowFromSystemTime().ToTimeT()); | 74 cached_policy.set_timestamp(base::Time::NowFromSystemTime().ToTimeT()); |
| 75 disk_cache_->Store(cached_policy); | 75 disk_cache_->Store(cached_policy); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void UserPolicyCache::SetFetchingDone() { | 78 void UserPolicyCache::SetFetchingDone() { |
| 79 CloudPolicyCacheBase::SetFetchingDone(); |
| 79 if (!fetch_ready_) | 80 if (!fetch_ready_) |
| 80 DVLOG(1) << "SetFetchingDone, cache is now fetch_ready_"; | 81 DVLOG(1) << "SetFetchingDone, cache is now fetch_ready_"; |
| 81 fetch_ready_ = true; | 82 fetch_ready_ = true; |
| 82 CheckIfReady(); | 83 CheckIfReady(); |
| 83 } | 84 } |
| 84 | 85 |
| 85 void UserPolicyCache::OnDiskCacheLoaded( | 86 void UserPolicyCache::OnDiskCacheLoaded( |
| 86 UserPolicyDiskCache::LoadResult result, | 87 UserPolicyDiskCache::LoadResult result, |
| 87 const em::CachedCloudPolicyResponse& cached_response) { | 88 const em::CachedCloudPolicyResponse& cached_response) { |
| 88 if (IsReady()) | 89 if (IsReady()) |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 return list; | 235 return list; |
| 235 } | 236 } |
| 236 default: | 237 default: |
| 237 NOTREACHED() << "Unhandled value type"; | 238 NOTREACHED() << "Unhandled value type"; |
| 238 } | 239 } |
| 239 | 240 |
| 240 return NULL; | 241 return NULL; |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace policy | 244 } // namespace policy |
| OLD | NEW |