Remove MessageLoop::DestructionObserver registration from ConfigurationPolicyLoaderWin

BUG=69193
TEST=No direct test; watch crash reports to see if the crash that's supposed to be fixed by this still occurs.

Review URL: http://codereview.chromium.org/6316003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71636 0039d316-1c4b-4281-b951-d872f2087c98
parent 42c50aba
// 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.
......@@ -31,13 +31,11 @@ ConfigurationPolicyLoaderWin::ConfigurationPolicyLoaderWin(
void ConfigurationPolicyLoaderWin::InitOnFileThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
AsynchronousPolicyLoader::InitOnFileThread();
MessageLoop::current()->AddDestructionObserver(this);
SetupWatches();
}
void ConfigurationPolicyLoaderWin::StopOnFileThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
MessageLoop::current()->RemoveDestructionObserver(this);
user_policy_watcher_.StopWatching();
machine_policy_watcher_.StopWatching();
AsynchronousPolicyLoader::StopOnFileThread();
......@@ -81,10 +79,4 @@ void ConfigurationPolicyLoaderWin::OnObjectSignaled(HANDLE object) {
Reload();
}
void ConfigurationPolicyLoaderWin::
WillDestroyCurrentMessageLoop() {
CancelReloadTask();
MessageLoop::current()->RemoveDestructionObserver(this);
}
} // namespace policy
// 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.
......@@ -16,8 +16,7 @@ namespace policy {
// reload when Group Policy changes.
class ConfigurationPolicyLoaderWin
: public AsynchronousPolicyLoader,
public base::win::ObjectWatcher::Delegate,
public MessageLoop::DestructionObserver {
public base::win::ObjectWatcher::Delegate {
public:
ConfigurationPolicyLoaderWin(
AsynchronousPolicyProvider::Delegate* delegate,
......@@ -39,9 +38,6 @@ class ConfigurationPolicyLoaderWin
// ObjectWatcher::Delegate overrides:
virtual void OnObjectSignaled(HANDLE object);
// MessageLoop::DestructionObserver overrides:
virtual void WillDestroyCurrentMessageLoop();
base::WaitableEvent user_policy_changed_event_;
base::WaitableEvent machine_policy_changed_event_;
base::win::ObjectWatcher user_policy_watcher_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment