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 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 : | 44 : |
45 #if defined(OS_POSIX) | 45 #if defined(OS_POSIX) |
46 info_(info), | 46 info_(info), |
47 ipc_fd_(host->TakeClientFileDescriptor()), | 47 ipc_fd_(host->TakeClientFileDescriptor()), |
48 #endif // OS_POSIX | 48 #endif // OS_POSIX |
49 is_broker_(is_broker) {} | 49 is_broker_(is_broker) {} |
50 | 50 |
51 ~PpapiPluginSandboxedProcessLauncherDelegate() override {} | 51 ~PpapiPluginSandboxedProcessLauncherDelegate() override {} |
52 | 52 |
53 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
54 virtual bool ShouldSandbox() override { | 54 bool ShouldSandbox() override { |
55 return !is_broker_; | 55 return !is_broker_; |
56 } | 56 } |
57 | 57 |
58 virtual void PreSpawnTarget(sandbox::TargetPolicy* policy, | 58 void PreSpawnTarget(sandbox::TargetPolicy* policy, bool* success) override { |
59 bool* success) { | |
60 if (is_broker_) | 59 if (is_broker_) |
61 return; | 60 return; |
62 // The Pepper process as locked-down as a renderer execpt that it can | 61 // The Pepper process as locked-down as a renderer execpt that it can |
63 // create the server side of chrome pipes. | 62 // create the server side of chrome pipes. |
64 sandbox::ResultCode result; | 63 sandbox::ResultCode result; |
65 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, | 64 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
66 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 65 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
67 L"\\\\.\\pipe\\chrome.*"); | 66 L"\\\\.\\pipe\\chrome.*"); |
68 *success = (result == sandbox::SBOX_ALL_OK); | 67 *success = (result == sandbox::SBOX_ALL_OK); |
69 } | 68 } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // sent_requests_ queue should be the one that the plugin just created. | 479 // sent_requests_ queue should be the one that the plugin just created. |
481 Client* client = sent_requests_.front(); | 480 Client* client = sent_requests_.front(); |
482 sent_requests_.pop(); | 481 sent_requests_.pop(); |
483 | 482 |
484 const ChildProcessData& data = process_->GetData(); | 483 const ChildProcessData& data = process_->GetData(); |
485 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 484 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
486 data.id); | 485 data.id); |
487 } | 486 } |
488 | 487 |
489 } // namespace content | 488 } // namespace content |
OLD | NEW |