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

Side by Side Diff: chrome/browser/policy/configuration_policy_loader_win.cc

Issue 6316003: Remove MessageLoop::DestructionObserver registration from ConfigurationPolicyLoaderWin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compilation Created 9 years, 11 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 | « chrome/browser/policy/configuration_policy_loader_win.h ('k') | 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/configuration_policy_loader_win.h" 5 #include "chrome/browser/policy/configuration_policy_loader_win.h"
6 6
7 #include <userenv.h> 7 #include <userenv.h>
8 8
9 #include "chrome/browser/browser_thread.h" 9 #include "chrome/browser/browser_thread.h"
10 10
11 namespace policy { 11 namespace policy {
(...skipping 12 matching lines...) Expand all
24 } 24 }
25 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) { 25 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) {
26 PLOG(WARNING) << "Failed to register machine group policy notification."; 26 PLOG(WARNING) << "Failed to register machine group policy notification.";
27 machine_policy_watcher_failed_ = true; 27 machine_policy_watcher_failed_ = true;
28 } 28 }
29 } 29 }
30 30
31 void ConfigurationPolicyLoaderWin::InitOnFileThread() { 31 void ConfigurationPolicyLoaderWin::InitOnFileThread() {
32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 32 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
33 AsynchronousPolicyLoader::InitOnFileThread(); 33 AsynchronousPolicyLoader::InitOnFileThread();
34 MessageLoop::current()->AddDestructionObserver(this);
35 SetupWatches(); 34 SetupWatches();
36 } 35 }
37 36
38 void ConfigurationPolicyLoaderWin::StopOnFileThread() { 37 void ConfigurationPolicyLoaderWin::StopOnFileThread() {
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
40 MessageLoop::current()->RemoveDestructionObserver(this);
41 user_policy_watcher_.StopWatching(); 39 user_policy_watcher_.StopWatching();
42 machine_policy_watcher_.StopWatching(); 40 machine_policy_watcher_.StopWatching();
43 AsynchronousPolicyLoader::StopOnFileThread(); 41 AsynchronousPolicyLoader::StopOnFileThread();
44 } 42 }
45 43
46 void ConfigurationPolicyLoaderWin::SetupWatches() { 44 void ConfigurationPolicyLoaderWin::SetupWatches() {
47 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
48 CancelReloadTask(); 46 CancelReloadTask();
49 47
50 if (!user_policy_watcher_failed_ && 48 if (!user_policy_watcher_failed_ &&
(...skipping 23 matching lines...) Expand all
74 72
75 void ConfigurationPolicyLoaderWin::OnObjectSignaled(HANDLE object) { 73 void ConfigurationPolicyLoaderWin::OnObjectSignaled(HANDLE object) {
76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
77 DCHECK(object == user_policy_changed_event_.handle() || 75 DCHECK(object == user_policy_changed_event_.handle() ||
78 object == machine_policy_changed_event_.handle()) 76 object == machine_policy_changed_event_.handle())
79 << "unexpected object signaled policy reload, obj = " 77 << "unexpected object signaled policy reload, obj = "
80 << std::showbase << std::hex << object; 78 << std::showbase << std::hex << object;
81 Reload(); 79 Reload();
82 } 80 }
83 81
84 void ConfigurationPolicyLoaderWin::
85 WillDestroyCurrentMessageLoop() {
86 CancelReloadTask();
87 MessageLoop::current()->RemoveDestructionObserver(this);
88 }
89
90 } // namespace policy 82 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_loader_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698