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

Side by Side Diff: chrome/common/child_process_host.cc

Issue 40195: An assert was being hit because WaitableEvent's dtor was calling CloseHandle ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « base/waitable_event_win.cc ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/common/child_process_host.h" 5 #include "chrome/common/child_process_host.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Singleton<ChildProcessList>::get()->push_back(this); 48 Singleton<ChildProcessList>::get()->push_back(this);
49 } 49 }
50 50
51 51
52 ChildProcessHost::~ChildProcessHost() { 52 ChildProcessHost::~ChildProcessHost() {
53 Singleton<ChildProcessList>::get()->remove(this); 53 Singleton<ChildProcessList>::get()->remove(this);
54 54
55 if (handle()) { 55 if (handle()) {
56 watcher_.StopWatching(); 56 watcher_.StopWatching();
57 ProcessWatcher::EnsureProcessTerminated(handle()); 57 ProcessWatcher::EnsureProcessTerminated(handle());
58
59 // Above call took ownership, so don't want WaitableEvent to assert because
60 // the handle isn't valid anymore.
61 process_event_->Release();
58 } 62 }
59 } 63 }
60 64
61 bool ChildProcessHost::CreateChannel() { 65 bool ChildProcessHost::CreateChannel() {
62 channel_id_ = GenerateRandomChannelID(this); 66 channel_id_ = GenerateRandomChannelID(this);
63 channel_.reset(new IPC::Channel( 67 channel_.reset(new IPC::Channel(
64 channel_id_, IPC::Channel::MODE_SERVER, &listener_)); 68 channel_id_, IPC::Channel::MODE_SERVER, &listener_));
65 if (!channel_->Connect()) 69 if (!channel_->Connect())
66 return false; 70 return false;
67 71
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 186
183 return *iterator_; 187 return *iterator_;
184 } while (true); 188 } while (true);
185 189
186 return NULL; 190 return NULL;
187 } 191 }
188 192
189 bool ChildProcessHost::Iterator::Done() { 193 bool ChildProcessHost::Iterator::Done() {
190 return iterator_ == Singleton<ChildProcessList>::get()->end(); 194 return iterator_ == Singleton<ChildProcessList>::get()->end();
191 } 195 }
OLDNEW
« no previous file with comments | « base/waitable_event_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698