| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/nacl_host/nacl_broker_service_win.h" | 5 #include "chrome/browser/nacl_host/nacl_broker_service_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/nacl_host/nacl_process_host.h" | 7 #include "chrome/browser/nacl_host/nacl_process_host.h" |
| 8 | 8 |
| 9 NaClBrokerService* NaClBrokerService::GetInstance() { | 9 NaClBrokerService* NaClBrokerService::GetInstance() { |
| 10 return Singleton<NaClBrokerService>::get(); | 10 return Singleton<NaClBrokerService>::get(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void NaClBrokerService::OnLoaderDied() { | 55 void NaClBrokerService::OnLoaderDied() { |
| 56 --loaders_running_; | 56 --loaders_running_; |
| 57 // Stop the broker only if there are no loaders running or being launched. | 57 // Stop the broker only if there are no loaders running or being launched. |
| 58 NaClBrokerHost* broker_host = GetBrokerHost(); | 58 NaClBrokerHost* broker_host = GetBrokerHost(); |
| 59 if (loaders_running_ + pending_launches_.size() == 0 && broker_host != NULL) { | 59 if (loaders_running_ + pending_launches_.size() == 0 && broker_host != NULL) { |
| 60 broker_host->StopBroker(); | 60 broker_host->StopBroker(); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 NaClBrokerHost* NaClBrokerService::GetBrokerHost() { | 64 NaClBrokerHost* NaClBrokerService::GetBrokerHost() { |
| 65 BrowserChildProcessHost::Iterator iter(ChildProcessInfo::NACL_BROKER_PROCESS); | 65 BrowserChildProcessHost::Iterator iter(content::PROCESS_TYPE_NACL_BROKER); |
| 66 if (iter.Done()) | 66 if (iter.Done()) |
| 67 return NULL; | 67 return NULL; |
| 68 NaClBrokerHost* broker_host = static_cast<NaClBrokerHost*>(*iter); | 68 NaClBrokerHost* broker_host = static_cast<NaClBrokerHost*>(*iter); |
| 69 return broker_host; | 69 return broker_host; |
| 70 } | 70 } |
| OLD | NEW |