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

Side by Side Diff: chrome/browser/nacl_host/nacl_process_host.cc

Issue 9662055: Test for --nacl-gdb functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Windows XP compatibility Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/nacl_host/nacl_process_host.h" 5 #include "chrome/browser/nacl_host/nacl_process_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 273
274 if (reply_msg_) { 274 if (reply_msg_) {
275 // The process failed to launch for some reason. 275 // The process failed to launch for some reason.
276 // Don't keep the renderer hanging. 276 // Don't keep the renderer hanging.
277 reply_msg_->set_reply_error(); 277 reply_msg_->set_reply_error();
278 chrome_render_message_filter_->Send(reply_msg_); 278 chrome_render_message_filter_->Send(reply_msg_);
279 } 279 }
280 #if defined(OS_WIN) 280 #if defined(OS_WIN)
281 if (RunningOnWOW64()) { 281 if (RunningOnWOW64()) {
282 NaClBrokerService::GetInstance()->OnLoaderDied(); 282 // If nacl-gdb switch is not empty, NaCl loader has been launched
Mark Seaborn 2012/03/14 23:33:14 "the nacl-gdb switch" "the NaCl loader"
halyavin 2012/03/15 15:31:36 Done.
283 // without broker and so we shouldn't inform broker about its termination.
Mark Seaborn 2012/03/14 23:33:14 "the broker"
halyavin 2012/03/15 15:31:36 Done.
284 if (CommandLine::ForCurrentProcess()->GetSwitchValuePath(
285 switches::kNaClGdb).empty()) {
286 NaClBrokerService::GetInstance()->OnLoaderDied();
287 }
283 } else { 288 } else {
284 debug_context_->SetChildProcessHost(NULL); 289 debug_context_->SetChildProcessHost(NULL);
285 } 290 }
286 #endif 291 #endif
287 } 292 }
288 293
289 // Attempt to ensure the IRT will be available when we need it, but don't wait. 294 // Attempt to ensure the IRT will be available when we need it, but don't wait.
290 bool NaClBrowser::EnsureIrtAvailable() { 295 bool NaClBrowser::EnsureIrtAvailable() {
291 if (IrtAvailable()) 296 if (IrtAvailable())
292 return true; 297 return true;
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 void NaClProcessHost::OnChannelConnected(int32 peer_pid) { 597 void NaClProcessHost::OnChannelConnected(int32 peer_pid) {
593 // Set process handle, if it was not set previously. 598 // Set process handle, if it was not set previously.
594 // This is needed when NaCl process is launched with nacl-gdb. 599 // This is needed when NaCl process is launched with nacl-gdb.
595 if (process_->GetData().handle == base::kNullProcessHandle) { 600 if (process_->GetData().handle == base::kNullProcessHandle) {
596 base::ProcessHandle process; 601 base::ProcessHandle process;
597 DCHECK(!CommandLine::ForCurrentProcess()->GetSwitchValuePath( 602 DCHECK(!CommandLine::ForCurrentProcess()->GetSwitchValuePath(
598 switches::kNaClGdb).empty()); 603 switches::kNaClGdb).empty());
599 if (base::OpenProcessHandleWithAccess( 604 if (base::OpenProcessHandleWithAccess(
600 peer_pid, 605 peer_pid,
601 base::kProcessAccessDuplicateHandle | 606 base::kProcessAccessDuplicateHandle |
602 base::kProcessAccessQueryLimitedInfomation | 607 base::kProcessAccessQueryInformation |
Mark Seaborn 2012/03/14 23:33:14 Please document this change in the commit message.
halyavin 2012/03/15 15:31:36 Done.
603 base::kProcessAccessWaitForTermination, 608 base::kProcessAccessWaitForTermination,
604 &process)) { 609 &process)) {
605 process_->SetHandle(process); 610 process_->SetHandle(process);
606 OnProcessLaunched(); 611 OnProcessLaunched();
607 } else { 612 } else {
608 LOG(ERROR) << "Failed to get process handle"; 613 LOG(ERROR) << "Failed to get process handle";
609 } 614 }
610 } 615 }
611 if (!IsHardwareExceptionHandlingEnabled()) { 616 if (!IsHardwareExceptionHandlingEnabled()) {
612 return; 617 return;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 process_->Send(new NaClProcessMsg_Start(handles_for_sel_ldr)); 801 process_->Send(new NaClProcessMsg_Start(handles_for_sel_ldr));
797 #endif 802 #endif
798 803
799 internal_->sockets_for_sel_ldr.clear(); 804 internal_->sockets_for_sel_ldr.clear();
800 } 805 }
801 806
802 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) { 807 bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) {
803 NOTREACHED() << "Invalid message with type = " << msg.type(); 808 NOTREACHED() << "Invalid message with type = " << msg.type();
804 return false; 809 return false;
805 } 810 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/nacl_host/test/mock_nacl_gdb.h » ('j') | chrome/browser/nacl_host/test/mock_nacl_gdb.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698