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 "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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 RequestPluginChannel(client); | 328 RequestPluginChannel(client); |
329 } | 329 } |
330 | 330 |
331 void PluginProcessHost::RequestPluginChannel(Client* client) { | 331 void PluginProcessHost::RequestPluginChannel(Client* client) { |
332 // We can't send any sync messages from the browser because it might lead to | 332 // We can't send any sync messages from the browser because it might lead to |
333 // a hang. However this async messages must be answered right away by the | 333 // a hang. However this async messages must be answered right away by the |
334 // plugin process (i.e. unblocks a Send() call like a sync message) otherwise | 334 // plugin process (i.e. unblocks a Send() call like a sync message) otherwise |
335 // a deadlock can occur if the plugin creation request from the renderer is | 335 // a deadlock can occur if the plugin creation request from the renderer is |
336 // a result of a sync message by the plugin process. | 336 // a result of a sync message by the plugin process. |
337 PluginProcessMsg_CreateChannel* msg = | 337 PluginProcessMsg_CreateChannel* msg = |
338 new PluginProcessMsg_CreateChannel(client->ID(), | 338 new PluginProcessMsg_CreateChannel( |
339 client->OffTheRecord()); | 339 client->ID(), |
| 340 client->OffTheRecord()); |
340 msg->set_unblock(true); | 341 msg->set_unblock(true); |
341 if (Send(msg)) { | 342 if (Send(msg)) { |
342 sent_requests_.push(client); | 343 sent_requests_.push(client); |
343 } else { | 344 } else { |
344 client->OnError(); | 345 client->OnError(); |
345 } | 346 } |
346 } | 347 } |
347 | 348 |
348 void PluginProcessHost::OnChannelCreated( | 349 void PluginProcessHost::OnChannelCreated( |
349 const IPC::ChannelHandle& channel_handle) { | 350 const IPC::ChannelHandle& channel_handle) { |
350 Client* client = sent_requests_.front(); | 351 Client* client = sent_requests_.front(); |
351 | 352 |
352 client->OnChannelOpened(channel_handle); | 353 client->OnChannelOpened(channel_handle); |
353 sent_requests_.pop(); | 354 sent_requests_.pop(); |
354 } | 355 } |
OLD | NEW |