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

Side by Side Diff: content/browser/browser_child_process_host.cc

Issue 8771041: Simplify BrowserChildProcessHost in preparation for refactoring it so that consumers embed it in ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix nacl on win64 Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 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 "content/browser/browser_child_process_host.h" 5 #include "content/browser/browser_child_process_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 void BrowserChildProcessHost::Notify(int type) { 125 void BrowserChildProcessHost::Notify(int type) {
126 BrowserThread::PostTask( 126 BrowserThread::PostTask(
127 BrowserThread::UI, 127 BrowserThread::UI,
128 FROM_HERE, 128 FROM_HERE,
129 base::Bind(&ChildNotificationHelper, type, data_)); 129 base::Bind(&ChildNotificationHelper, type, data_));
130 } 130 }
131 131
132 base::TerminationStatus BrowserChildProcessHost::GetChildTerminationStatus( 132 base::TerminationStatus BrowserChildProcessHost::GetChildTerminationStatus(
133 int* exit_code) { 133 int* exit_code) {
134 if (!child_process_.get()) // If the delegate doesn't use Launch() helper.
135 return base::GetTerminationStatus(handle(), exit_code);
134 return child_process_->GetChildTerminationStatus(exit_code); 136 return child_process_->GetChildTerminationStatus(exit_code);
135 } 137 }
136 138
137 bool BrowserChildProcessHost::OnMessageReceived(const IPC::Message& message) { 139 bool BrowserChildProcessHost::OnMessageReceived(const IPC::Message& message) {
138 return false; 140 return false;
139 } 141 }
140 142
141 void BrowserChildProcessHost::OnChannelConnected(int32 peer_pid) { 143 void BrowserChildProcessHost::OnChannelConnected(int32 peer_pid) {
142 Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED); 144 Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED);
143 } 145 }
(...skipping 23 matching lines...) Expand all
167 this->type(), 169 this->type(),
168 content::PROCESS_TYPE_MAX); 170 content::PROCESS_TYPE_MAX);
169 if (disconnect_was_alive_) { 171 if (disconnect_was_alive_) {
170 UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive", 172 UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive",
171 this->type(), 173 this->type(),
172 content::PROCESS_TYPE_MAX); 174 content::PROCESS_TYPE_MAX);
173 } 175 }
174 break; 176 break;
175 } 177 }
176 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { 178 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: {
177 OnProcessWasKilled(exit_code);
178 // Report that this child process was killed. 179 // Report that this child process was killed.
179 Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED);
180 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed", 180 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed",
181 this->type(), 181 this->type(),
182 content::PROCESS_TYPE_MAX); 182 content::PROCESS_TYPE_MAX);
183 if (disconnect_was_alive_) { 183 if (disconnect_was_alive_) {
184 UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive", 184 UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive",
185 this->type(), 185 this->type(),
186 content::PROCESS_TYPE_MAX); 186 content::PROCESS_TYPE_MAX);
187 } 187 }
188 break; 188 break;
189 } 189 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 return *iterator_; 294 return *iterator_;
295 } while (true); 295 } while (true);
296 296
297 return NULL; 297 return NULL;
298 } 298 }
299 299
300 bool BrowserChildProcessHost::Iterator::Done() { 300 bool BrowserChildProcessHost::Iterator::Done() {
301 return iterator_ == g_child_process_list.Get().end(); 301 return iterator_ == g_child_process_list.Get().end();
302 } 302 }
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host.h ('k') | content/public/browser/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698