Index: components/nacl/browser/nacl_browser.cc |
diff --git a/components/nacl/browser/nacl_browser.cc b/components/nacl/browser/nacl_browser.cc |
index 84e710f84fcbecb7774a470b75fde934b8e49ef9..b10e2e1e077b7df582b6418ad026956842ffc8e8 100644 |
--- a/components/nacl/browser/nacl_browser.cc |
+++ b/components/nacl/browser/nacl_browser.cc |
@@ -272,15 +272,15 @@ void NaClBrowser::OnIrtOpened(scoped_ptr<base::FileProxy> file_proxy, |
CheckWaiting(); |
} |
-void NaClBrowser::FireGdbDebugStubPortOpened(int port) { |
- content::BrowserThread::PostTask( |
- content::BrowserThread::IO, |
- FROM_HERE, |
- base::Bind(debug_stub_port_listener_, port)); |
-} |
- |
-bool NaClBrowser::HasGdbDebugStubPortListener() { |
- return !debug_stub_port_listener_.is_null(); |
+void NaClBrowser::SetProcessGdbDebugStubPort(int process_id, int port) { |
+ gdb_debug_stub_port_map_[process_id] = port; |
+ if (port != kGdbDebugStubPortUnknown && |
+ !debug_stub_port_listener_.is_null()) { |
+ content::BrowserThread::PostTask( |
+ content::BrowserThread::IO, |
+ FROM_HERE, |
+ base::Bind(debug_stub_port_listener_, port)); |
+ } |
} |
void NaClBrowser::SetGdbDebugStubPortListener( |
@@ -292,6 +292,14 @@ void NaClBrowser::ClearGdbDebugStubPortListener() { |
debug_stub_port_listener_.Reset(); |
} |
+int NaClBrowser::GetProcessGdbDebugStubPort(int process_id) { |
+ GdbDebugStubPortMap::iterator i = gdb_debug_stub_port_map_.find(process_id); |
+ if (i != gdb_debug_stub_port_map_.end()) { |
+ return i->second; |
+ } |
+ return kGdbDebugStubPortUnused; |
+} |
+ |
void NaClBrowser::InitValidationCacheFilePath() { |
// Determine where the validation cache resides in the file system. It |
// exists in Chrome's cache directory and is not tied to any specific |
@@ -534,6 +542,10 @@ void NaClBrowser::PersistValidationCache() { |
validation_cache_is_modified_ = false; |
} |
+void NaClBrowser::OnProcessEnd(int process_id) { |
+ gdb_debug_stub_port_map_.erase(process_id); |
+} |
+ |
void NaClBrowser::OnProcessCrashed() { |
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
if (crash_times_.size() == kMaxCrashesPerInterval) { |