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/common/sandbox_mac.h" | 5 #include "content/common/sandbox_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 147 |
148 for (const auto& kv : params_map_) { | 148 for (const auto& kv : params_map_) { |
149 params.push_back(kv.first.c_str()); | 149 params.push_back(kv.first.c_str()); |
150 params.push_back(kv.second.c_str()); | 150 params.push_back(kv.second.c_str()); |
151 } | 151 } |
152 // The parameters array must be null terminated. | 152 // The parameters array must be null terminated. |
153 params.push_back(static_cast<const char*>(0)); | 153 params.push_back(static_cast<const char*>(0)); |
154 | 154 |
155 if (sandbox_init_with_parameters(profile_str_.c_str(), 0, params.data(), | 155 if (sandbox_init_with_parameters(profile_str_.c_str(), 0, params.data(), |
156 &error_internal)) { | 156 &error_internal)) { |
157 error->assign(error_internal); | 157 error->assign(error_internal); |
Nico
2016/03/31 19:50:15
Can you please add a somewhat detailed comment her
| |
158 #pragma clang diagnostic push | |
159 #pragma clang diagnostic ignored "-Wdeprecated-declarations" | |
158 sandbox_free_error(error_internal); | 160 sandbox_free_error(error_internal); |
161 #pragma clang diagnostic pop | |
159 return false; | 162 return false; |
160 } | 163 } |
161 return true; | 164 return true; |
162 } | 165 } |
163 | 166 |
164 // static | 167 // static |
165 bool Sandbox::QuotePlainString(const std::string& src_utf8, std::string* dst) { | 168 bool Sandbox::QuotePlainString(const std::string& src_utf8, std::string* dst) { |
166 dst->clear(); | 169 dst->clear(); |
167 | 170 |
168 const char* src = src_utf8.c_str(); | 171 const char* src = src_utf8.c_str(); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
524 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { | 527 if (HANDLE_EINTR(fcntl(fd.get(), F_GETPATH, canonical_path)) != 0) { |
525 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " | 528 DPLOG(FATAL) << "GetCanonicalSandboxPath() failed for: " |
526 << path.value(); | 529 << path.value(); |
527 return path; | 530 return path; |
528 } | 531 } |
529 | 532 |
530 return base::FilePath(canonical_path); | 533 return base::FilePath(canonical_path); |
531 } | 534 } |
532 | 535 |
533 } // namespace content | 536 } // namespace content |
OLD | NEW |