| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 namespace content { | 45 namespace content { |
| 46 | 46 |
| 47 // NOTE: changes to this class need to be reviewed by the security team. | 47 // NOTE: changes to this class need to be reviewed by the security team. |
| 48 class PpapiPluginSandboxedProcessLauncherDelegate | 48 class PpapiPluginSandboxedProcessLauncherDelegate |
| 49 : public content::SandboxedProcessLauncherDelegate { | 49 : public content::SandboxedProcessLauncherDelegate { |
| 50 public: | 50 public: |
| 51 PpapiPluginSandboxedProcessLauncherDelegate(bool is_broker, | 51 PpapiPluginSandboxedProcessLauncherDelegate(bool is_broker, |
| 52 const PepperPluginInfo& info, | 52 const PepperPluginInfo& info, |
| 53 ChildProcessHost* host) | 53 ChildProcessHost* host) |
| 54 : info_(info), | 54 : |
| 55 #if defined(OS_WIN) |
| 56 info_(info), |
| 57 #endif // OS_WIN |
| 55 #if defined(OS_POSIX) | 58 #if defined(OS_POSIX) |
| 56 ipc_fd_(host->TakeClientFileDescriptor()), | 59 ipc_fd_(host->TakeClientFileDescriptor()), |
| 57 #endif // OS_POSIX | 60 #endif // OS_POSIX |
| 58 is_broker_(is_broker) {} | 61 is_broker_(is_broker) {} |
| 59 | 62 |
| 60 ~PpapiPluginSandboxedProcessLauncherDelegate() override {} | 63 ~PpapiPluginSandboxedProcessLauncherDelegate() override {} |
| 61 | 64 |
| 62 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 63 bool ShouldSandbox() override { | 66 bool ShouldSandbox() override { |
| 64 return !is_broker_; | 67 return !is_broker_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return !is_broker_ && plugin_launcher.empty(); | 107 return !is_broker_ && plugin_launcher.empty(); |
| 105 } | 108 } |
| 106 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 109 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
| 107 #endif // OS_WIN | 110 #endif // OS_WIN |
| 108 | 111 |
| 109 SandboxType GetSandboxType() override { | 112 SandboxType GetSandboxType() override { |
| 110 return SANDBOX_TYPE_PPAPI; | 113 return SANDBOX_TYPE_PPAPI; |
| 111 } | 114 } |
| 112 | 115 |
| 113 private: | 116 private: |
| 117 #if defined(OS_WIN) |
| 114 const PepperPluginInfo& info_; | 118 const PepperPluginInfo& info_; |
| 119 #endif // OS_WIN |
| 115 #if defined(OS_POSIX) | 120 #if defined(OS_POSIX) |
| 116 base::ScopedFD ipc_fd_; | 121 base::ScopedFD ipc_fd_; |
| 117 #endif // OS_POSIX | 122 #endif // OS_POSIX |
| 118 bool is_broker_; | 123 bool is_broker_; |
| 119 | 124 |
| 120 DISALLOW_COPY_AND_ASSIGN(PpapiPluginSandboxedProcessLauncherDelegate); | 125 DISALLOW_COPY_AND_ASSIGN(PpapiPluginSandboxedProcessLauncherDelegate); |
| 121 }; | 126 }; |
| 122 | 127 |
| 123 class PpapiPluginProcessHost::PluginNetworkObserver | 128 class PpapiPluginProcessHost::PluginNetworkObserver |
| 124 : public net::NetworkChangeNotifier::IPAddressObserver, | 129 : public net::NetworkChangeNotifier::IPAddressObserver, |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // sent_requests_ queue should be the one that the plugin just created. | 521 // sent_requests_ queue should be the one that the plugin just created. |
| 517 Client* client = sent_requests_.front(); | 522 Client* client = sent_requests_.front(); |
| 518 sent_requests_.pop(); | 523 sent_requests_.pop(); |
| 519 | 524 |
| 520 const ChildProcessData& data = process_->GetData(); | 525 const ChildProcessData& data = process_->GetData(); |
| 521 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 526 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 522 data.id); | 527 data.id); |
| 523 } | 528 } |
| 524 | 529 |
| 525 } // namespace content | 530 } // namespace content |
| OLD | NEW |