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

Side by Side Diff: chrome/default_plugin/plugin_install_job_monitor.cc

Issue 8427007: Thread::Stop() must be called before any subclass's destructor completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest version as trybot-ted Created 9 years, 1 month 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/ui/views/shell_dialogs_win.cc ('k') | chrome/service/service_process.cc » ('j') | 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/default_plugin/plugin_install_job_monitor.h" 5 #include "chrome/default_plugin/plugin_install_job_monitor.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/default_plugin/plugin_impl.h" 8 #include "chrome/default_plugin/plugin_impl.h"
9 9
10 PluginInstallationJobMonitorThread::PluginInstallationJobMonitorThread() 10 PluginInstallationJobMonitorThread::PluginInstallationJobMonitorThread()
11 : Thread("Chrome plugin install thread"), 11 : Thread("Chrome plugin install thread"),
12 install_job_completion_port_(NULL), 12 install_job_completion_port_(NULL),
13 stop_job_monitoring_(false), 13 stop_job_monitoring_(false),
14 plugin_window_(NULL), 14 plugin_window_(NULL),
15 install_job_(NULL) { 15 install_job_(NULL) {
16 } 16 }
17 17
18 PluginInstallationJobMonitorThread::~PluginInstallationJobMonitorThread() { 18 PluginInstallationJobMonitorThread::~PluginInstallationJobMonitorThread() {
19 // The way this class is used, Thread::Stop() has always been called
20 // by the time we reach this point, so we do not need to call it
21 // again.
22 DCHECK(!Thread::IsRunning());
19 if (install_job_) { 23 if (install_job_) {
20 ::CloseHandle(install_job_); 24 ::CloseHandle(install_job_);
21 install_job_ = NULL; 25 install_job_ = NULL;
22 } 26 }
23 } 27 }
24 28
25 bool PluginInstallationJobMonitorThread::Initialize() { 29 bool PluginInstallationJobMonitorThread::Initialize() {
26 DCHECK(install_job_ == NULL); 30 DCHECK(install_job_ == NULL);
27 31
28 install_job_ = ::CreateJobObject(NULL, NULL); 32 install_job_ = ::CreateJobObject(NULL, NULL);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Thread::Stop(); 101 Thread::Stop();
98 ::CloseHandle(install_job_completion_port_); 102 ::CloseHandle(install_job_completion_port_);
99 install_job_completion_port_ = NULL; 103 install_job_completion_port_ = NULL;
100 } 104 }
101 105
102 bool PluginInstallationJobMonitorThread::AssignProcessToJob( 106 bool PluginInstallationJobMonitorThread::AssignProcessToJob(
103 HANDLE process_handle) { 107 HANDLE process_handle) {
104 BOOL result = AssignProcessToJobObject(install_job_, process_handle); 108 BOOL result = AssignProcessToJobObject(install_job_, process_handle);
105 return result ? true : false; 109 return result ? true : false;
106 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/shell_dialogs_win.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698