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.
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_ADDRESS_RESOLVER_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_ADDRESS_RESOLVER_H_
8 #include "base/macros.h"
9 #include "ppapi/cpp/host_resolver.h"
10 #include "ppapi/utility/completion_callback_factory.h"
11 #include "third_party/webrtc/base/asyncresolverinterface.h"
15 // rtc::AsyncResolverInterface implementation that uses Pepper to resolve
17 class PepperAddressResolver
: public rtc::AsyncResolverInterface
{
19 explicit PepperAddressResolver(const pp::InstanceHandle
& instance
);
20 ~PepperAddressResolver() override
;
22 // rtc::AsyncResolverInterface.
23 void Start(const rtc::SocketAddress
& addr
) override
;
24 bool GetResolvedAddress(int family
, rtc::SocketAddress
* addr
) const override
;
25 int GetError() const override
;
26 void Destroy(bool wait
) override
;
29 void OnResolved(int32_t result
);
31 pp::HostResolver resolver_
;
33 rtc::SocketAddress ipv4_address_
;
34 rtc::SocketAddress ipv6_address_
;
38 pp::CompletionCallbackFactory
<PepperAddressResolver
> callback_factory_
;
40 DISALLOW_COPY_AND_ASSIGN(PepperAddressResolver
);
43 } // namespace remoting
45 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_ADDRESS_RESOLVER_H_