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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const base::string16& sid = | 89 const base::string16& sid = |
90 GetContentClient()->browser()->GetAppContainerSidForSandboxType( | 90 GetContentClient()->browser()->GetAppContainerSidForSandboxType( |
91 GetSandboxType()); | 91 GetSandboxType()); |
92 if (!sid.empty()) | 92 if (!sid.empty()) |
93 AddAppContainerPolicy(policy, sid.c_str()); | 93 AddAppContainerPolicy(policy, sid.c_str()); |
94 | 94 |
95 return true; | 95 return true; |
96 } | 96 } |
97 | 97 |
98 #elif defined(OS_POSIX) | 98 #elif defined(OS_POSIX) |
99 bool ShouldUseZygote() override { | 99 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 100 ZygoteHandle* GetZygote() override { |
100 const base::CommandLine& browser_command_line = | 101 const base::CommandLine& browser_command_line = |
101 *base::CommandLine::ForCurrentProcess(); | 102 *base::CommandLine::ForCurrentProcess(); |
102 base::CommandLine::StringType plugin_launcher = browser_command_line | 103 base::CommandLine::StringType plugin_launcher = browser_command_line |
103 .GetSwitchValueNative(switches::kPpapiPluginLauncher); | 104 .GetSwitchValueNative(switches::kPpapiPluginLauncher); |
104 return !is_broker_ && plugin_launcher.empty(); | 105 if (is_broker_ || !plugin_launcher.empty()) |
| 106 return nullptr; |
| 107 |
| 108 static ZygoteHandle zygote; |
| 109 return &zygote; |
105 } | 110 } |
| 111 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 112 |
106 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 113 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
107 #endif // OS_WIN | 114 #endif // OS_WIN |
108 | 115 |
109 SandboxType GetSandboxType() override { | 116 SandboxType GetSandboxType() override { |
110 return SANDBOX_TYPE_PPAPI; | 117 return SANDBOX_TYPE_PPAPI; |
111 } | 118 } |
112 | 119 |
113 private: | 120 private: |
114 const PepperPluginInfo& info_; | 121 const PepperPluginInfo& info_; |
115 #if defined(OS_POSIX) | 122 #if defined(OS_POSIX) |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 // sent_requests_ queue should be the one that the plugin just created. | 523 // sent_requests_ queue should be the one that the plugin just created. |
517 Client* client = sent_requests_.front(); | 524 Client* client = sent_requests_.front(); |
518 sent_requests_.pop(); | 525 sent_requests_.pop(); |
519 | 526 |
520 const ChildProcessData& data = process_->GetData(); | 527 const ChildProcessData& data = process_->GetData(); |
521 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 528 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
522 data.id); | 529 data.id); |
523 } | 530 } |
524 | 531 |
525 } // namespace content | 532 } // namespace content |
OLD | NEW |