Home | History | Annotate | Download | only in lib
      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/bindings/native_struct.h"
      6 
      7 #include "mojo/public/cpp/bindings/lib/hash_util.h"
      8 
      9 namespace mojo {
     10 
     11 // static
     12 NativeStructPtr NativeStruct::New() {
     13   return NativeStructPtr(base::in_place);
     14 }
     15 
     16 NativeStruct::NativeStruct() {}
     17 
     18 NativeStruct::~NativeStruct() {}
     19 
     20 NativeStructPtr NativeStruct::Clone() const {
     21   NativeStructPtr rv(New());
     22   rv->data = data;
     23   return rv;
     24 }
     25 
     26 bool NativeStruct::Equals(const NativeStruct& other) const {
     27   return data == other.data;
     28 }
     29 
     30 size_t NativeStruct::Hash(size_t seed) const {
     31   return internal::Hash(seed, data);
     32 }
     33 
     34 }  // namespace mojo
     35