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) && !defined(USE_AURA) | 7 #if defined(OS_WIN) && !defined(USE_AURA) |
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 while (!sent_requests_.empty()) { | 348 while (!sent_requests_.empty()) { |
349 Client* client = sent_requests_.front(); | 349 Client* client = sent_requests_.front(); |
350 if (client) | 350 if (client) |
351 client->OnError(); | 351 client->OnError(); |
352 sent_requests_.pop_front(); | 352 sent_requests_.pop_front(); |
353 } | 353 } |
354 } | 354 } |
355 | 355 |
356 // static | 356 // static |
357 void PluginProcessHost::CancelPendingRequestsForResourceContext( | 357 void PluginProcessHost::CancelPendingRequestsForResourceContext( |
358 const content::ResourceContext* context) { | 358 content::ResourceContext* context) { |
359 for (PluginProcessHostIterator host_it; !host_it.Done(); ++host_it) { | 359 for (PluginProcessHostIterator host_it; !host_it.Done(); ++host_it) { |
360 PluginProcessHost* host = *host_it; | 360 PluginProcessHost* host = *host_it; |
361 for (size_t i = 0; i < host->pending_requests_.size(); ++i) { | 361 for (size_t i = 0; i < host->pending_requests_.size(); ++i) { |
362 if (&host->pending_requests_[i]->GetResourceContext() == context) { | 362 if (host->pending_requests_[i]->GetResourceContext() == context) { |
363 host->pending_requests_[i]->OnError(); | 363 host->pending_requests_[i]->OnError(); |
364 host->pending_requests_.erase(host->pending_requests_.begin() + i); | 364 host->pending_requests_.erase(host->pending_requests_.begin() + i); |
365 --i; | 365 --i; |
366 } | 366 } |
367 } | 367 } |
368 } | 368 } |
369 } | 369 } |
370 | 370 |
371 void PluginProcessHost::OpenChannelToPlugin(Client* client) { | 371 void PluginProcessHost::OpenChannelToPlugin(Client* client) { |
372 process_->Notify(content::NOTIFICATION_CHILD_INSTANCE_CREATED); | 372 process_->Notify(content::NOTIFICATION_CHILD_INSTANCE_CREATED); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 427 } |
428 | 428 |
429 void PluginProcessHost::OnChannelCreated( | 429 void PluginProcessHost::OnChannelCreated( |
430 const IPC::ChannelHandle& channel_handle) { | 430 const IPC::ChannelHandle& channel_handle) { |
431 Client* client = sent_requests_.front(); | 431 Client* client = sent_requests_.front(); |
432 | 432 |
433 if (client) | 433 if (client) |
434 client->OnChannelOpened(channel_handle); | 434 client->OnChannelOpened(channel_handle); |
435 sent_requests_.pop_front(); | 435 sent_requests_.pop_front(); |
436 } | 436 } |
OLD | NEW |