OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/default_plugin/plugin_install_job_monitor.h" | 5 #include "chrome/default_plugin/plugin_install_job_monitor.h" |
6 | 6 |
7 #include "base/logging.h" | |
8 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
9 #include "chrome/default_plugin/plugin_impl.h" | 8 #include "chrome/default_plugin/plugin_impl.h" |
10 | 9 |
11 PluginInstallationJobMonitorThread::PluginInstallationJobMonitorThread() | 10 PluginInstallationJobMonitorThread::PluginInstallationJobMonitorThread() |
12 : Thread("Chrome plugin install thread"), | 11 : Thread("Chrome plugin install thread"), |
13 install_job_completion_port_(NULL), | 12 install_job_completion_port_(NULL), |
14 stop_job_monitoring_(false), | 13 stop_job_monitoring_(false), |
15 plugin_window_(NULL), | 14 plugin_window_(NULL), |
16 install_job_(NULL) { | 15 install_job_(NULL) { |
17 } | 16 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void PluginInstallationJobMonitorThread::Stop() { | 92 void PluginInstallationJobMonitorThread::Stop() { |
94 stop_job_monitoring_ = true; | 93 stop_job_monitoring_ = true; |
95 ::PostQueuedCompletionStatus( | 94 ::PostQueuedCompletionStatus( |
96 install_job_completion_port_, JOB_OBJECT_MSG_END_OF_JOB_TIME, | 95 install_job_completion_port_, JOB_OBJECT_MSG_END_OF_JOB_TIME, |
97 reinterpret_cast<ULONG_PTR>(install_job_), NULL); | 96 reinterpret_cast<ULONG_PTR>(install_job_), NULL); |
98 Thread::Stop(); | 97 Thread::Stop(); |
99 ::CloseHandle(install_job_completion_port_); | 98 ::CloseHandle(install_job_completion_port_); |
100 install_job_completion_port_ = NULL; | 99 install_job_completion_port_ = NULL; |
101 } | 100 } |
102 | 101 |
103 void PluginInstallationJobMonitorThread::set_plugin_window(HWND plugin_window) { | |
104 DCHECK(::IsWindow(plugin_window)); | |
105 plugin_window_ = plugin_window; | |
106 } | |
107 | |
108 bool PluginInstallationJobMonitorThread::AssignProcessToJob( | 102 bool PluginInstallationJobMonitorThread::AssignProcessToJob( |
109 HANDLE process_handle) { | 103 HANDLE process_handle) { |
110 BOOL result = AssignProcessToJobObject(install_job_, process_handle); | 104 BOOL result = AssignProcessToJobObject(install_job_, process_handle); |
111 return result ? true : false; | 105 return result ? true : false; |
112 } | 106 } |
OLD | NEW |