| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 switches::kPpapiSubpixelRenderingSetting, | 448 switches::kPpapiSubpixelRenderingSetting, |
| 449 base::IntToString(font_params.subpixel_rendering)); | 449 base::IntToString(font_params.subpixel_rendering)); |
| 450 #endif | 450 #endif |
| 451 | 451 |
| 452 if (!plugin_launcher.empty()) | 452 if (!plugin_launcher.empty()) |
| 453 cmd_line->PrependWrapper(plugin_launcher); | 453 cmd_line->PrependWrapper(plugin_launcher); |
| 454 | 454 |
| 455 // On posix, never use the zygote for the broker. Also, only use the zygote if | 455 // On posix, never use the zygote for the broker. Also, only use the zygote if |
| 456 // we are not using a plugin launcher - having a plugin launcher means we need | 456 // we are not using a plugin launcher - having a plugin launcher means we need |
| 457 // to use another process instead of just forking the zygote. | 457 // to use another process instead of just forking the zygote. |
| 458 process_->Launch( | 458 process_->Launch(new PpapiPluginSandboxedProcessLauncherDelegate( |
| 459 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, | 459 is_broker_, info, process_->GetHost()), |
| 460 info, | 460 cmd_line, nullptr, true); |
| 461 process_->GetHost()), | |
| 462 cmd_line, | |
| 463 true); | |
| 464 return true; | 461 return true; |
| 465 } | 462 } |
| 466 | 463 |
| 467 void PpapiPluginProcessHost::RequestPluginChannel(Client* client) { | 464 void PpapiPluginProcessHost::RequestPluginChannel(Client* client) { |
| 468 base::ProcessHandle process_handle; | 465 base::ProcessHandle process_handle; |
| 469 int renderer_child_id; | 466 int renderer_child_id; |
| 470 client->GetPpapiChannelInfo(&process_handle, &renderer_child_id); | 467 client->GetPpapiChannelInfo(&process_handle, &renderer_child_id); |
| 471 | 468 |
| 472 base::ProcessId process_id = base::kNullProcessId; | 469 base::ProcessId process_id = base::kNullProcessId; |
| 473 if (process_handle != base::kNullProcessHandle) { | 470 if (process_handle != base::kNullProcessHandle) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // sent_requests_ queue should be the one that the plugin just created. | 557 // sent_requests_ queue should be the one that the plugin just created. |
| 561 Client* client = sent_requests_.front(); | 558 Client* client = sent_requests_.front(); |
| 562 sent_requests_.pop(); | 559 sent_requests_.pop(); |
| 563 | 560 |
| 564 const ChildProcessData& data = process_->GetData(); | 561 const ChildProcessData& data = process_->GetData(); |
| 565 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 562 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 566 data.id); | 563 data.id); |
| 567 } | 564 } |
| 568 | 565 |
| 569 } // namespace content | 566 } // namespace content |
| OLD | NEW |