aboutsummaryrefslogtreecommitdiff
path: root/mojo/public/cpp/bindings/lib/native_struct.cc
blob: 837b75a60e3eb53031c78bcb8dfc946635b48123 (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
30
// Copyright 2016 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 "mojo/public/cpp/bindings/native_struct.h"

namespace mojo {

// static
NativeStructPtr NativeStruct::New() {
  NativeStructPtr rv;
  internal::StructHelper<NativeStruct>::Initialize(&rv);
  return rv;
}

NativeStruct::NativeStruct() : data(nullptr) {}

NativeStruct::~NativeStruct() {}

NativeStructPtr NativeStruct::Clone() const {
  NativeStructPtr rv(New());
  rv->data = data.Clone();
  return rv;
}

bool NativeStruct::Equals(const NativeStruct& other) const {
  return data.Equals(other.data);
}

}  // namespace mojo