OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/nacl_host/nacl_process_host.h" | 8 #include "chrome/browser/nacl_host/nacl_process_host.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void NaClBrokerService::OnLoaderDied() { | 65 void NaClBrokerService::OnLoaderDied() { |
66 --loaders_running_; | 66 --loaders_running_; |
67 // Stop the broker only if there are no loaders running or being launched. | 67 // Stop the broker only if there are no loaders running or being launched. |
68 NaClBrokerHost* broker_host = GetBrokerHost(); | 68 NaClBrokerHost* broker_host = GetBrokerHost(); |
69 if (loaders_running_ + pending_launches_.size() == 0 && broker_host != NULL) { | 69 if (loaders_running_ + pending_launches_.size() == 0 && broker_host != NULL) { |
70 broker_host->StopBroker(); | 70 broker_host->StopBroker(); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 NaClBrokerHost* NaClBrokerService::GetBrokerHost() { | 74 NaClBrokerHost* NaClBrokerService::GetBrokerHost() { |
75 for (ChildProcessHost::Iterator iter(ChildProcessInfo::NACL_BROKER_PROCESS); | 75 for (BrowserChildProcessHost::Iterator iter( |
| 76 ChildProcessInfo::NACL_BROKER_PROCESS); |
76 !iter.Done(); | 77 !iter.Done(); |
77 ++iter) { | 78 ++iter) { |
78 NaClBrokerHost* broker_host = static_cast<NaClBrokerHost*>(*iter); | 79 NaClBrokerHost* broker_host = static_cast<NaClBrokerHost*>(*iter); |
79 return broker_host; | 80 return broker_host; |
80 } | 81 } |
81 return NULL; | 82 return NULL; |
82 } | 83 } |
OLD | NEW |