1e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski/****************************************************************************** 2e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * 3e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * Copyright (C) 2016 The Android Open Source Project 4e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * 5e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * Licensed under the Apache License, Version 2.0 (the "License"); 6e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * you may not use this file except in compliance with the License. 7e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * You may obtain a copy of the License at: 8e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * 9e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * http://www.apache.org/licenses/LICENSE-2.0 10e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * 11e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * Unless required by applicable law or agreed to in writing, software 12e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * distributed under the License is distributed on an "AS IS" BASIS, 13e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * See the License for the specific language governing permissions and 15e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * limitations under the License. 16e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * 17e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski ******************************************************************************/ 18e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski 19e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#ifndef BTA_CLOSURE_API_H 20e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#define BTA_CLOSURE_API_H 21e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski 22e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#include <base/bind.h> 23e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#include <base/callback_forward.h> 24e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#include <base/location.h> 25e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski 26e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski/* 27e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * This method post a closure for execution on bta thread. Please see 28e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * documentation at 29e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * https://www.chromium.org/developers/coding-style/important-abstractions-and-data-structures 30e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * for how to handle dynamic memory ownership/smart pointers with base::Owned(), 31e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski * base::Passed(), base::ConstRef() and others. 32e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski */ 33e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowskivoid do_in_bta_thread(const tracked_objects::Location& from_here, 34e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski const base::Closure& task); 35e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski 36e5c78954fb37f7e9a1d66387ebdb3848f04b1082Jakub Pawlowski#endif /* BTA_CLOSURE_API_H */ 37