summaryrefslogtreecommitdiffstats
path: root/chromeos/binder/local_object.cc
blob: ec9bd37a3b10cad12c1a1941ab93d3f36ea0ceb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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 "chromeos/binder/local_object.h"

#include <utility>

#include "chromeos/binder/transaction_data.h"

namespace binder {

LocalObject::LocalObject(scoped_ptr<TransactionHandler> handler)
    : handler_(std::move(handler)) {}

LocalObject::~LocalObject() {}

Object::Type LocalObject::GetType() const {
  return TYPE_LOCAL;
}

bool LocalObject::Transact(CommandBroker* command_broker,
                           const TransactionData& data,
                           scoped_ptr<TransactionData>* reply) {
  *reply = handler_->OnTransact(command_broker, data);
  return true;
}

}  // namespace binder