1 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "mojo/public/cpp/system/trap.h" 6 7 #include "mojo/public/c/system/functions.h" 8 9 namespace mojo { 10 CreateTrap(MojoTrapEventHandler handler,ScopedTrapHandle * trap_handle)11MojoResult CreateTrap(MojoTrapEventHandler handler, 12 ScopedTrapHandle* trap_handle) { 13 MojoHandle handle; 14 MojoResult rv = MojoCreateTrap(handler, nullptr, &handle); 15 if (rv == MOJO_RESULT_OK) 16 trap_handle->reset(TrapHandle(handle)); 17 return rv; 18 } 19 20 } // namespace mojo 21