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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 198083006: Update the task manager with the debug stub port chosen by nacl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 1ee56f5de6acd61cd026c5d0067e33f598711cfc..0c711b1c5501a41caf1c9960cb0ad836453becb8 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -654,6 +654,8 @@ bool NaClProcessHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(
NaClProcessMsg_AttachDebugExceptionHandler,
OnAttachDebugExceptionHandler)
+ IPC_MESSAGE_HANDLER(NaClProcessHostMsg_DebugStubPortSelected,
+ OnDebugStubPortSelected)
#endif
IPC_MESSAGE_HANDLER(NaClProcessHostMsg_PpapiChannelsCreated,
OnPpapiChannelsCreated)
@@ -755,12 +757,20 @@ void NaClProcessHost::SendMessageToRenderer(
}
}
+void NaClProcessHost::SetDebugStubPort(uint16_t port) {
+ NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
+ if (nacl_browser->HasGdbDebugStubPortListener()) {
+ nacl_browser->FireGdbDebugStubPortOpened(port);
+ }
+ // Set debug stub port on the process object.
+ process_->SetNaClDebugStubPort(port);
+}
+
+#if defined(OS_POSIX)
// TCP port we chose for NaCl debug stub. It can be any other number.
static const int kInitialDebugStubPort = 4014;
-#if defined(OS_POSIX)
net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
- NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
net::SocketDescriptor s = net::kInvalidSocket;
// We always try to allocate the default port first. If this fails, we then
// allocate any available port.
@@ -772,12 +782,8 @@ net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
s = net::TCPListenSocket::CreateAndBindAnyPort("127.0.0.1", &port);
}
if (s != net::kInvalidSocket) {
- if (nacl_browser->HasGdbDebugStubPortListener()) {
- nacl_browser->FireGdbDebugStubPortOpened(port);
- }
+ SetDebugStubPort(port);
}
- // Set debug stub port on the process object.
- process_->SetNaClDebugStubPort(port);
if (s == net::kInvalidSocket) {
LOG(ERROR) << "failed to open socket for debug stub";
return net::kInvalidSocket;
@@ -938,6 +944,13 @@ void NaClProcessHost::OnPpapiChannelsCreated(
}
}
+#if defined(OS_WIN)
+void NaClProcessHost::OnDebugStubPortSelected(uint16_t debug_stub_port) {
Mark Seaborn 2014/05/08 18:04:44 Nit: Can you try to keep the same ordering as in t
bradn 2014/05/08 18:09:25 Done.
+ CHECK(!uses_nonsfi_mode_);
+ SetDebugStubPort(debug_stub_port);
+}
+#endif
+
bool NaClProcessHost::StartWithLaunchedProcess() {
NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698