OLD | NEW |
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/settings/device_settings_service.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_service.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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 session_manager_client_->AddObserver(this); | 78 session_manager_client_->AddObserver(this); |
79 | 79 |
80 StartNextOperation(); | 80 StartNextOperation(); |
81 } | 81 } |
82 | 82 |
83 void DeviceSettingsService::Shutdown() { | 83 void DeviceSettingsService::Shutdown() { |
84 STLDeleteContainerPointers(pending_operations_.begin(), | 84 STLDeleteContainerPointers(pending_operations_.begin(), |
85 pending_operations_.end()); | 85 pending_operations_.end()); |
86 pending_operations_.clear(); | 86 pending_operations_.clear(); |
87 | 87 |
88 session_manager_client_->RemoveObserver(this); | 88 if (session_manager_client_) |
| 89 session_manager_client_->RemoveObserver(this); |
89 session_manager_client_ = NULL; | 90 session_manager_client_ = NULL; |
90 owner_key_util_ = NULL; | 91 owner_key_util_ = NULL; |
91 } | 92 } |
92 | 93 |
93 scoped_refptr<OwnerKey> DeviceSettingsService::GetOwnerKey() { | 94 scoped_refptr<OwnerKey> DeviceSettingsService::GetOwnerKey() { |
94 return owner_key_; | 95 return owner_key_; |
95 } | 96 } |
96 | 97 |
97 void DeviceSettingsService::Load() { | 98 void DeviceSettingsService::Load() { |
98 EnqueueLoad(false); | 99 EnqueueLoad(false); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 292 |
292 // Only remove the pending operation here, so new operations triggered by any | 293 // Only remove the pending operation here, so new operations triggered by any |
293 // of the callbacks above are queued up properly. | 294 // of the callbacks above are queued up properly. |
294 pending_operations_.pop_front(); | 295 pending_operations_.pop_front(); |
295 delete operation; | 296 delete operation; |
296 | 297 |
297 StartNextOperation(); | 298 StartNextOperation(); |
298 } | 299 } |
299 | 300 |
300 } // namespace chromeos | 301 } // namespace chromeos |
OLD | NEW |