| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/sandbox_init_wrapper.h" | 5 #include "content/common/sandbox_init_wrapper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 | 10 |
| 11 void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) { | 11 void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) { |
| 12 if (!info) | 12 if (!info) |
| 13 return; | 13 return; |
| 14 if (info->legacy) { | 14 if (info->legacy) { |
| 15 // Looks like we are in the case when the new chrome.dll is being launched | 15 // Looks like we are in the case when the new chrome.dll is being launched |
| 16 // by the old chrome.exe, the old chrome exe has SandboxInterfaceInfo as a | 16 // by the old chrome.exe, the old chrome exe has SandboxInterfaceInfo as a |
| 17 // union, while now we have a struct. | 17 // union, while now we have a struct. |
| 18 // TODO(cpu): Remove this nasty hack after M10 release. | 18 // TODO(cpu): Remove this nasty hack after M10 release. |
| 19 broker_services_ = reinterpret_cast<sandbox::BrokerServices*>(info->legacy); | 19 broker_services_ = reinterpret_cast<sandbox::BrokerServices*>(info->legacy); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 41 if (!target_services_) | 41 if (!target_services_) |
| 42 return false; | 42 return false; |
| 43 } else { | 43 } else { |
| 44 // Other process types might or might not be sandboxed. | 44 // Other process types might or might not be sandboxed. |
| 45 // TODO(cpu): clean this mess. | 45 // TODO(cpu): clean this mess. |
| 46 if (!target_services_) | 46 if (!target_services_) |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 return (sandbox::SBOX_ALL_OK == target_services_->Init()); | 49 return (sandbox::SBOX_ALL_OK == target_services_->Init()); |
| 50 } | 50 } |
| OLD | NEW |