OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ | 5 #ifndef TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ |
6 #define TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ | 6 #define TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ |
7 | 7 |
8 #include <ppapi/c/ppb_host_resolver.h> | 8 #include <ppapi/c/ppb_host_resolver.h> |
9 | 9 |
10 #include <netinet/in.h> | 10 #include <netinet/in.h> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "nacl_io/pepper_interface.h" | 14 #include "nacl_io/pepper_interface.h" |
15 #include "sdk_util/macros.h" | 15 #include "sdk_util/macros.h" |
16 | 16 |
17 class FakePepperInterface; | 17 class FakePepperInterface; |
18 class FakeVarManager; | |
19 | 18 |
20 class FakeHostResolverInterface : public nacl_io::HostResolverInterface { | 19 class FakeHostResolverInterface : public nacl_io::HostResolverInterface { |
21 public: | 20 public: |
22 explicit FakeHostResolverInterface(FakePepperInterface* ppapi); | 21 explicit FakeHostResolverInterface(FakePepperInterface* ppapi); |
23 | 22 |
24 virtual PP_Resource Create(PP_Instance); | 23 virtual PP_Resource Create(PP_Instance); |
25 | 24 |
26 virtual int32_t Resolve(PP_Resource, | 25 virtual int32_t Resolve(PP_Resource, |
27 const char*, | 26 const char*, |
28 uint16_t, | 27 uint16_t, |
29 const PP_HostResolver_Hint* hints, | 28 const PP_HostResolver_Hint* hints, |
30 PP_CompletionCallback); | 29 PP_CompletionCallback); |
31 | 30 |
32 virtual PP_Var GetCanonicalName(PP_Resource); | 31 virtual PP_Var GetCanonicalName(PP_Resource); |
33 virtual uint32_t GetNetAddressCount(PP_Resource); | 32 virtual uint32_t GetNetAddressCount(PP_Resource); |
34 virtual PP_Resource GetNetAddress(PP_Resource, uint32_t); | 33 virtual PP_Resource GetNetAddress(PP_Resource, uint32_t); |
35 | 34 |
36 std::string fake_hostname; | 35 std::string fake_hostname; |
37 std::vector<struct sockaddr_in> fake_addresses_v4; | 36 std::vector<struct sockaddr_in> fake_addresses_v4; |
38 std::vector<struct sockaddr_in6> fake_addresses_v6; | 37 std::vector<struct sockaddr_in6> fake_addresses_v6; |
39 | 38 |
40 private: | 39 private: |
41 FakePepperInterface* ppapi_; | 40 FakePepperInterface* ppapi_; |
42 | 41 |
43 DISALLOW_COPY_AND_ASSIGN(FakeHostResolverInterface); | 42 DISALLOW_COPY_AND_ASSIGN(FakeHostResolverInterface); |
44 }; | 43 }; |
45 | 44 |
46 #endif // TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ | 45 #endif // TESTS_NACL_IO_TEST_FAKE_HOST_RESOLVER_INTERFACE_H_ |
OLD | NEW |