OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ | 5 #ifndef PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ |
6 #define PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ | 6 #define PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 std::string host; | 23 std::string host; |
24 uint16_t port; | 24 uint16_t port; |
25 }; | 25 }; |
26 | 26 |
27 namespace proxy { | 27 namespace proxy { |
28 | 28 |
29 class NetAddressResource; | 29 class NetAddressResource; |
30 | 30 |
31 class PPAPI_PROXY_EXPORT HostResolverResourceBase: public PluginResource { | 31 class PPAPI_PROXY_EXPORT HostResolverResourceBase: public PluginResource { |
32 public: | 32 public: |
33 HostResolverResourceBase(Connection connection, PP_Instance instance); | 33 HostResolverResourceBase(Connection connection, |
| 34 PP_Instance instance, |
| 35 bool private_api); |
34 virtual ~HostResolverResourceBase(); | 36 virtual ~HostResolverResourceBase(); |
35 | 37 |
36 int32_t ResolveImpl(const char* host, | 38 int32_t ResolveImpl(const char* host, |
37 uint16_t port, | 39 uint16_t port, |
38 const PP_HostResolver_Private_Hint* hint, | 40 const PP_HostResolver_Private_Hint* hint, |
39 scoped_refptr<TrackedCallback> callback); | 41 scoped_refptr<TrackedCallback> callback); |
40 PP_Var GetCanonicalNameImpl(); | 42 PP_Var GetCanonicalNameImpl(); |
41 uint32_t GetSizeImpl(); | 43 uint32_t GetSizeImpl(); |
42 scoped_refptr<NetAddressResource> GetNetAddressImpl(uint32_t index); | 44 scoped_refptr<NetAddressResource> GetNetAddressImpl(uint32_t index); |
43 | 45 |
44 private: | 46 private: |
45 // IPC message handlers. | 47 // IPC message handlers. |
46 void OnPluginMsgResolveReply( | 48 void OnPluginMsgResolveReply( |
47 const ResourceMessageReplyParams& params, | 49 const ResourceMessageReplyParams& params, |
48 const std::string& canonical_name, | 50 const std::string& canonical_name, |
49 const std::vector<PP_NetAddress_Private>& net_address_list); | 51 const std::vector<PP_NetAddress_Private>& net_address_list); |
50 | 52 |
51 void SendResolve(const HostPortPair& host_port, | 53 void SendResolve(const HostPortPair& host_port, |
52 const PP_HostResolver_Private_Hint* hint); | 54 const PP_HostResolver_Private_Hint* hint); |
53 | 55 |
54 bool ResolveInProgress() const; | 56 bool ResolveInProgress() const; |
55 | 57 |
| 58 bool private_api_; |
| 59 |
56 scoped_refptr<TrackedCallback> resolve_callback_; | 60 scoped_refptr<TrackedCallback> resolve_callback_; |
57 | 61 |
58 // Set to false if there is a pending resolve request or the previous request | 62 // Set to false if there is a pending resolve request or the previous request |
59 // failed. | 63 // failed. |
60 bool allow_get_results_; | 64 bool allow_get_results_; |
61 std::string canonical_name_; | 65 std::string canonical_name_; |
62 std::vector<scoped_refptr<NetAddressResource> > net_address_list_; | 66 std::vector<scoped_refptr<NetAddressResource> > net_address_list_; |
63 | 67 |
64 DISALLOW_COPY_AND_ASSIGN(HostResolverResourceBase); | 68 DISALLOW_COPY_AND_ASSIGN(HostResolverResourceBase); |
65 }; | 69 }; |
66 | 70 |
67 } // namespace proxy | 71 } // namespace proxy |
68 } // namespace ppapi | 72 } // namespace ppapi |
69 | 73 |
70 #endif // PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ | 74 #endif // PPAPI_PROXY_HOST_RESOLVER_RESOURCE_BASE_H_ |
OLD | NEW |