OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cloud_external_data_manager.h" | 5 #include "chrome/browser/policy/cloud/cloud_external_data_manager.h" |
6 | 6 |
7 #include "chrome/browser/policy/cloud/cloud_policy_store.h" | 7 #include "chrome/browser/policy/cloud/cloud_policy_store.h" |
8 #include "net/url_request/url_request_context_getter.h" | 8 #include "net/url_request/url_request_context_getter.h" |
9 | 9 |
10 namespace policy { | 10 namespace policy { |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 CloudExternalDataManager::CloudExternalDataManager() : policy_store_(NULL), | 26 CloudExternalDataManager::CloudExternalDataManager() : policy_store_(NULL), |
27 weak_factory_(this) { | 27 weak_factory_(this) { |
28 } | 28 } |
29 | 29 |
30 CloudExternalDataManager::~CloudExternalDataManager() { | 30 CloudExternalDataManager::~CloudExternalDataManager() { |
31 } | 31 } |
32 | 32 |
33 void CloudExternalDataManager::SetPolicyStore(CloudPolicyStore* policy_store) { | 33 void CloudExternalDataManager::SetPolicyStore(CloudPolicyStore* policy_store) { |
| 34 weak_factory_.InvalidateWeakPtrs(); |
34 policy_store_ = policy_store; | 35 policy_store_ = policy_store; |
35 if (policy_store_) | 36 if (policy_store_) |
36 policy_store_->SetExternalDataManager(weak_factory_.GetWeakPtr()); | 37 policy_store_->SetExternalDataManager(weak_factory_.GetWeakPtr()); |
37 } | 38 } |
38 | 39 |
39 } // namespace policy | 40 } // namespace policy |
OLD | NEW |