1 // Copyright 2014 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 #ifndef TESTS_NACL_IO_TEST_FAKE_NET_ADDRESS_INTERFACE_H_ 6 #define TESTS_NACL_IO_TEST_FAKE_NET_ADDRESS_INTERFACE_H_ 7 8 #include <ppapi/c/ppb_host_resolver.h> 9 10 #include "nacl_io/pepper_interface.h" 11 #include "sdk_util/macros.h" 12 13 class FakeVarManager; 14 class FakePepperInterface; 15 16 class FakeNetAddressInterface : public nacl_io::NetAddressInterface { 17 public: 18 explicit FakeNetAddressInterface(FakePepperInterface* ppapi); 19 20 virtual PP_Resource CreateFromIPv4Address(PP_Instance, PP_NetAddress_IPv4*); 21 virtual PP_Resource CreateFromIPv6Address(PP_Instance, PP_NetAddress_IPv6*); 22 virtual PP_Bool IsNetAddress(PP_Resource); 23 virtual PP_NetAddress_Family GetFamily(PP_Resource); 24 virtual PP_Bool DescribeAsIPv4Address(PP_Resource, PP_NetAddress_IPv4*); 25 virtual PP_Bool DescribeAsIPv6Address(PP_Resource, PP_NetAddress_IPv6*); 26 virtual PP_Var DescribeAsString(PP_Resource, PP_Bool); 27 28 private: 29 FakePepperInterface* ppapi_; 30 31 DISALLOW_COPY_AND_ASSIGN(FakeNetAddressInterface); 32 }; 33 34 #endif // TESTS_NACL_IO_TEST_FAKE_NET_ADDRESS_INTERFACE_H_ 35