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

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

Issue 102073008: Allow multiple NaCl modules to be debugged. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 7 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 side-by-side diff with in-line comments
Download patch
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 2d154f38d986a846756618da10884de75f8dd870..c5fe4e48c295846fcaf664c8b4c902483889ed86 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -664,7 +664,7 @@ void NaClProcessHost::SendMessageToRenderer(
}
// TCP port we chose for NaCl debug stub. It can be any other number.
-static const int kDebugStubPort = 4014;
+static const int kInitialDebugStubPort = 4014;
#if defined(OS_POSIX)
net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
@@ -672,15 +672,17 @@ net::SocketDescriptor NaClProcessHost::GetDebugStubSocketHandle() {
net::SocketDescriptor s = net::kInvalidSocket;
// We allocate currently unused TCP port for debug stub tests. The port
noelallen_use_chromium 2013/12/20 01:00:28 Update comment. We always try to allocate the def
bradn 2013/12/20 01:25:35 Done.
// number is passed to the test via debug stub port listener.
- if (nacl_browser->HasGdbDebugStubPortListener()) {
- int port;
+ int port = kInitialDebugStubPort;
+ s = net::TCPListenSocket::CreateAndBind("127.0.0.1", port);
+ if (s == net::kInvalidSocket) {
s = net::TCPListenSocket::CreateAndBindAnyPort("127.0.0.1", &port);
- if (s != net::kInvalidSocket) {
+ }
+ if (s != net::kInvalidSocket) {
+ if (nacl_browser->HasGdbDebugStubPortListener()) {
nacl_browser->FireGdbDebugStubPortOpened(port);
}
- } else {
- s = net::TCPListenSocket::CreateAndBind("127.0.0.1", kDebugStubPort);
}
+ process_->SetNaClDebugStubPort(port);
if (s == net::kInvalidSocket) {
LOG(ERROR) << "failed to open socket for debug stub";
noelallen_use_chromium 2013/12/20 01:00:28 print port number?
bradn 2013/12/20 01:25:35 Done.
return net::kInvalidSocket;
« no previous file with comments | « chrome/browser/ui/webui/task_manager/task_manager_ui.cc ('k') | content/browser/browser_child_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698