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

Side by Side Diff: sandbox/linux/bpf_dsl/bpf_dsl.cc

Issue 467183005: Remove implicit conversions from scoped_refptr to T* in sandbox/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | sandbox/linux/bpf_dsl/cons_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sandbox/linux/bpf_dsl/bpf_dsl.h" 5 #include "sandbox/linux/bpf_dsl/bpf_dsl.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // tree like: 241 // tree like:
242 // 242 //
243 // expr = e4 243 // expr = e4
244 // expr = (b3 ? e3 : expr) = (b3 ? e3 : e4) 244 // expr = (b3 ? e3 : expr) = (b3 ? e3 : e4)
245 // expr = (b2 ? e2 : expr) = (b2 ? e2 : (b3 ? e3 : e4)) 245 // expr = (b2 ? e2 : expr) = (b2 ? e2 : (b3 ? e3 : e4))
246 // expr = (b1 ? e1 : expr) = (b1 ? e1 : (b2 ? e2 : (b3 ? e3 : e4))) 246 // expr = (b1 ? e1 : expr) = (b1 ? e1 : (b2 ? e2 : (b3 ? e3 : e4)))
247 // 247 //
248 // and end up with an appropriately chained tree. 248 // and end up with an appropriately chained tree.
249 249
250 ResultExpr expr = else_result; 250 ResultExpr expr = else_result;
251 for (Cons<Clause>::List it = clause_list_; it; it = it->tail()) { 251 for (Cons<Clause>::List it = clause_list_; it.get(); it = it->tail()) {
252 Clause clause = it->head(); 252 Clause clause = it->head();
253 expr = ResultExpr( 253 expr = ResultExpr(
254 new const IfThenResultExprImpl(clause.first, clause.second, expr)); 254 new const IfThenResultExprImpl(clause.first, clause.second, expr));
255 } 255 }
256 return expr; 256 return expr;
257 } 257 }
258 258
259 ResultExpr SandboxBPFDSLPolicy::InvalidSyscall() const { 259 ResultExpr SandboxBPFDSLPolicy::InvalidSyscall() const {
260 return Error(ENOSYS); 260 return Error(ENOSYS);
261 } 261 }
262 262
263 ErrorCode SandboxBPFDSLPolicy::EvaluateSyscall(SandboxBPF* sb, 263 ErrorCode SandboxBPFDSLPolicy::EvaluateSyscall(SandboxBPF* sb,
264 int sysno) const { 264 int sysno) const {
265 return EvaluateSyscall(sysno)->Compile(sb); 265 return EvaluateSyscall(sysno)->Compile(sb);
266 } 266 }
267 267
268 ErrorCode SandboxBPFDSLPolicy::InvalidSyscall(SandboxBPF* sb) const { 268 ErrorCode SandboxBPFDSLPolicy::InvalidSyscall(SandboxBPF* sb) const {
269 return InvalidSyscall()->Compile(sb); 269 return InvalidSyscall()->Compile(sb);
270 } 270 }
271 271
272 ResultExpr SandboxBPFDSLPolicy::Trap(::sandbox::Trap::TrapFnc trap_func, 272 ResultExpr SandboxBPFDSLPolicy::Trap(::sandbox::Trap::TrapFnc trap_func,
273 void* aux) { 273 void* aux) {
274 return bpf_dsl::Trap(trap_func, aux); 274 return bpf_dsl::Trap(trap_func, aux);
275 } 275 }
276 276
277 } // namespace bpf_dsl 277 } // namespace bpf_dsl
278 } // namespace sandbox 278 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/bpf_dsl/cons_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698