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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, | 377 IPC_MESSAGE_HANDLER(PpapiHostMsg_ChannelCreated, |
378 OnRendererPluginChannelCreated) | 378 OnRendererPluginChannelCreated) |
379 IPC_MESSAGE_UNHANDLED(handled = false) | 379 IPC_MESSAGE_UNHANDLED(handled = false) |
380 IPC_END_MESSAGE_MAP() | 380 IPC_END_MESSAGE_MAP() |
381 DCHECK(handled); | 381 DCHECK(handled); |
382 return handled; | 382 return handled; |
383 } | 383 } |
384 | 384 |
385 // Called when the browser <--> plugin channel has been established. | 385 // Called when the browser <--> plugin channel has been established. |
386 void PpapiPluginProcessHost::OnChannelConnected(int32 peer_pid) { | 386 void PpapiPluginProcessHost::OnChannelConnected(int32 peer_pid) { |
| 387 bool supports_dev_channel = |
| 388 GetContentClient()->browser()->IsPluginAllowedToUseDevChannelAPIs(); |
387 // This will actually load the plugin. Errors will actually not be reported | 389 // This will actually load the plugin. Errors will actually not be reported |
388 // back at this point. Instead, the plugin will fail to establish the | 390 // back at this point. Instead, the plugin will fail to establish the |
389 // connections when we request them on behalf of the renderer(s). | 391 // connections when we request them on behalf of the renderer(s). |
390 Send(new PpapiMsg_LoadPlugin(plugin_path_, permissions_)); | 392 Send(new PpapiMsg_LoadPlugin(plugin_path_, permissions_, |
| 393 supports_dev_channel)); |
391 | 394 |
392 // Process all pending channel requests from the renderers. | 395 // Process all pending channel requests from the renderers. |
393 for (size_t i = 0; i < pending_requests_.size(); i++) | 396 for (size_t i = 0; i < pending_requests_.size(); i++) |
394 RequestPluginChannel(pending_requests_[i]); | 397 RequestPluginChannel(pending_requests_[i]); |
395 pending_requests_.clear(); | 398 pending_requests_.clear(); |
396 } | 399 } |
397 | 400 |
398 // Called when the browser <--> plugin channel has an error. This normally | 401 // Called when the browser <--> plugin channel has an error. This normally |
399 // means the plugin has crashed. | 402 // means the plugin has crashed. |
400 void PpapiPluginProcessHost::OnChannelError() { | 403 void PpapiPluginProcessHost::OnChannelError() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 // sent_requests_ queue should be the one that the plugin just created. | 436 // sent_requests_ queue should be the one that the plugin just created. |
434 Client* client = sent_requests_.front(); | 437 Client* client = sent_requests_.front(); |
435 sent_requests_.pop(); | 438 sent_requests_.pop(); |
436 | 439 |
437 const ChildProcessData& data = process_->GetData(); | 440 const ChildProcessData& data = process_->GetData(); |
438 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 441 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
439 data.id); | 442 data.id); |
440 } | 443 } |
441 | 444 |
442 } // namespace content | 445 } // namespace content |
OLD | NEW |