OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Found the plugin. | 130 // Found the plugin. |
131 iter->host_impl_->DeleteInstance(pp_instance); | 131 iter->host_impl_->DeleteInstance(pp_instance); |
132 return; | 132 return; |
133 } | 133 } |
134 } | 134 } |
135 // Note: It's possible that the plugin process has already been deleted by | 135 // Note: It's possible that the plugin process has already been deleted by |
136 // the time this message is received. For example, it could have crashed. | 136 // the time this message is received. For example, it could have crashed. |
137 // That's OK, we can just ignore this message. | 137 // That's OK, we can just ignore this message. |
138 } | 138 } |
139 | 139 |
| 140 // static |
| 141 void PpapiPluginProcessHost::FindByName( |
| 142 const string16& name, |
| 143 std::vector<PpapiPluginProcessHost*>* hosts) { |
| 144 for (PpapiPluginProcessHostIterator iter; !iter.Done(); ++iter) { |
| 145 if (iter->process_.get() && iter->process_->GetData().name == name) |
| 146 hosts->push_back(*iter); |
| 147 } |
| 148 } |
| 149 |
140 bool PpapiPluginProcessHost::Send(IPC::Message* message) { | 150 bool PpapiPluginProcessHost::Send(IPC::Message* message) { |
141 return process_->Send(message); | 151 return process_->Send(message); |
142 } | 152 } |
143 | 153 |
144 void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) { | 154 void PpapiPluginProcessHost::OpenChannelToPlugin(Client* client) { |
145 if (process_->GetHost()->IsChannelOpening()) { | 155 if (process_->GetHost()->IsChannelOpening()) { |
146 // The channel is already in the process of being opened. Put | 156 // The channel is already in the process of being opened. Put |
147 // this "open channel" request into a queue of requests that will | 157 // this "open channel" request into a queue of requests that will |
148 // be run once the channel is open. | 158 // be run once the channel is open. |
149 pending_requests_.push_back(client); | 159 pending_requests_.push_back(client); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 // sent_requests_ queue should be the one that the plugin just created. | 379 // sent_requests_ queue should be the one that the plugin just created. |
370 Client* client = sent_requests_.front(); | 380 Client* client = sent_requests_.front(); |
371 sent_requests_.pop(); | 381 sent_requests_.pop(); |
372 | 382 |
373 const ChildProcessData& data = process_->GetData(); | 383 const ChildProcessData& data = process_->GetData(); |
374 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 384 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
375 data.id); | 385 data.id); |
376 } | 386 } |
377 | 387 |
378 } // namespace content | 388 } // namespace content |
OLD | NEW |