Chromium Code Reviews| Index: components/nacl/loader/nacl_listener.cc |
| diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
| index f49e3f3a3676e5e769bf42f20b13932f4880aa5a..233bda7aba27c6fe7bb303df01a43723c785b8c5 100644 |
| --- a/components/nacl/loader/nacl_listener.cc |
| +++ b/components/nacl/loader/nacl_listener.cc |
| @@ -47,6 +47,9 @@ |
| #endif |
| namespace { |
| + |
| +NaClListener* g_listener; |
| + |
| #if defined(OS_MACOSX) |
| // On Mac OS X, shm_open() works in the sandbox but does not give us |
| @@ -87,8 +90,6 @@ int CreateMemoryObject(size_t size, int executable) { |
| #elif defined(OS_WIN) |
| -NaClListener* g_listener; |
|
Mark Seaborn
2014/05/08 15:52:23
This should stay conditional on OS_WIN.
bradn
2014/05/08 17:00:24
Er, ok, back again...
|
| - |
| // We wrap the function to convert the bool return value to an int. |
| int BrokerDuplicateHandle(NaClHandle source_handle, |
| uint32_t process_id, |
| @@ -111,6 +112,10 @@ int AttachDebugExceptionHandler(const void* info, size_t info_size) { |
| #endif |
| +void DebugStubPortSelectedHandler(uint16_t port) { |
|
Mark Seaborn
2014/05/08 15:52:23
Also only needed on OS_WIN.
Currently you have we
bradn
2014/05/08 17:00:24
You've flip flopped here, in the previous version
Mark Seaborn
2014/05/08 18:04:44
To be fair, you sent me a change that didn't compi
|
| + g_listener->Send(new NaClProcessHostMsg_DebugStubPortSelected(port)); |
| +} |
| + |
| // Creates the PPAPI IPC channel between the NaCl IRT and the host |
| // (browser/renderer) process, and starts to listen it on the thread where |
| // the given message_loop_proxy runs. |
| @@ -211,18 +216,14 @@ NaClListener::NaClListener() : shutdown_event_(true, false), |
| main_loop_(NULL) { |
| io_thread_.StartWithOptions( |
| base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); |
| -#if defined(OS_WIN) |
|
Mark Seaborn
2014/05/08 15:52:23
These conditionals can stay.
bradn
2014/05/08 17:00:24
Done.
|
| DCHECK(g_listener == NULL); |
| g_listener = this; |
| -#endif |
| } |
| NaClListener::~NaClListener() { |
| NOTREACHED(); |
| shutdown_event_.Signal(); |
| -#if defined(OS_WIN) |
| g_listener = NULL; |
| -#endif |
| } |
| bool NaClListener::Send(IPC::Message* msg) { |
| @@ -456,6 +457,8 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| params.debug_stub_server_bound_socket); |
| #endif |
| #if defined(OS_WIN) |
| + args->debug_stub_server_port_selected_handler_func = |
|
Mark Seaborn
2014/05/08 15:52:23
Nit: maybe put this after "args->attach_debug_exce
bradn
2014/05/08 17:00:24
Done.
|
| + DebugStubPortSelectedHandler; |
| args->broker_duplicate_handle_func = BrokerDuplicateHandle; |
| args->attach_debug_exception_handler_func = AttachDebugExceptionHandler; |
| #endif |