summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
diff options
context:
space:
mode:
authorjkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-05 09:38:07 +0000
committerjkummerow@chromium.org <jkummerow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-05 09:38:07 +0000
commitf2a893c2215a31a99e95b25b2f93000fdefc7a5b (patch)
treebf7ec4f5f964a45bb7c9aa0ea09e301f7cb30d2d /chrome/browser/policy/asynchronous_policy_loader_unittest.cc
parent3ab9898b32d19cada0c583d6deb1206c4e680dd7 (diff)
downloadchromium_src-f2a893c2215a31a99e95b25b2f93000fdefc7a5b.zip
chromium_src-f2a893c2215a31a99e95b25b2f93000fdefc7a5b.tar.gz
chromium_src-f2a893c2215a31a99e95b25b2f93000fdefc7a5b.tar.bz2
Lifecycle management for PolicyProviders
The ConfigurationPolicyProviderKeeper (and therefore the individual ConfigurationPolicyProviders) is now a member variable of the BrowserProcess instead of a singleton. This fixes memory leaks at the cost of slightly more complicated shutdown (the PolicyProviders must die while the file thread is still alive, but the preference system observing the providers for policy changes lives longer than that). BUG=66054, 66102 TEST=existing unit tests; valgrind Review URL: http://codereview.chromium.org/5962016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/asynchronous_policy_loader_unittest.cc')
-rw-r--r--chrome/browser/policy/asynchronous_policy_loader_unittest.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/policy/asynchronous_policy_loader_unittest.cc b/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
index 3cc416c..44ab3c2 100644
--- a/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
+++ b/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -18,6 +18,7 @@ class MockConfigurationPolicyObserver
: public ConfigurationPolicyProvider::Observer {
public:
MOCK_METHOD0(OnUpdatePolicy, void());
+ void OnProviderGoingAway() {}
};
class AsynchronousPolicyLoaderTest : public AsynchronousPolicyTestBase {
@@ -120,8 +121,7 @@ TEST_F(AsynchronousPolicyLoaderTest, ProviderNotificationOnPolicyChange) {
AsynchronousPolicyProvider provider(NULL, loader);
// |registrar| must be declared last so that it is destroyed first.
ConfigurationPolicyObserverRegistrar registrar;
- registrar.Init(&provider);
- registrar.AddObserver(&observer);
+ registrar.Init(&provider, &observer);
loop_.RunAllPending();
loader->Reload();
loop_.RunAllPending();