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