blob: 0f35c986e659e6e4236339344dd6cf81fe74a358 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "base/memory/ref_counted.h"
namespace binder {
class CommandBroker;
class TransactionData;
// An object to perform a transaction.
class Object : public base::RefCountedThreadSafe<Object> {
// Type of an object.
enum Type {
TYPE_LOCAL, // This object lives in this process.
TYPE_REMOTE, // This object lives in a remote process.
// Returns the type of this object.
virtual Type GetType() const = 0;
// Performs a transaction.
virtual bool Transact(CommandBroker* command_broker,
const TransactionData& data,
std::unique_ptr<TransactionData>* reply) = 0;
friend class base::RefCountedThreadSafe<Object>;
virtual ~Object() {}
} // namespace binder