Chromium Code Reviews| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 const base::string16& sid = | 85 const base::string16& sid = |
| 86 GetContentClient()->browser()->GetAppContainerSidForSandboxType( | 86 GetContentClient()->browser()->GetAppContainerSidForSandboxType( |
| 87 GetSandboxType()); | 87 GetSandboxType()); |
| 88 if (!sid.empty()) | 88 if (!sid.empty()) |
| 89 AddAppContainerPolicy(policy, sid.c_str()); | 89 AddAppContainerPolicy(policy, sid.c_str()); |
| 90 | 90 |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 #elif defined(OS_POSIX) | 94 #elif defined(OS_POSIX) |
| 95 bool ShouldUseZygote() override { | 95 ZygoteHandle* GetZygote() override { |
| 96 const base::CommandLine& browser_command_line = | 96 const base::CommandLine& browser_command_line = |
| 97 *base::CommandLine::ForCurrentProcess(); | 97 *base::CommandLine::ForCurrentProcess(); |
| 98 base::CommandLine::StringType plugin_launcher = browser_command_line | 98 base::CommandLine::StringType plugin_launcher = browser_command_line |
| 99 .GetSwitchValueNative(switches::kPpapiPluginLauncher); | 99 .GetSwitchValueNative(switches::kPpapiPluginLauncher); |
| 100 return !is_broker_ && plugin_launcher.empty(); | 100 if (!is_broker_ && plugin_launcher.empty()) { |
|
mdempsky
2015/12/22 21:21:33
Nit: It's pretty negligible here, but in general I
Greg K
2016/01/05 21:42:13
Done.
| |
| 101 static ZygoteHandle zygote; | |
| 102 return &zygote; | |
| 103 } | |
| 104 return nullptr; | |
| 101 } | 105 } |
| 102 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 106 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
| 103 #endif // OS_WIN | 107 #endif // OS_WIN |
| 104 | 108 |
| 105 SandboxType GetSandboxType() override { | 109 SandboxType GetSandboxType() override { |
| 106 return SANDBOX_TYPE_PPAPI; | 110 return SANDBOX_TYPE_PPAPI; |
| 107 } | 111 } |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 const PepperPluginInfo& info_; | 114 const PepperPluginInfo& info_; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 // sent_requests_ queue should be the one that the plugin just created. | 516 // sent_requests_ queue should be the one that the plugin just created. |
| 513 Client* client = sent_requests_.front(); | 517 Client* client = sent_requests_.front(); |
| 514 sent_requests_.pop(); | 518 sent_requests_.pop(); |
| 515 | 519 |
| 516 const ChildProcessData& data = process_->GetData(); | 520 const ChildProcessData& data = process_->GetData(); |
| 517 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 521 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 518 data.id); | 522 data.id); |
| 519 } | 523 } |
| 520 | 524 |
| 521 } // namespace content | 525 } // namespace content |
| OLD | NEW |