| 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/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (host->pending_requests_[i]->GetResourceContext() == context) { | 335 if (host->pending_requests_[i]->GetResourceContext() == context) { |
| 336 host->pending_requests_[i]->OnError(); | 336 host->pending_requests_[i]->OnError(); |
| 337 host->pending_requests_.erase(host->pending_requests_.begin() + i); | 337 host->pending_requests_.erase(host->pending_requests_.begin() + i); |
| 338 --i; | 338 --i; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 void PluginProcessHost::OpenChannelToPlugin(Client* client) { | 344 void PluginProcessHost::OpenChannelToPlugin(Client* client) { |
| 345 process_->Notify(NOTIFICATION_CHILD_INSTANCE_CREATED); | 345 BrowserThread::PostTask( |
| 346 BrowserThread::UI, FROM_HERE, |
| 347 base::Bind(&BrowserChildProcessHostImpl::NotifyProcessInstanceCreated, |
| 348 process_->GetData())); |
| 346 client->SetPluginInfo(info_); | 349 client->SetPluginInfo(info_); |
| 347 if (process_->GetHost()->IsChannelOpening()) { | 350 if (process_->GetHost()->IsChannelOpening()) { |
| 348 // The channel is already in the process of being opened. Put | 351 // The channel is already in the process of being opened. Put |
| 349 // this "open channel" request into a queue of requests that will | 352 // this "open channel" request into a queue of requests that will |
| 350 // be run once the channel is open. | 353 // be run once the channel is open. |
| 351 pending_requests_.push_back(client); | 354 pending_requests_.push_back(client); |
| 352 return; | 355 return; |
| 353 } | 356 } |
| 354 | 357 |
| 355 // We already have an open channel, send a request right away to plugin. | 358 // We already have an open channel, send a request right away to plugin. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 void PluginProcessHost::OnChannelCreated( | 405 void PluginProcessHost::OnChannelCreated( |
| 403 const IPC::ChannelHandle& channel_handle) { | 406 const IPC::ChannelHandle& channel_handle) { |
| 404 Client* client = sent_requests_.front(); | 407 Client* client = sent_requests_.front(); |
| 405 | 408 |
| 406 if (client) | 409 if (client) |
| 407 client->OnChannelOpened(channel_handle); | 410 client->OnChannelOpened(channel_handle); |
| 408 sent_requests_.pop_front(); | 411 sent_requests_.pop_front(); |
| 409 } | 412 } |
| 410 | 413 |
| 411 } // namespace content | 414 } // namespace content |
| OLD | NEW |