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

Side by Side Diff: components/policy/core/browser/browser_policy_connector.cc

Issue 303393003: Clear g_created_policy_service at BrowserPolicyConnector::Shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/policy/core/browser/browser_policy_connector.h" 5 #include "components/policy/core/browser/browser_policy_connector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 void BrowserPolicyConnector::Shutdown() { 110 void BrowserPolicyConnector::Shutdown() {
111 is_initialized_ = false; 111 is_initialized_ = false;
112 if (g_testing_provider) 112 if (g_testing_provider)
113 g_testing_provider->Shutdown(); 113 g_testing_provider->Shutdown();
114 for (size_t i = 0; i < policy_providers_.size(); ++i) 114 for (size_t i = 0; i < policy_providers_.size(); ++i)
115 policy_providers_[i]->Shutdown(); 115 policy_providers_[i]->Shutdown();
116 // Drop g_testing_provider so that tests executed with --single_process can 116 // Drop g_testing_provider so that tests executed with --single_process can
117 // call SetPolicyProviderForTesting() again. It is still owned by the test. 117 // call SetPolicyProviderForTesting() again. It is still owned by the test.
118 g_testing_provider = NULL; 118 g_testing_provider = NULL;
119 g_created_policy_service = false;
119 device_management_service_.reset(); 120 device_management_service_.reset();
120 } 121 }
121 122
122 PolicyService* BrowserPolicyConnector::GetPolicyService() { 123 PolicyService* BrowserPolicyConnector::GetPolicyService() {
123 if (!policy_service_) { 124 if (!policy_service_) {
124 g_created_policy_service = true; 125 g_created_policy_service = true;
125 std::vector<ConfigurationPolicyProvider*> providers; 126 std::vector<ConfigurationPolicyProvider*> providers;
126 if (g_testing_provider) { 127 if (g_testing_provider) {
127 providers.push_back(g_testing_provider); 128 providers.push_back(g_testing_provider);
128 } else { 129 } else {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 } 230 }
230 231
231 void BrowserPolicyConnector::SetPlatformPolicyProvider( 232 void BrowserPolicyConnector::SetPlatformPolicyProvider(
232 scoped_ptr<ConfigurationPolicyProvider> provider) { 233 scoped_ptr<ConfigurationPolicyProvider> provider) {
233 CHECK(!platform_policy_provider_); 234 CHECK(!platform_policy_provider_);
234 platform_policy_provider_ = provider.get(); 235 platform_policy_provider_ = provider.get();
235 AddPolicyProvider(provider.Pass()); 236 AddPolicyProvider(provider.Pass());
236 } 237 }
237 238
238 } // namespace policy 239 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698