summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/nacl_host/nacl_broker_host_win.cc5
-rw-r--r--chrome/browser/nacl_host/nacl_broker_host_win.h3
-rw-r--r--chrome/browser/nacl_host/nacl_broker_service_win.cc5
-rw-r--r--chrome/browser/nacl_host/nacl_broker_service_win.h3
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.cc4
-rw-r--r--chrome/common/nacl_debug_exception_handler_win.cc14
-rw-r--r--chrome/common/nacl_debug_exception_handler_win.h1
-rw-r--r--chrome/common/nacl_messages.h5
-rw-r--r--chrome/nacl/nacl_broker_listener.cc5
-rw-r--r--chrome/nacl/nacl_broker_listener.h3
10 files changed, 32 insertions, 16 deletions
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.cc b/chrome/browser/nacl_host/nacl_broker_host_win.cc
index e86c7a9..b75481e 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.cc
@@ -73,7 +73,8 @@ void NaClBrokerHost::OnLoaderLaunched(const std::string& loader_channel_id,
}
bool NaClBrokerHost::LaunchDebugExceptionHandler(
- int32 pid, base::ProcessHandle process_handle) {
+ int32 pid, base::ProcessHandle process_handle,
+ const std::string& startup_info) {
base::ProcessHandle broker_process = process_->GetData().handle;
base::ProcessHandle handle_in_broker_process;
if (!DuplicateHandle(::GetCurrentProcess(), process_handle,
@@ -81,7 +82,7 @@ bool NaClBrokerHost::LaunchDebugExceptionHandler(
0, /* bInheritHandle= */ FALSE, DUPLICATE_SAME_ACCESS))
return false;
return process_->Send(new NaClProcessMsg_LaunchDebugExceptionHandler(
- pid, handle_in_broker_process));
+ pid, handle_in_broker_process, startup_info));
}
void NaClBrokerHost::OnDebugExceptionHandlerLaunched(int32 pid, bool success) {
diff --git a/chrome/browser/nacl_host/nacl_broker_host_win.h b/chrome/browser/nacl_host/nacl_broker_host_win.h
index ce38bb0..20d6b37 100644
--- a/chrome/browser/nacl_host/nacl_broker_host_win.h
+++ b/chrome/browser/nacl_host/nacl_broker_host_win.h
@@ -29,7 +29,8 @@ class NaClBrokerHost : public content::BrowserChildProcessHostDelegate {
bool LaunchLoader(const std::string& loader_channel_id);
bool LaunchDebugExceptionHandler(int32 pid,
- base::ProcessHandle process_handle);
+ base::ProcessHandle process_handle,
+ const std::string& startup_info);
// Stop the broker process.
void StopBroker();
diff --git a/chrome/browser/nacl_host/nacl_broker_service_win.cc b/chrome/browser/nacl_host/nacl_broker_service_win.cc
index 5be8717..6426bd9 100644
--- a/chrome/browser/nacl_host/nacl_broker_service_win.cc
+++ b/chrome/browser/nacl_host/nacl_broker_service_win.cc
@@ -68,12 +68,13 @@ void NaClBrokerService::OnLoaderDied() {
bool NaClBrokerService::LaunchDebugExceptionHandler(
base::WeakPtr<NaClProcessHost> nacl_process_host, int32 pid,
- base::ProcessHandle process_handle) {
+ base::ProcessHandle process_handle, const std::string& startup_info) {
pending_debuggers_[pid] = nacl_process_host;
NaClBrokerHost* broker_host = GetBrokerHost();
if (!broker_host)
return false;
- return broker_host->LaunchDebugExceptionHandler(pid, process_handle);
+ return broker_host->LaunchDebugExceptionHandler(pid, process_handle,
+ startup_info);
}
void NaClBrokerService::OnDebugExceptionHandlerLaunched(int32 pid,
diff --git a/chrome/browser/nacl_host/nacl_broker_service_win.h b/chrome/browser/nacl_host/nacl_broker_service_win.h
index 82c9816..8323cdd 100644
--- a/chrome/browser/nacl_host/nacl_broker_service_win.h
+++ b/chrome/browser/nacl_host/nacl_broker_service_win.h
@@ -37,7 +37,8 @@ class NaClBrokerService {
bool LaunchDebugExceptionHandler(base::WeakPtr<NaClProcessHost> client,
int32 pid,
- base::ProcessHandle process_handle);
+ base::ProcessHandle process_handle,
+ const std::string& startup_info);
// Called by NaClBrokerHost to notify the service that a debug
// exception handler was started.
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index cbe7e3c..77df57c 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -934,10 +934,10 @@ bool NaClProcessHost::AttachDebugExceptionHandler(const std::string& info,
// the 32-bit browser process to run the debug exception handler.
if (RunningOnWOW64()) {
return NaClBrokerService::GetInstance()->LaunchDebugExceptionHandler(
- weak_factory_.GetWeakPtr(), nacl_pid, process_handle);
+ weak_factory_.GetWeakPtr(), nacl_pid, process_handle, info);
} else {
NaClStartDebugExceptionHandlerThread(
- process_handle.Take(),
+ process_handle.Take(), info,
base::MessageLoopProxy::current(),
base::Bind(&NaClProcessHost::OnDebugExceptionHandlerLaunchedByBroker,
weak_factory_.GetWeakPtr()));
diff --git a/chrome/common/nacl_debug_exception_handler_win.cc b/chrome/common/nacl_debug_exception_handler_win.cc
index eb77276..4ed4323 100644
--- a/chrome/common/nacl_debug_exception_handler_win.cc
+++ b/chrome/common/nacl_debug_exception_handler_win.cc
@@ -15,9 +15,11 @@ namespace {
class DebugExceptionHandler : public base::PlatformThread::Delegate {
public:
DebugExceptionHandler(base::ProcessHandle nacl_process,
+ const std::string& startup_info,
base::MessageLoopProxy* message_loop,
const base::Callback<void(bool)>& on_connected)
: nacl_process_(nacl_process),
+ startup_info_(startup_info),
message_loop_(message_loop),
on_connected_(on_connected) {
}
@@ -41,14 +43,19 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
message_loop_->PostTask(FROM_HERE, base::Bind(on_connected_, attached));
if (attached) {
- DWORD exit_code;
- NaClDebugLoop(nacl_process_, &exit_code);
+ // TODO(mseaborn): Clean up the NaCl side to remove the need for
+ // a const_cast here.
+ NaClDebugExceptionHandlerRun(
+ nacl_process_,
+ reinterpret_cast<void*>(const_cast<char*>(startup_info_.data())),
+ startup_info_.size());
}
delete this;
}
private:
base::win::ScopedHandle nacl_process_;
+ std::string startup_info_;
base::MessageLoopProxy* message_loop_;
base::Callback<void(bool)> on_connected_;
@@ -59,12 +66,13 @@ class DebugExceptionHandler : public base::PlatformThread::Delegate {
void NaClStartDebugExceptionHandlerThread(
base::ProcessHandle nacl_process,
+ const std::string& startup_info,
base::MessageLoopProxy* message_loop,
const base::Callback<void(bool)>& on_connected) {
// The new PlatformThread will take ownership of the
// DebugExceptionHandler object, which will delete itself on exit.
DebugExceptionHandler* handler = new DebugExceptionHandler(
- nacl_process, message_loop, on_connected);
+ nacl_process, startup_info, message_loop, on_connected);
if (!base::PlatformThread::CreateNonJoinable(0, handler)) {
on_connected.Run(false);
delete handler;
diff --git a/chrome/common/nacl_debug_exception_handler_win.h b/chrome/common/nacl_debug_exception_handler_win.h
index 7bf78d4..a99ec65 100644
--- a/chrome/common/nacl_debug_exception_handler_win.h
+++ b/chrome/common/nacl_debug_exception_handler_win.h
@@ -12,6 +12,7 @@
void NaClStartDebugExceptionHandlerThread(
base::ProcessHandle nacl_process,
+ const std::string& startup_info,
base::MessageLoopProxy* message_loop,
const base::Callback<void(bool)>& on_connected);
diff --git a/chrome/common/nacl_messages.h b/chrome/common/nacl_messages.h
index 12243de..8200d65 100644
--- a/chrome/common/nacl_messages.h
+++ b/chrome/common/nacl_messages.h
@@ -37,9 +37,10 @@ IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched,
// Tells the NaCl broker to attach a debug exception handler to the
// given NaCl loader process.
-IPC_MESSAGE_CONTROL2(NaClProcessMsg_LaunchDebugExceptionHandler,
+IPC_MESSAGE_CONTROL3(NaClProcessMsg_LaunchDebugExceptionHandler,
int32 /* pid of the NaCl process */,
- base::ProcessHandle /* handle of the NaCl process */)
+ base::ProcessHandle /* handle of the NaCl process */,
+ std::string /* NaCl internal process layout info */)
// Notify the browser process that the broker process finished
// attaching a debug exception handler to the given NaCl loader
diff --git a/chrome/nacl/nacl_broker_listener.cc b/chrome/nacl/nacl_broker_listener.cc
index cb9a4b5..493b02d 100644
--- a/chrome/nacl/nacl_broker_listener.cc
+++ b/chrome/nacl/nacl_broker_listener.cc
@@ -99,9 +99,10 @@ void NaClBrokerListener::OnLaunchLoaderThroughBroker(
}
void NaClBrokerListener::OnLaunchDebugExceptionHandler(
- int32 pid, base::ProcessHandle process_handle) {
+ int32 pid, base::ProcessHandle process_handle,
+ const std::string& startup_info) {
NaClStartDebugExceptionHandlerThread(
- process_handle,
+ process_handle, startup_info,
base::MessageLoopProxy::current(),
base::Bind(SendReply, channel_.get(), pid));
}
diff --git a/chrome/nacl/nacl_broker_listener.h b/chrome/nacl/nacl_broker_listener.h
index 94f97c9..61e16c6 100644
--- a/chrome/nacl/nacl_broker_listener.h
+++ b/chrome/nacl/nacl_broker_listener.h
@@ -28,7 +28,8 @@ class NaClBrokerListener : public IPC::Channel::Listener {
private:
void OnLaunchLoaderThroughBroker(const std::string& loader_channel_id);
void OnLaunchDebugExceptionHandler(int32 pid,
- base::ProcessHandle process_handle);
+ base::ProcessHandle process_handle,
+ const std::string& startup_info);
void OnStopBroker();
base::ProcessHandle browser_handle_;