Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: content/common/sandbox_mac.mm

Issue 1839243004: Suppress deprecation warnings for OS X sandbox functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ipc/ipc_send_fds_test.cc » ('j') | ipc/ipc_send_fds_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_send_fds_test.cc » ('j') | ipc/ipc_send_fds_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698